RESOLVED FIXED 137180
[iOS] Optimize media controls AirPlay discovery
https://bugs.webkit.org/show_bug.cgi?id=137180
Summary [iOS] Optimize media controls AirPlay discovery
Eric Carlson
Reported 2014-09-27 10:42:21 PDT
The iOS media controls register for AirPlay discovery events to know when to include a target picker in the UI. Putting the hardware into discovery mode uses more battery, so don't do it until we can display inline controls, and stop if the element fails to load.
Attachments
Proposed patch. (5.26 KB, patch)
2014-09-27 10:55 PDT, Eric Carlson
no flags
Eric Carlson
Comment 1 2014-09-27 10:55:22 PDT
Created attachment 238780 [details] Proposed patch.
Radar WebKit Bug Importer
Comment 2 2014-09-27 10:58:45 PDT
Darin Adler
Comment 3 2014-09-28 17:26:12 PDT
Comment on attachment 238780 [details] Proposed patch. I’d like to understand more about why we always end up listening soon enough with this code. The trickiest bit of code here is the removeEventListeners case; subtle that it’s always OK to not listen there because setControlsType will always be called later.
Eric Carlson
Comment 4 2014-09-29 09:09:43 PDT
(In reply to comment #3) > (From update of attachment 238780 [details]) > I’d like to understand more about why we always end up listening soon enough with this code. The trickiest bit of code here is the removeEventListeners case; subtle that it’s always OK to not listen there because setControlsType will always be called later. This works because HTMLMediaElement fires an event every time an event listener is added. This means that if we register an event listener when we are about to display the inline controls, we will always get an event so we can configure the controls correctly.
WebKit Commit Bot
Comment 5 2014-09-29 11:12:22 PDT
Comment on attachment 238780 [details] Proposed patch. Clearing flags on attachment: 238780 Committed r174073: <http://trac.webkit.org/changeset/174073>
WebKit Commit Bot
Comment 6 2014-09-29 11:12:26 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.