Title: [201106] trunk/Source/WebCore
Revision
201106
Author
jer.no...@apple.com
Date
2016-05-18 15:40:24 -0700 (Wed, 18 May 2016)

Log Message

Playback session sends audio and text track lists when media does not have audio or text tracks.
https://bugs.webkit.org/show_bug.cgi?id=157865
<rdar://problem/25992750>

Reviewed by Beth Dakin.

Only send across the CaptionUserPreferences-generated list of audio and text tracks if those
text tracks exist in the first place. This matches the behavior of the built-in controls.

* platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
(WebPlaybackSessionModelMediaElement::updateLegibleOptions):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (201105 => 201106)


--- trunk/Source/WebCore/ChangeLog	2016-05-18 22:36:01 UTC (rev 201105)
+++ trunk/Source/WebCore/ChangeLog	2016-05-18 22:40:24 UTC (rev 201106)
@@ -1,3 +1,17 @@
+2016-05-18  Jer Noble  <jer.no...@apple.com>
+
+        Playback session sends audio and text track lists when media does not have audio or text tracks.
+        https://bugs.webkit.org/show_bug.cgi?id=157865
+        <rdar://problem/25992750>
+
+        Reviewed by Beth Dakin.
+
+        Only send across the CaptionUserPreferences-generated list of audio and text tracks if those
+        text tracks exist in the first place. This matches the behavior of the built-in controls.
+
+        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
+        (WebPlaybackSessionModelMediaElement::updateLegibleOptions):
+
 2016-05-18  Chris Dumez  <cdu...@apple.com>
 
         Clean up / Modernize TextAutoSizingValue::adjustNodeSizes()

Modified: trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm (201105 => 201106)


--- trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm	2016-05-18 22:36:01 UTC (rev 201105)
+++ trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm	2016-05-18 22:40:24 UTC (rev 201106)
@@ -33,6 +33,7 @@
 #import "MediaControlsHost.h"
 #import "WebVideoFullscreenInterface.h"
 #import <QuartzCore/CoreAnimation.h>
+#import <WebCore/AudioTrackList.h>
 #import <WebCore/DOMEventListener.h>
 #import <WebCore/Event.h>
 #import <WebCore/EventListener.h>
@@ -263,9 +264,18 @@
         return;
 
     auto& captionPreferences = m_mediaElement->document().page()->group().captionPreferences();
-    m_legibleTracksForMenu = captionPreferences.sortedTrackListForMenu(&m_mediaElement->textTracks());
-    m_audioTracksForMenu = captionPreferences.sortedTrackListForMenu(&m_mediaElement->audioTracks());
+    auto& textTracks = m_mediaElement->textTracks();
+    if (textTracks.length())
+        m_legibleTracksForMenu = captionPreferences.sortedTrackListForMenu(&textTracks);
+    else
+        m_legibleTracksForMenu.clear();
 
+    auto& audioTracks = m_mediaElement->audioTracks();
+    if (audioTracks.length() > 1)
+        m_audioTracksForMenu = captionPreferences.sortedTrackListForMenu(&audioTracks);
+    else
+        m_audioTracksForMenu.clear();
+
     m_playbackSessionInterface->setAudioMediaSelectionOptions(audioMediaSelectionOptions(), audioMediaSelectedIndex());
     m_playbackSessionInterface->setLegibleMediaSelectionOptions(legibleMediaSelectionOptions(), legibleMediaSelectedIndex());
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to