Skip to content

[BUG] iOS: MediaElement Speed not working when media played #1668

Closed

Description

@Cyrus-Vance

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

I am trying to play media using MediaElement with specific play rate. And I found when using iOS, the Speed property won't work after first play. But this will work normally in Windows and Android.
Here's the code:

            <Button
                x:Name="CounterBtn"
                Text="Play" 
                Clicked="OnPlayButtonClicked"
                HorizontalOptions="Fill" />
            <toolkit:MediaElement x:Name="mediaElement"
                Source="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
                ShouldAutoPlay="True"
                ShouldShowPlaybackControls="True"
                HeightRequest="300"
                WidthRequest="400"
             />
        private void OnPlayButtonClicked(object sender, EventArgs e)
        {
            mediaElement.SeekTo(TimeSpan.FromSeconds(0));
            mediaElement.Play();
            mediaElement.Speed = 3;
        }

But I found a way to fix that temporarily on iOS: set the speed to 1 before the correct value. For example:

mediaElement.Speed = 1;
mediaElement.Speed = theCorrectValue;

Expected Behavior

After play button clicked for multiple times, the speed will set to the specific value.

Steps To Reproduce

just set the MediaElement Speed after SeekTo() the start and Play()

Link to public reproduction project repository

https://github.com/Cyrus-Vance/MauiMediaElementExample

Environment

- CommunityToolkit.Maui.MediaElement: 3.0.1
- OS: Windows 11 23H2 Build 22631
- .NET MAUI: 8.0.3

Anything else?

No response

Activity

  1. changed the title [-][BUG] iOS: MediaElement Speed not working when media play after once[/-] [+][BUG] iOS: MediaElement Speed not working when media play once after[/+] on Jan 28, 2024
  2. changed the title [-][BUG] iOS: MediaElement Speed not working when media play once after[/-] [+][BUG] iOS: MediaElement Speed not working when media played[/+] on Jan 30, 2024
  3. vhugogarcia commented on Jul 23, 2024

    @vhugogarcia
    Contributor

    Thanks @Cyrus-Vance for reporting this issue. I ran some tests on iOS and the issue has been fixed on the CommunityToolkit.Maui.MediaElement version 4.0.1 using .NET MAUI 8.0.70.

    I'm closing this issue. We can re-open it the issue returns.

    Screen.Recording.2024-07-23.at.11.57.19.a.m.mov
  4. locked and limited conversation to collaborators on Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions