Title: [201882] trunk/Source/WebCore
Revision
201882
Author
[email protected]
Date
2016-06-09 14:01:55 -0700 (Thu, 09 Jun 2016)

Log Message

Pass through play state and toggle state to the WebPlaybackControlsManager
https://bugs.webkit.org/show_bug.cgi?id=158578
<rdar://problem/25045616>

Reviewed by Beth Dakin.

Pass through the isPlaying portion of setRate() and allow toggling when a model is present.

* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::setRate):
(WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (201881 => 201882)


--- trunk/Source/WebCore/ChangeLog	2016-06-09 20:50:44 UTC (rev 201881)
+++ trunk/Source/WebCore/ChangeLog	2016-06-09 21:01:55 UTC (rev 201882)
@@ -1,3 +1,19 @@
+2016-06-09  Jer Noble  <[email protected]>
+
+        Pass through play state and toggle state to the WebPlaybackControlsManager
+        https://bugs.webkit.org/show_bug.cgi?id=158578
+        <rdar://problem/25045616>
+
+        Reviewed by Beth Dakin.
+
+        Pass through the isPlaying portion of setRate() and allow toggling when a model is present.
+
+        * platform/mac/WebPlaybackControlsManager.h:
+        * platform/mac/WebPlaybackControlsManager.mm:
+        * platform/mac/WebPlaybackSessionInterfaceMac.mm:
+        (WebCore::WebPlaybackSessionInterfaceMac::setRate):
+        (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
+
 2016-06-09  Frederic Wang  <[email protected]>
 
         RenderMathOperator: Move calculation of preferred width into MathOperator

Modified: trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.h (201881 => 201882)


--- trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.h	2016-06-09 20:50:44 UTC (rev 201881)
+++ trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.h	2016-06-09 21:01:55 UTC (rev 201882)
@@ -49,6 +49,8 @@
     BOOL _hasEnabledAudio;
     BOOL _hasEnabledVideo;
     float _rate;
+    BOOL _playing;
+    BOOL _canTogglePlayback;
 
 @private
     WebCore::WebPlaybackSessionInterfaceMac* _webPlaybackSessionInterfaceMac;
@@ -61,6 +63,8 @@
 @property (readwrite) BOOL hasEnabledAudio;
 @property (readwrite) BOOL hasEnabledVideo;
 @property (nonatomic) float rate;
+@property (getter=isPlaying) BOOL playing;
+@property BOOL canTogglePlayback;
 
 - (void)setAudioMediaSelectionOptions:(const Vector<WTF::String>&)options withSelectedIndex:(NSUInteger)selectedIndex;
 - (void)setLegibleMediaSelectionOptions:(const Vector<WTF::String>&)options withSelectedIndex:(NSUInteger)selectedIndex;

Modified: trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm (201881 => 201882)


--- trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm	2016-06-09 20:50:44 UTC (rev 201881)
+++ trunk/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm	2016-06-09 21:01:55 UTC (rev 201882)
@@ -38,6 +38,8 @@
 @synthesize hasEnabledAudio=_hasEnabledAudio;
 @synthesize hasEnabledVideo=_hasEnabledVideo;
 @synthesize rate=_rate;
+@synthesize playing=_playing;
+@synthesize canTogglePlayback=_canTogglePlayback;
 
 - (AVValueTiming *)timing
 {

Modified: trunk/Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm (201881 => 201882)


--- trunk/Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm	2016-06-09 20:50:44 UTC (rev 201881)
+++ trunk/Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm	2016-06-09 21:01:55 UTC (rev 201882)
@@ -88,6 +88,7 @@
 {
     WebPlaybackControlsManager* controlsManager = playBackControlsManager();
     [controlsManager setRate:isPlaying ? playbackRate : 0.];
+    [controlsManager setPlaying:isPlaying];
 
     if (m_client)
         m_client->rateChanged(isPlaying, playbackRate);
@@ -157,6 +158,8 @@
     manager.hasEnabledVideo = duration > 0;
     manager.rate = m_playbackSessionModel->isPlaying() ? m_playbackSessionModel->playbackRate() : 0.;
     manager.seekableTimeRanges = timeRangesToArray(m_playbackSessionModel->seekableRanges()).get();
+    manager.canTogglePlayback = YES;
+    manager.playing = m_playbackSessionModel->isPlaying();
     [manager setAudioMediaSelectionOptions:m_playbackSessionModel->audioMediaSelectionOptions() withSelectedIndex:static_cast<NSUInteger>(m_playbackSessionModel->audioMediaSelectedIndex())];
     [manager setLegibleMediaSelectionOptions:m_playbackSessionModel->legibleMediaSelectionOptions() withSelectedIndex:static_cast<NSUInteger>(m_playbackSessionModel->legibleMediaSelectedIndex())];
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to