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

[REVERTED] [MediaElement] Removed line that pauses player before setting it to null. #9531

Merged
merged 3 commits into from
Aug 4, 2020

Conversation

StevenGranados
Copy link
Contributor

@StevenGranados StevenGranados commented Feb 11, 2020

Description of Change

Removed line that pauses player before setting it to null.
I think the pause is there to stop background playback of the media element, but since the next line also seems to stop it, I removed the line.
I appreciate there is probably a lot more going on here though @peterfoot .
I'm not sure how to handle the video source, there has to be one for the exception to occur. It's currently taking a hard-coded URL source.

Issues Resolved

API Changes

None

Platforms Affected

  • iOS

Behavioral/Visual Changes

Will now not give an exception on Dispose.

Before/After Screenshots

Not applicable

Testing Procedure

Have a page in iOS with a media element. Change page so that the media element is disposed.

PR Checklist

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

@dnfclas
Copy link

dnfclas commented Feb 11, 2020

CLA assistant check
All CLA requirements met.

@StevenGranados StevenGranados changed the base branch from 4.5.0 to master February 11, 2020 22:39
@samhouts samhouts added this to In Review in v4.6.0 Feb 12, 2020
@samhouts samhouts added a/mediaelement i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often labels Feb 12, 2020
Copy link
Contributor

@peterfoot peterfoot left a comment

Choose a reason for hiding this comment

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

Good catch, the Pause does now seem redundant

@samhouts samhouts added this to In Review in MediaElement Feb 13, 2020
@samhouts samhouts changed the base branch from master to 4.6.0 February 27, 2020 23:30
@StevenGranados
Copy link
Contributor Author

This is my first pull request, so I've almost certainly done something wrong on my UITest. Seeing as it is a simple fix on a new control, maybe best if the test is removed?

Copy link
Member

@samhouts samhouts left a comment

Choose a reason for hiding this comment

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

Looks good, just need to fix the test.

new MediaElement
{
AutomationId = "Issue9525MediaElement",
Source="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
Copy link
Member

Choose a reason for hiding this comment

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

We need to find a video that won't disappear on us. Something uploaded to the source, perhaps.

@StevenGranados
Copy link
Contributor Author

#9525 (comment)
This comment seems to suggest a better fix than mine.

@samhouts samhouts changed the base branch from 4.6.0 to 4.7.0 June 8, 2020 21:51
@samhouts samhouts changed the title Fix issue 9525 [MediaElement] Removed line that pauses player before setting it to null. Jun 8, 2020
@samhouts samhouts removed this from In Review in v4.6.0 Jun 8, 2020
@samhouts samhouts added this to In Progress in 4.7.0 Jun 20, 2020
@samhouts samhouts changed the base branch from 4.7.0 to 4.8.0 July 8, 2020 18:07
@samhouts samhouts removed this from In Progress in 4.7.0 Jul 8, 2020
@rmarinho
Copy link
Member

Hey @StevenGranados can you fix the flag and upload a video so we can use on the repo? thanks

@StevenGranados
Copy link
Contributor Author

I don't know how to put files in the source. I think there might have to be a new type of MediaSource to allow for it. At the moment there is Uri and File (I assume from the device file system).
I've tried to put a video in as an embedded resource, but I can't use streams in the Source property.
I've tried to put a video in each project separately (Resources folder and set to BundleResource) and refer to the filename in the Source property, but I'm not having any joy. @peterfoot any ideas?

@StevenGranados
Copy link
Contributor Author

#11417 uses a Uri in the Source parameter. I assume you can control the availability of this?

@peterfoot
Copy link
Contributor

@StevenGranados I think @rmarinho just meant a video online in a location which won't change. Personally I've always found this to be an issue, even when testing against Channel 9 videos e.g. https://sec.ch9.ms/ch9/80a3/6563611f-6a39-44fa-a768-1a58bdd080a3/HotRestart.mp4 So I'd suggest something like that which should hopefully be stable for months if not longer.

@StevenGranados
Copy link
Contributor Author

@rmarinho I've made some changes

I think the pause is there to stop background playback of the mediaelement, but since the next line also seems to stop it, I removed the line.
This reverts commit 7a8d7d8.
@samhouts samhouts added this to In Progress in vCurrent (4.8.0) Jul 30, 2020
@samhouts samhouts merged commit 9f3410b into xamarin:4.8.0 Aug 4, 2020
MediaElement automation moved this from In Review to Done Aug 4, 2020
vCurrent (4.8.0) automation moved this from In Progress to Done Aug 4, 2020
@samhouts samhouts added this to Done in Sprint 174 Aug 5, 2020
@samhouts samhouts added this to the 4.8.0 milestone Aug 5, 2020
PureWeen added a commit that referenced this pull request Aug 20, 2020
@PureWeen
Copy link
Contributor

@peterfoot @StevenGranados FYI

#11862

rmarinho pushed a commit that referenced this pull request Aug 20, 2020
@samhouts samhouts removed this from Done in MediaElement Sep 3, 2020
@samhouts samhouts changed the title [MediaElement] Removed line that pauses player before setting it to null. [REVERTED] [MediaElement] Removed line that pauses player before setting it to null. Sep 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/mediaelement i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often p/iOS 🍎 reverted t/bug 🐛
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

[Bug] MediaElement Disposing exception when MainPage is changed on iOS
6 participants