[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
eric.carlson at apple.com
eric.carlson at apple.com
Thu Oct 29 20:50:08 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit d00c7269a9f9a84cbaacf33d31e3baaa9aab799f
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 22 18:10:41 2009 +0000
2009-10-22 Eric Carlson <eric.carlson at apple.com>
Reviewed by Dan Bernstein & Simon Fraser.
<rdar://problem/7297717>
https://bugs.webkit.org/show_bug.cgi?id=30323
Play/pause button in full-screen video controller does not reflect current state
* WebView/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController setMediaElement:WebCore::]): Register for QTMovieRateDidChangeNotification
(-[WebVideoFullscreenController rateChanged:]): Call HUD controller when rate changes.
* WebView/WebVideoFullscreenHUDWindowController.h:
* WebView/WebVideoFullscreenHUDWindowController.mm:
(-[WebVideoFullscreenHUDWindowController scheduleTimeUpdate]): Call updateRate so play button
reflects playback state.
(-[WebVideoFullscreenHUDWindowController updateRate]): New, set play button state according to
movie state.
(-[WebVideoFullscreenHUDWindowController playingChanged:]): Only call [self playing] once.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index bf4c6f9..16fd3e4 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,23 @@
+2009-10-22 Eric Carlson <eric.carlson at apple.com>
+
+ Reviewed by Dan Bernstein & Simon Fraser.
+
+ <rdar://problem/7297717>
+ https://bugs.webkit.org/show_bug.cgi?id=30323
+ Play/pause button in full-screen video controller does not reflect current state
+
+ * WebView/WebVideoFullscreenController.mm:
+ (-[WebVideoFullscreenController setMediaElement:WebCore::]): Register for QTMovieRateDidChangeNotification
+ (-[WebVideoFullscreenController rateChanged:]): Call HUD controller when rate changes.
+
+ * WebView/WebVideoFullscreenHUDWindowController.h:
+ * WebView/WebVideoFullscreenHUDWindowController.mm:
+ (-[WebVideoFullscreenHUDWindowController scheduleTimeUpdate]): Call updateRate so play button
+ reflects playback state.
+ (-[WebVideoFullscreenHUDWindowController updateRate]): New, set play button state according to
+ movie state.
+ (-[WebVideoFullscreenHUDWindowController playingChanged:]): Only call [self playing] once.
+
2009-10-21 John Sullivan <sullivan at apple.com>
Rubber-stamped by Dan Bernstein.
diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.mm b/WebKit/mac/WebView/WebVideoFullscreenController.mm
index f54b177..39ec72a 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenController.mm
+++ b/WebKit/mac/WebView/WebVideoFullscreenController.mm
@@ -42,6 +42,10 @@
SOFT_LINK_FRAMEWORK(QTKit)
SOFT_LINK_CLASS(QTKit, QTMovieView)
+SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
+
+#define QTMovieRateDidChangeNotification getQTMovieRateDidChangeNotification()
+
@interface WebVideoFullscreenWindow : NSWindow
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER)
<NSAnimationDelegate>
@@ -76,6 +80,7 @@ SOFT_LINK_CLASS(QTKit, QTMovieView)
{
ASSERT(!_backgroundFullscreenWindow);
ASSERT(!_fadeAnimation);
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
@@ -109,7 +114,15 @@ SOFT_LINK_CLASS(QTKit, QTMovieView)
_mediaElement = mediaElement;
if ([self isWindowLoaded]) {
QTMovieView *movieView = [[self fullscreenWindow] movieView];
- [movieView setMovie:_mediaElement->platformMedia().qtMovie];
+ QTMovie *movie = _mediaElement->platformMedia().qtMovie;
+
+ ASSERT(movieView);
+ ASSERT(movie);
+ [movieView setMovie:movie];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(rateChanged:)
+ name:QTMovieRateDidChangeNotification
+ object:movie];
}
}
@@ -286,6 +299,16 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
{
[_hudController fadeWindowIn];
}
+
+#pragma mark -
+#pragma mark QTMovie callbacks
+
+- (void)rateChanged:(NSNotification *)unusedNotification
+{
+ UNUSED_PARAM(unusedNotification);
+ [_hudController updateRate];
+}
+
@end
@implementation WebVideoFullscreenWindow
@@ -442,6 +465,7 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
[super resignKeyWindow];
[[self windowController] requestExitFullscreenWithAnimation:NO];
}
+
@end
#endif /* ENABLE(VIDEO) */
diff --git a/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.h b/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.h
index 8b06c1c..abc8092 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.h
+++ b/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.h
@@ -50,6 +50,7 @@
- (void)fadeWindowIn;
- (void)fadeWindowOut;
- (void)closeWindow;
+- (void)updateRate;
@end
diff --git a/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm b/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
index 4236298..17729d3 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
+++ b/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
@@ -181,6 +181,7 @@ static const NSTimeInterval HUDWindowFadeOutDelay = 3;
// First, update right away, then schedule future update
[self updateTime];
+ [self updateRate];
[_timelineUpdateTimer invalidate];
[_timelineUpdateTimer release];
@@ -466,12 +467,18 @@ static NSTextField *createTimeTextField(NSRect frame)
[_delegate mediaElement]->setVolume(volume / [self maxVolume], e);
}
+- (void)updateRate
+{
+ [_playButton setIntValue:[self playing]];
+}
+
- (void)playingChanged:(id)sender
{
- [self setPlaying:![self playing]];
-
+ BOOL nowPlaying = [self playing];
+ [self setPlaying:!nowPlaying];
+
// Keep HUD visible when paused
- if (![self playing])
+ if (!nowPlaying)
[self fadeWindowIn];
else if (!_mouseIsInHUD) {
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(fadeWindowOut) object:nil];
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list