Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[iOS] Fix issue with duplicated played to end observer in MediaElement #11360

Merged
merged 1 commit into from
Jul 16, 2020

Conversation

jsuarezruiz
Copy link
Contributor

Description of Change

Fix issue with duplicated played to end observer in MediaElement on iOS.

Issues Resolved

API Changes

None

Platforms Affected

  • iOS

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

Launch Core Gallery and navigate to the MediaElement Gallery. Reproduce the video and move the time to the end. MediaEnded must be invoked only one time.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@@ -24,9 +24,7 @@ public sealed class MediaElementRenderer : ViewRenderer<MediaElement, UIView>
[Internals.Preserve(Conditional = true)]
public MediaElementRenderer()
{
Xamarin.Forms.MediaElement.VerifyMediaElementFlagEnabled(nameof(MediaElementRenderer));

_playedToEndObserver = NSNotificationCenter.DefaultCenter.AddObserver(AVPlayerItem.DidPlayToEndTimeNotification, PlayedToEnd);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already add the observer here

_playedToEndObserver = NSNotificationCenter.DefaultCenter.AddObserver(AVPlayerItem.DidPlayToEndTimeNotification, PlayedToEnd);

@StephaneDelcroix
Copy link
Member

I'd retarget this to 4.8

@samhouts samhouts requested review from hartez and samhouts July 8, 2020 15:21
@samhouts samhouts changed the base branch from 4.7.0 to 4.8.0 July 8, 2020 17:08
@samhouts samhouts removed the request for review from hartez July 8, 2020 17:08
@samhouts samhouts assigned StephaneDelcroix and unassigned hartez Jul 8, 2020
@samhouts samhouts added the Core label Jul 8, 2020
@samhouts
Copy link
Member

@jsuarezruiz Can you please rebase this on 4.8.0 to get rid of the extra commits? Thanks!

@jsuarezruiz jsuarezruiz changed the base branch from 4.8.0 to 4.7.0 July 14, 2020 12:00
@jsuarezruiz jsuarezruiz changed the base branch from 4.7.0 to 4.8.0 July 14, 2020 12:06
@jsuarezruiz
Copy link
Contributor Author

@samhouts Retarget to 4.8.0 :)

@samhouts samhouts merged commit 711a72d into 4.8.0 Jul 16, 2020
@samhouts samhouts deleted the fix-11315 branch July 16, 2020 21:38
@samhouts samhouts added the approved Has two approvals, no pending reviews, and no changes requested label Jul 16, 2020
@samhouts samhouts added this to the 4.8.0 milestone Jul 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/mediaelement approved Has two approvals, no pending reviews, and no changes requested Core p/iOS 🍎 t/bug 🐛
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants