Reviewed by Dan Bernstein.
<rdar://problem/
7035231>
Support closed caption in <video> element
Test: media/media-captions.html
* WebCore.base.exp:
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::controlTypeName):
Define ShowClosedCaptionsButton and HideClosedCaptionsButton.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
Add MediaToggleClosedCaptionsButtonPart.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::extractPseudoType):
Define and match mediaControlsToggleClosedCaptionsButton.
* css/CSSSelector.h:
(WebCore::CSSSelector::):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
Define and match PseudoMediaControlsToggleClosedCaptions.
* css/CSSValueKeywords.in:
Define and use media-toggle-closed-captions-button.
* css/mediaControls.css:
* css/mediaControlsQuickTime.css:
Add webkit-media-controls-toggle-closed-captions-button.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
Initialize m_closedCaptionsVisible.
(WebCore::HTMLMediaElement::loadInternal):
Set m_closedCaptionsVisible to false.
(WebCore::HTMLMediaElement::hasClosedCaptions):
(WebCore::HTMLMediaElement::closedCaptionsVisible):
(WebCore::HTMLMediaElement::setClosedCaptionsVisible):
New, captions internal methods.
(WebCore::HTMLMediaElement::setWebkitClosedCaptionsVisible):
(WebCore::HTMLMediaElement::webkitClosedCaptionsVisible):
(WebCore::HTMLMediaElement::webkitHasClosedCaptions):
New, captions DOM API.
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
Declare methods needed for captions API.
* platform/ThemeTypes.h:
Add MediaToggleClosedCaptionsButtonPart.
* platform/android/LocalizedStringsAndroid.cpp:
(WebCore::localizedMediaControlElementString):
(WebCore::localizedMediaControlElementHelpText):
(WebCore::localizedMediaTimeDescription):
Add empty implmentations.
* platform/graphics/MediaPlayer.cpp:
(WebCore::NullMediaPlayerPrivate::hasClosedCaptions):
(WebCore::NullMediaPlayerPrivate::setClosedCaptionsVisible):
New, empty implementations of media engine closed caption functions.
(WebCore::MediaPlayer::hasClosedCaptions):
(WebCore::MediaPlayer::setClosedCaptionsVisible):
New, call media engine closed caption functions.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::hasClosedCaptions):
(WebCore::MediaPlayerPrivateInterface::setClosedCaptionsVisible):
Declare new media engine methods.
* platform/graphics/mac/MediaPlayerPrivateQTKit.h:
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivate::hasClosedCaptions):
(WebCore::MediaPlayerPrivate::setClosedCaptionsVisible):
New, QTKit implementation of closed caption methods.
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::localizedMediaControlElementString):
(WebCore::localizedMediaControlElementHelpText):
Add help text for ShowClosedCaptionsButton and HideClosedCaptionsButton.
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:
Declare and initialize wkQTMovieHasClosedCaptions and wkQTMovieSetShowClosedCaptions.
* rendering/MediaControlElements.cpp:
(WebCore::MediaControlInputElement::MediaControlInputElement):
Deal with MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON.
(WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::updateDisplayType):
New, implement the closed caption toggle button,
* rendering/MediaControlElements.h:
Define MediaShowClosedCaptionsButton and MediaHideClosedCaptionsButton,
declare MediaControlToggleClosedCaptionsButtonElement.
* rendering/RenderMedia.cpp:
(WebCore::RenderMedia::styleDidChange):
(WebCore::RenderMedia::createToggleClosedCaptionsButton):
(WebCore::RenderMedia::createStatusDisplay):
(WebCore::RenderMedia::updateControls):
(WebCore::RenderMedia::forwardEvent):
* rendering/RenderMedia.h:
Deal with m_toggleClosedCaptionsButton.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
Deal with MediaToggleClosedCaptionsButtonPart.
* rendering/RenderTheme.h:
* rendering/RenderThemeMac.h:
Declare paintMediaToggleClosedCaptionsButton.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMediaToggleClosedCaptionsButton):
New.
(WebCore::RenderThemeMac::shouldRenderMediaControlPart):
Don't render captions toggle button unless we are using the new theme, the
movie has captions, and the movie is in a <video> element since we currently
rely on QTKit to render the captions.
* rendering/style/RenderStyleConstants.h:
Define MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON.
2009-11-19 Eric Carlson <eric.carlson@apple.com>
Reviewed by Dan Bernstein.
<rdar://problem/
7035231>
Support closed caption in <video> element
* media/media-captions-expected.txt: Added.
* media/media-captions.html: Added.
* media/content/counting-captioned.mov: Added.
* platform/gtk/Skipped:
* platform/mac-leopard/Skipped:
* platform/mac-tiger/Skipped:
* platform/win/Skipped:
Skipped on platforms that don't support closed captions yet.
2009-11-19 Eric Carlson <eric.carlson@apple.com>
Reviewed by Dan Bernstein.
<rdar://problem/
7035231>
Support closed caption in <video> element
* English.lproj/Localizable.strings:
Add strings for toggle captions button.
2009-11-19 Eric Carlson <eric.carlson@apple.com>
Reviewed by Dan Bernstein.
<rdar://problem/
7035231>
Support closed caption in <video> element
* WebCoreSupport/WebSystemInterface.m:
(InitWebCoreSystemInterface):
Add QTMovieHasClosedCaptions and QTMovieSetShowClosedCaptions.
* WebCoreSupport/WebViewFactory.mm:
(-[WebViewFactory localizedMediaControlElementString:]):
(-[WebViewFactory localizedMediaControlElementHelpText:]):
Add accessibility help strings for media controller closed caption button.
2009-11-19 Eric Carlson <eric.carlson@apple.com>
Reviewed by Dan Bernstein.
<rdar://problem/
7035231>
Support closed caption in <video> element
* WebCoreLocalizedStrings.cpp:
(WebCore::localizedMediaControlElementString):
(WebCore::localizedMediaControlElementHelpText):
Add accessibility help strings for media controller closed caption button.
2009-11-19 Eric Carlson <eric.carlson@apple.com>
Reviewed by Dan Bernstein.
<rdar://problem/
7035231>
Support closed caption in <video> element
* WebKitSystemInterface.h:
Add prototypes for WKQTMovieHasClosedCaptions and WKQTMovieSetShowClosedCaptions,
define WKMediaUIPartToggleClosedCaptionsButton.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51191
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2009-11-19 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/7035231>
+ Support closed caption in <video> element
+
+ * media/media-captions-expected.txt: Added.
+ * media/media-captions.html: Added.
+ * media/content/counting-captioned.mov: Added.
+
+ * platform/gtk/Skipped:
+ * platform/mac-leopard/Skipped:
+ * platform/mac-tiger/Skipped:
+ * platform/win/Skipped:
+ Skipped on platforms that don't support closed captions yet.
+
2009-11-19 Pavel Feldman <pfeldman@chromium.org>
Reviewed by Gustavo Noronha Silva.
--- /dev/null
+Test media element close caption API.
+
+Test before movie is open:
+EXPECTED (mediaElement.webkitHasClosedCaptions == 'false') OK
+EXPECTED (mediaElement.webkitClosedCaptionsVisible == 'false') OK
+
+Loading "content/test.wav". Audio-only file without captions.
+EVENT(loadstart)
+EVENT(durationchange)
+EVENT(loadedmetadata)
+EXPECTED (mediaElement.webkitHasClosedCaptions == 'false') OK
+EXPECTED (mediaElement.webkitClosedCaptionsVisible == 'false') OK
+*** enabling captions
+EXPECTED (mediaElement.webkitClosedCaptionsVisible == 'false') OK
+
+Loading "content/counting-captioned.mov". QuickTime movie with captions..
+EVENT(loadstart)
+EVENT(durationchange)
+EVENT(loadedmetadata)
+EXPECTED (mediaElement.webkitHasClosedCaptions == 'true') OK
+EXPECTED (mediaElement.webkitClosedCaptionsVisible == 'false') OK
+*** enabling captions
+EXPECTED (mediaElement.webkitClosedCaptionsVisible == 'true') OK
+
+END OF TEST
+
--- /dev/null
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>closed caption API test</title>
+
+ <script src=video-test.js></script>
+ <script src=media-fullscreen.js></script>
+
+ <script>
+ var movieInfo =
+ {
+ current : -1,
+ movies :
+ [
+ {
+ url : "content/test.wav",
+ description : "Audio-only file without captions",
+ hasCaptions : false,
+ },
+ {
+ url : "content/counting-captioned.mov",
+ description : "QuickTime movie with captions.",
+ hasCaptions : true,
+ },
+ ]
+ };
+
+
+ function canplaythrough()
+ {
+ var movie = movieInfo.movies[movieInfo.current];
+
+ testExpected("mediaElement.webkitHasClosedCaptions", movie.hasCaptions);
+ testExpected("mediaElement.webkitClosedCaptionsVisible", false);
+
+ // Try to enable captions, they should only be enabled after if the movie has captions.
+ consoleWrite("*** enabling captions");
+ mediaElement.webkitClosedCaptionsVisible = true;
+ testExpected("mediaElement.webkitClosedCaptionsVisible", movie.hasCaptions);
+
+ openNextMovie();
+ }
+
+ function openNextMovie()
+ {
+ consoleWrite("");
+
+ movieInfo.current++;
+ if (movieInfo.current >= movieInfo.movies.length)
+ {
+ endTest();
+ return;
+ }
+
+ var url = movieInfo.movies[movieInfo.current].url;
+ video.src = url;
+ var desc = "<b>Loading</b> <em>\""+ url + "\"</em>" +
+ ". " + movieInfo.movies[movieInfo.current].description + ".</em>";
+ consoleWrite(desc);
+ if (movieInfo.current > 0)
+ video.load();
+ }
+
+ function start()
+ {
+ findMediaElement();
+
+ waitForEvent("error");
+ waitForEvent("loadstart");
+ waitForEvent("waiting");
+ waitForEvent("ratechange");
+ waitForEvent("durationchange");
+ waitForEvent("pause");
+ waitForEvent("play");
+ waitForEvent("playing");
+
+ waitForEvent('loadedmetadata', canplaythrough);
+
+ consoleWrite("<b>Test before movie is open:</b>");
+ testExpected("mediaElement.webkitHasClosedCaptions", false);
+ testExpected("mediaElement.webkitClosedCaptionsVisible", false);
+
+ openNextMovie();
+ }
+
+ </script>
+
+ </head>
+
+ <body onload="start()">
+
+ <video controls></video>
+
+ <p>Test media element close caption API.</p>
+
+ </body>
+</html>
# Tests requiring fullscreen <video> support
media/media-fullscreen-inline.html
media/media-fullscreen-not-in-document.html
+# Requires media engine closed caption support
+media/media-captions.html
# Tests in plugins/ directory
# These tests require ObjC plugin, do not bother trying to get them to work
media/media-fullscreen-inline.html
media/media-fullscreen-not-in-document.html
+# Requires media engine closed caption support
+media/media-captions.html
+
# Tests of accessibility functionality not supported on Leopard
accessibility/aria-list-and-listitem.html
media/media-fullscreen-inline.html
media/media-fullscreen-not-in-document.html
+# Requires media engine closed caption support
+media/media-captions.html
+
# Tests of accessibility functionality not supported on Tiger
accessibility/aria-list-and-listitem.html
media/media-fullscreen-inline.html
media/media-fullscreen-not-in-document.html
+# Requires media engine closed caption support
+media/media-captions.html
+
# <rdar://problem/5075790> Layout tests that depend on certain fonts don't match Mac results:
# - Mac OS X and Windows do not have an Arabic font in common
fast/text/international/bidi-AN-after-L.html
+2009-11-19 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/7035231>
+ Support closed caption in <video> element
+
+ Test: media/media-captions.html
+
+ * WebCore.base.exp:
+ * accessibility/AccessibilityMediaControls.cpp:
+ (WebCore::AccessibilityMediaControl::controlTypeName):
+ Define ShowClosedCaptionsButton and HideClosedCaptionsButton.
+
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ Add MediaToggleClosedCaptionsButtonPart.
+
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::extractPseudoType):
+ Define and match mediaControlsToggleClosedCaptionsButton.
+
+ * css/CSSSelector.h:
+ (WebCore::CSSSelector::):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
+ Define and match PseudoMediaControlsToggleClosedCaptions.
+
+ * css/CSSValueKeywords.in:
+ Define and use media-toggle-closed-captions-button.
+
+ * css/mediaControls.css:
+ * css/mediaControlsQuickTime.css:
+ Add webkit-media-controls-toggle-closed-captions-button.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::HTMLMediaElement):
+ Initialize m_closedCaptionsVisible.
+ (WebCore::HTMLMediaElement::loadInternal):
+ Set m_closedCaptionsVisible to false.
+ (WebCore::HTMLMediaElement::hasClosedCaptions):
+ (WebCore::HTMLMediaElement::closedCaptionsVisible):
+ (WebCore::HTMLMediaElement::setClosedCaptionsVisible):
+ New, captions internal methods.
+ (WebCore::HTMLMediaElement::setWebkitClosedCaptionsVisible):
+ (WebCore::HTMLMediaElement::webkitClosedCaptionsVisible):
+ (WebCore::HTMLMediaElement::webkitHasClosedCaptions):
+ New, captions DOM API.
+
+ * html/HTMLMediaElement.h:
+ * html/HTMLMediaElement.idl:
+ Declare methods needed for captions API.
+
+ * platform/ThemeTypes.h:
+ Add MediaToggleClosedCaptionsButtonPart.
+
+ * platform/android/LocalizedStringsAndroid.cpp:
+ (WebCore::localizedMediaControlElementString):
+ (WebCore::localizedMediaControlElementHelpText):
+ (WebCore::localizedMediaTimeDescription):
+ Add empty implmentations.
+
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::NullMediaPlayerPrivate::hasClosedCaptions):
+ (WebCore::NullMediaPlayerPrivate::setClosedCaptionsVisible):
+ New, empty implementations of media engine closed caption functions.
+ (WebCore::MediaPlayer::hasClosedCaptions):
+ (WebCore::MediaPlayer::setClosedCaptionsVisible):
+ New, call media engine closed caption functions.
+
+ * platform/graphics/MediaPlayer.h:
+ * platform/graphics/MediaPlayerPrivate.h:
+ (WebCore::MediaPlayerPrivateInterface::hasClosedCaptions):
+ (WebCore::MediaPlayerPrivateInterface::setClosedCaptionsVisible):
+ Declare new media engine methods.
+
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+ (WebCore::MediaPlayerPrivate::hasClosedCaptions):
+ (WebCore::MediaPlayerPrivate::setClosedCaptionsVisible):
+ New, QTKit implementation of closed caption methods.
+
+ * platform/gtk/LocalizedStringsGtk.cpp:
+ (WebCore::localizedMediaControlElementString):
+ (WebCore::localizedMediaControlElementHelpText):
+ Add help text for ShowClosedCaptionsButton and HideClosedCaptionsButton.
+
+ * platform/mac/WebCoreSystemInterface.h:
+ * platform/mac/WebCoreSystemInterface.mm:
+ Declare and initialize wkQTMovieHasClosedCaptions and wkQTMovieSetShowClosedCaptions.
+
+ * rendering/MediaControlElements.cpp:
+ (WebCore::MediaControlInputElement::MediaControlInputElement):
+ Deal with MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON.
+ (WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
+ (WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
+ (WebCore::MediaControlToggleClosedCaptionsButtonElement::updateDisplayType):
+ New, implement the closed caption toggle button,
+
+ * rendering/MediaControlElements.h:
+ Define MediaShowClosedCaptionsButton and MediaHideClosedCaptionsButton,
+ declare MediaControlToggleClosedCaptionsButtonElement.
+
+ * rendering/RenderMedia.cpp:
+ (WebCore::RenderMedia::styleDidChange):
+ (WebCore::RenderMedia::createToggleClosedCaptionsButton):
+ (WebCore::RenderMedia::createStatusDisplay):
+ (WebCore::RenderMedia::updateControls):
+ (WebCore::RenderMedia::forwardEvent):
+ * rendering/RenderMedia.h:
+ Deal with m_toggleClosedCaptionsButton.
+
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::paint):
+ Deal with MediaToggleClosedCaptionsButtonPart.
+
+ * rendering/RenderTheme.h:
+ * rendering/RenderThemeMac.h:
+ Declare paintMediaToggleClosedCaptionsButton.
+
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::paintMediaToggleClosedCaptionsButton):
+ New.
+ (WebCore::RenderThemeMac::shouldRenderMediaControlPart):
+ Don't render captions toggle button unless we are using the new theme, the
+ movie has captions, and the movie is in a <video> element since we currently
+ rely on QTKit to render the captions.
+
+ * rendering/style/RenderStyleConstants.h:
+ Define MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON.
+
2009-11-19 Kevin Ollivier <kevino@theolliviers.com>
wx build fix. Add missing header.
_wkQTIncludeOnlyModernMediaFileTypes
_wkQTMovieDataRate
_wkQTMovieGetType
+_wkQTMovieHasClosedCaptions
_wkQTMovieMaxTimeLoaded
_wkQTMovieMaxTimeLoadedChangeNotification
_wkQTMovieMaxTimeSeekable
+_wkQTMovieSetShowClosedCaptions
_wkQTMovieViewSetDrawSynchronously
_wkSetCGFontRenderingMode
_wkSetDragImage
DEFINE_STATIC_LOCAL(const String, mediaStatusDisplayName, ("StatusDisplay"));
DEFINE_STATIC_LOCAL(const String, mediaCurrentTimeDisplay, ("CurrentTimeDisplay"));
DEFINE_STATIC_LOCAL(const String, mediaTimeRemainingDisplay, ("TimeRemainingDisplay"));
+ DEFINE_STATIC_LOCAL(const String, mediaShowClosedCaptionsButtonName, ("ShowClosedCaptionsButton"));
+ DEFINE_STATIC_LOCAL(const String, mediaHideClosedCaptionsButtonName, ("HideClosedCaptionsButton"));
switch (controlType()) {
case MediaFullscreenButton:
return mediaCurrentTimeDisplay;
case MediaTimeRemainingDisplay:
return mediaTimeRemainingDisplay;
+ case MediaShowClosedCaptionsButton:
+ return mediaShowClosedCaptionsButtonName;
+ case MediaHideClosedCaptionsButton:
+ return mediaHideClosedCaptionsButtonName;
default:
break;
case MediaReturnToRealtimeButton:
case MediaUnMuteButton:
case MediaPauseButton:
+ case MediaShowClosedCaptionsButton:
+ case MediaHideClosedCaptionsButton:
return ButtonRole;
case MediaStatusDisplay:
/*
* Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
* Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
*
* Redistribution and use in source and binary forms, with or without
case MediaReturnToRealtimeButtonPart:
m_value.ident = CSSValueMediaReturnToRealtimeButton;
break;
+ case MediaToggleClosedCaptionsButtonPart:
+ m_value.ident = CSSValueMediaToggleClosedCaptionsButton;
+ break;
case MediaSliderPart:
m_value.ident = CSSValueMediaSlider;
break;
DEFINE_STATIC_LOCAL(AtomicString, mediaControlsSeekForwardButton, ("-webkit-media-controls-seek-forward-button"));
DEFINE_STATIC_LOCAL(AtomicString, mediaControlsRewindButton, ("-webkit-media-controls-rewind-button"));
DEFINE_STATIC_LOCAL(AtomicString, mediaControlsReturnToRealtimeButton, ("-webkit-media-controls-return-to-realtime-button"));
+ DEFINE_STATIC_LOCAL(AtomicString, mediaControlsToggleClosedCaptionsButton, ("-webkit-media-controls-toggle-closed-captions-button"));
DEFINE_STATIC_LOCAL(AtomicString, mediaControlsStatusDisplay, ("-webkit-media-controls-status-display"));
DEFINE_STATIC_LOCAL(AtomicString, mediaControlsFullscreenButton, ("-webkit-media-controls-fullscreen-button"));
DEFINE_STATIC_LOCAL(AtomicString, mediaControlsTimelineContainer, ("-webkit-media-controls-timeline-container"));
} else if (m_value == mediaControlsReturnToRealtimeButton) {
m_pseudoType = PseudoMediaControlsReturnToRealtimeButton;
element = true;
+ } else if (m_value == mediaControlsToggleClosedCaptionsButton) {
+ m_pseudoType = PseudoMediaControlsToggleClosedCaptions;
+ element = true;
} else if (m_value == mediaControlsStatusDisplay) {
m_pseudoType = PseudoMediaControlsStatusDisplay;
element = true;
PseudoMediaControlsVolumeSliderContainer,
PseudoMediaControlsCurrentTimeDisplay,
PseudoMediaControlsTimeRemainingDisplay,
+ PseudoMediaControlsToggleClosedCaptions,
PseudoMediaControlsTimeline,
PseudoMediaControlsVolumeSlider,
PseudoMediaControlsSeekBackButton,
case CSSSelector::PseudoMediaControlsReturnToRealtimeButton:
dynamicPseudo = MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON;
return true;
+ case CSSSelector::PseudoMediaControlsToggleClosedCaptions:
+ dynamicPseudo = MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON;
+ return true;
case CSSSelector::PseudoMediaControlsStatusDisplay:
dynamicPseudo = MEDIA_CONTROLS_STATUS_DISPLAY;
return true;
media-seek-forward-button
media-rewind-button
media-return-to-realtime-button
+media-toggle-closed-captions-button
media-slider
media-sliderthumb
media-volume-slider-container
audio::-webkit-media-controls-return-to-realtime-button, video::-webkit-media-controls-return-to-realtime-button {
display: none;
}
+
+audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button {
+ display: none;
+}
height: 16px;
margin-left: 7px;
margin-right: 7px;
- -webkit-box-ordinal-group: 3; /* At the very end */
+ -webkit-box-ordinal-group: 4; /* At the very end */
}
audio::-webkit-media-controls-rewind-button, video::-webkit-media-controls-rewind-button {
text-indent: 0;
text-decoration: none;
}
+
+audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button {
+ -webkit-appearance: media-toggle-closed-captions-button;
+ display: -webkit-box;
+ width: 16px;
+ height: 16px;
+ margin-left: 7px;
+ margin-right: 7px;
+ -webkit-box-ordinal-group: 3; /* between mute and fullscreen */
+}
, m_pausedInternal(false)
, m_sendProgressEvents(true)
, m_isFullscreen(false)
+ , m_closedCaptionsVisible(false)
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
, m_needWidgetUpdate(false)
#endif
m_autoplaying = true;
m_playedTimeRanges = TimeRanges::create();
m_lastSeekTime = 0;
+ m_closedCaptionsVisible = false;
// 6
setPlaybackRate(defaultPlaybackRate());
return m_isFullscreen;
}
+bool HTMLMediaElement::hasClosedCaptions() const
+{
+ return m_player && m_player->hasClosedCaptions();
+}
+
+bool HTMLMediaElement::closedCaptionsVisible() const
+{
+ return m_closedCaptionsVisible;
+}
+
+void HTMLMediaElement::setClosedCaptionsVisible(bool closedCaptionVisible)
+{
+ if (!m_player ||!hasClosedCaptions())
+ return;
+
+ m_closedCaptionsVisible = closedCaptionVisible;
+ m_player->setClosedCaptionsVisible(closedCaptionVisible);
+ if (renderer())
+ renderer()->updateFromElement();
+}
+
+void HTMLMediaElement::setWebkitClosedCaptionsVisible(bool visible)
+{
+ setClosedCaptionsVisible(visible);
+}
+
+bool HTMLMediaElement::webkitClosedCaptionsVisible() const
+{
+ return closedCaptionsVisible();
+}
+
+
+bool HTMLMediaElement::webkitHasClosedCaptions() const
+{
+ return hasClosedCaptions();
+}
+
}
#endif
void webkitExitFullScreen();
bool webkitSupportsFullscreen();
bool webkitDisplayingFullscreen();
-
+
+// captions
+ bool webkitHasClosedCaptions() const;
+ bool webkitClosedCaptionsVisible() const;
+ void setWebkitClosedCaptionsVisible(bool);
+
// controls
bool controls() const;
void setControls(bool);
void enterFullscreen();
void exitFullscreen();
+ bool hasClosedCaptions() const;
+ bool closedCaptionsVisible() const;
+ void setClosedCaptionsVisible(bool);
+
protected:
float getTimeOffsetAttribute(const QualifiedName&, float valueOnError) const;
void setTimeOffsetAttribute(const QualifiedName&, float value);
bool m_sendProgressEvents : 1;
bool m_isFullscreen : 1;
+ bool m_closedCaptionsVisible : 1;
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
bool m_needWidgetUpdate : 1;
void webkitEnterFullScreen()
raises (DOMException);
void webkitExitFullScreen();
+
+ readonly attribute boolean webkitHasClosedCaptions;
+ attribute boolean webkitClosedCaptionsVisible;
};
}
NoControlPart, CheckboxPart, RadioPart, PushButtonPart, SquareButtonPart, ButtonPart,
ButtonBevelPart, DefaultButtonPart, ListButtonPart, ListboxPart, ListItemPart,
MediaFullscreenButtonPart, MediaMuteButtonPart, MediaPlayButtonPart, MediaSeekBackButtonPart,
- MediaSeekForwardButtonPart, MediaRewindButtonPart, MediaReturnToRealtimeButtonPart,
+ MediaSeekForwardButtonPart, MediaRewindButtonPart, MediaReturnToRealtimeButtonPart, MediaToggleClosedCaptionsButtonPart,
MediaSliderPart, MediaSliderThumbPart, MediaVolumeSliderContainerPart, MediaVolumeSliderPart, MediaVolumeSliderThumbPart,
MediaControlsBackgroundPart, MediaCurrentTimePart, MediaTimeRemainingPart,
MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart,
return String();
}
+String localizedMediaControlElementString(const String& controlName)
+{
+ notImplemented();
+ return String();
+}
+
+String localizedMediaControlElementHelpText(const String& controlName)
+{
+ notImplemented();
+ return String();
+}
+
+String localizedMediaTimeDescription(const String& controlName)
+{
+ notImplemented();
+ return String();
+}
+
String searchableIndexIntroduction()
{
notImplemented();
virtual void setVolume(float) { }
+ virtual bool hasClosedCaptions() const { return false; }
+ virtual void setClosedCaptionsVisible(bool) { };
+
virtual MediaPlayer::NetworkState networkState() const { return MediaPlayer::Empty; }
virtual MediaPlayer::ReadyState readyState() const { return MediaPlayer::HaveNothing; }
m_private->setVolume(volume);
}
+bool MediaPlayer::hasClosedCaptions() const
+{
+ return m_private->hasClosedCaptions();
+}
+
+void MediaPlayer::setClosedCaptionsVisible(bool closedCaptionsVisible)
+{
+ m_private->setClosedCaptionsVisible(closedCaptionsVisible);
+}
+
float MediaPlayer::rate() const
{
return m_rate;
float volume() const;
void setVolume(float);
-
+
+ bool hasClosedCaptions() const;
+ void setClosedCaptionsVisible(bool closedCaptionsVisible);
+
int dataRate() const;
bool autobuffer() const;
virtual void setVolume(float) = 0;
+ virtual bool hasClosedCaptions() const { return false; }
+ virtual void setClosedCaptionsVisible(bool) { }
+
virtual MediaPlayer::NetworkState networkState() const = 0;
virtual MediaPlayer::ReadyState readyState() const = 0;
void setVolume(float);
void setPreservesPitch(bool);
+ bool hasClosedCaptions() const;
+ void setClosedCaptionsVisible(bool);
+
void setEndTime(float time);
int dataRate() const;
[m_qtMovie.get() setVolume:volume];
}
+bool MediaPlayerPrivate::hasClosedCaptions() const
+{
+ if (!metaDataAvailable())
+ return false;
+ return wkQTMovieHasClosedCaptions(m_qtMovie.get());
+}
+
+void MediaPlayerPrivate::setClosedCaptionsVisible(bool closedCaptionsVisible)
+{
+ if (metaDataAvailable()) {
+ wkQTMovieSetShowClosedCaptions(m_qtMovie.get(), closedCaptionsVisible);
+
+#if USE(ACCELERATED_COMPOSITING) && (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD))
+ if (closedCaptionsVisible && m_qtVideoLayer) {
+ // Captions will be rendered upsided down unless we flag the movie as flipped (again). See <rdar://7408440>.
+ [m_qtVideoLayer.get() setGeometryFlipped:YES];
+ }
+#endif
+ }
+}
+
void MediaPlayerPrivate::setRate(float rate)
{
if (m_qtMovie)
return String::fromUTF8(_("fast forward"));
if (name == "SeekBackButton")
return String::fromUTF8(_("fast reverse"));
+ if (name == "ShowClosedCaptionsButton")
+ return String::fromUTF8(_("show closed captions"));
+ if (name == "HideClosedCaptionsButton")
+ return String::fromUTF8(_("hide closed captions"));
ASSERT_NOT_REACHED();
return String();
return String::fromUTF8(_("seek quickly forward"));
if (name == "FullscreenButton")
return String::fromUTF8(_("Play movie in fullscreen mode"));
+ if (name == "ShowClosedCaptionsButton")
+ return String::fromUTF8(_("start displaying closed captions"));
+ if (name == "HideClosedCaptionsButton")
+ return String::fromUTF8(_("stop displaying closed captions"));
ASSERT_NOT_REACHED();
return String();
extern NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
extern float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
extern int (*wkQTMovieGetType)(QTMovie* movie);
+extern BOOL (*wkQTMovieHasClosedCaptions)(QTMovie* movie);
+extern void (*wkQTMovieSetShowClosedCaptions)(QTMovie* movie, BOOL showClosedCaptions);
extern void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
int (*wkQTMovieGetType)(QTMovie* movie);
+BOOL (*wkQTMovieHasClosedCaptions)(QTMovie* movie);
+void (*wkQTMovieSetShowClosedCaptions)(QTMovie* movie, BOOL showClosedCaptions);
void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
void (*wkSetDragImage)(NSImage*, NSPoint offset);
case MEDIA_CONTROLS_VOLUME_SLIDER:
m_displayType = MediaVolumeSlider;
break;
+ case MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON:
+ m_displayType = MediaShowClosedCaptionsButton;
+ break;
default:
ASSERT_NOT_REACHED();
break;
}
+// ----------------------------
+
+MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement(Document* doc, HTMLMediaElement* element)
+ : MediaControlInputElement(doc, MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON, "button", element)
+{
+}
+
+void MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler(Event* event)
+{
+ if (event->type() == eventNames().clickEvent) {
+ m_mediaElement->setClosedCaptionsVisible(!m_mediaElement->closedCaptionsVisible());
+ setChecked(m_mediaElement->closedCaptionsVisible());
+ event->setDefaultHandled();
+ }
+ HTMLInputElement::defaultEventHandler(event);
+}
+
+void MediaControlToggleClosedCaptionsButtonElement::updateDisplayType()
+{
+ setDisplayType(m_mediaElement->closedCaptionsVisible() ? MediaHideClosedCaptionsButton : MediaShowClosedCaptionsButton);
+}
+
+
// ----------------------------
MediaControlTimelineElement::MediaControlTimelineElement(Document* document, HTMLMediaElement* element)
MediaSliderThumb,
MediaRewindButton,
MediaReturnToRealtimeButton,
+ MediaShowClosedCaptionsButton,
+ MediaHideClosedCaptionsButton,
MediaUnMuteButton,
MediaPauseButton,
MediaTimelineContainer,
// ----------------------------
+class MediaControlToggleClosedCaptionsButtonElement : public MediaControlInputElement {
+public:
+ MediaControlToggleClosedCaptionsButtonElement(Document*, HTMLMediaElement*);
+ virtual void defaultEventHandler(Event*);
+ virtual void updateDisplayType();
+};
+
+// ----------------------------
+
class MediaControlTimelineElement : public MediaControlInputElement {
public:
MediaControlTimelineElement(Document*, HTMLMediaElement*);
m_rewindButton->updateStyle();
if (m_returnToRealtimeButton)
m_returnToRealtimeButton->updateStyle();
+ if (m_toggleClosedCaptionsButton)
+ m_toggleClosedCaptionsButton->updateStyle();
if (m_statusDisplay)
m_statusDisplay->updateStyle();
if (m_timelineContainer)
m_returnToRealtimeButton->attachToParent(m_panel.get());
}
+void RenderMedia::createToggleClosedCaptionsButton()
+{
+ ASSERT(!m_toggleClosedCaptionsButton);
+ m_toggleClosedCaptionsButton = new MediaControlToggleClosedCaptionsButtonElement(document(), mediaElement());
+ m_toggleClosedCaptionsButton->attachToParent(m_panel.get());
+}
+
void RenderMedia::createStatusDisplay()
{
ASSERT(!m_statusDisplay);
m_volumeSliderContainer = 0;
m_volumeSlider = 0;
m_controlsShadowRoot = 0;
+ m_toggleClosedCaptionsButton = 0;
}
m_opacityAnimationTo = 1.0f;
m_opacityAnimationTimer.stop();
createRewindButton();
createPlayButton();
createReturnToRealtimeButton();
+ createToggleClosedCaptionsButton();
createStatusDisplay();
createTimelineContainer();
if (m_timelineContainer) {
m_rewindButton->update();
if (m_returnToRealtimeButton)
m_returnToRealtimeButton->update();
+ if (m_toggleClosedCaptionsButton)
+ m_toggleClosedCaptionsButton->update();
if (m_statusDisplay)
m_statusDisplay->update();
if (m_fullscreenButton)
if (m_returnToRealtimeButton && m_returnToRealtimeButton->hitTest(point))
m_returnToRealtimeButton->defaultEventHandler(event);
+ if (m_toggleClosedCaptionsButton && m_toggleClosedCaptionsButton->hitTest(point))
+ m_toggleClosedCaptionsButton->defaultEventHandler(event);
+
if (m_timeline && m_timeline->hitTest(point))
m_timeline->defaultEventHandler(event);
class MediaControlSeekButtonElement;
class MediaControlRewindButtonElement;
class MediaControlReturnToRealtimeButtonElement;
+class MediaControlToggleClosedCaptionsButtonElement;
class MediaControlTimelineElement;
class MediaControlVolumeSliderElement;
class MediaControlFullscreenButtonElement;
void createSeekForwardButton();
void createRewindButton();
void createReturnToRealtimeButton();
+ void createToggleClosedCaptionsButton();
void createStatusDisplay();
void createTimelineContainer();
void createTimeline();
RefPtr<MediaControlSeekButtonElement> m_seekForwardButton;
RefPtr<MediaControlRewindButtonElement> m_rewindButton;
RefPtr<MediaControlReturnToRealtimeButtonElement> m_returnToRealtimeButton;
+ RefPtr<MediaControlToggleClosedCaptionsButtonElement> m_toggleClosedCaptionsButton;
RefPtr<MediaControlTimelineElement> m_timeline;
RefPtr<MediaControlVolumeSliderElement> m_volumeSlider;
RefPtr<MediaControlFullscreenButtonElement> m_fullscreenButton;
/**
* This file is part of the theme implementation for form controls in WebCore.
*
- * Copyright (C) 2005, 2006, 2007, 2008 Apple Computer, Inc.
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
return paintMediaRewindButton(o, paintInfo, r);
case MediaReturnToRealtimeButtonPart:
return paintMediaReturnToRealtimeButton(o, paintInfo, r);
+ case MediaToggleClosedCaptionsButtonPart:
+ return paintMediaToggleClosedCaptionsButton(o, paintInfo, r);
case MediaSliderPart:
return paintMediaSliderTrack(o, paintInfo, r);
case MediaSliderThumbPart:
return mediaElement->movieLoadType() == MediaPlayer::LiveStream;
case MediaFullscreenButtonPart:
return mediaElement->supportsFullscreen();
+ case MediaToggleClosedCaptionsButtonPart:
+ return mediaElement->hasClosedCaptions();
default:
return true;
}
virtual bool paintMediaVolumeSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
virtual bool paintMediaRewindButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
virtual bool paintMediaReturnToRealtimeButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
+ virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
virtual bool paintMediaControlsBackground(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
virtual bool paintMediaCurrentTime(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
virtual bool paintMediaTimeRemaining(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return true; }
virtual bool paintMediaSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaRewindButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaReturnToRealtimeButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+ virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaControlsBackground(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaCurrentTime(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaTimeRemaining(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
return false;
}
+bool RenderThemeMac::paintMediaToggleClosedCaptionsButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+{
+ HTMLInputElement* node = static_cast<HTMLInputElement*>(o->node());
+ if (!node)
+ return false;
+
+ MediaControlToggleClosedCaptionsButtonElement* btn = static_cast<MediaControlToggleClosedCaptionsButtonElement*>(node);
+ if (!btn)
+ return false;
+
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
+ wkDrawMediaUIPart(btn->displayType(), mediaControllerTheme(), paintInfo.context->platformContext(), r, getMediaUIPartStateFlags(node));
+ return false;
+}
+
bool RenderThemeMac::paintMediaControlsBackground(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
{
Node* node = o->node();
return String();
}
-bool RenderThemeMac::shouldRenderMediaControlPart(ControlPart part, Element* e)
+bool RenderThemeMac::shouldRenderMediaControlPart(ControlPart part, Element* element)
{
if (part == MediaFullscreenButtonPart)
return mediaControllerTheme() == MediaControllerThemeQuickTime;
- return RenderTheme::shouldRenderMediaControlPart(part, e);
+ if (part == MediaToggleClosedCaptionsButtonPart) {
+
+ // We rely on QTKit to render captions so don't enable the button unless it will be able to do so.
+ HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(element);
+ if (mediaControllerTheme() != MediaControllerThemeQuickTime || !element->hasTagName(videoTag) || !mediaElement->hasVideo())
+ return false;
+ }
+
+ return RenderTheme::shouldRenderMediaControlPart(part, element);
}
#endif // ENABLE(VIDEO)
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
* Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
* Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
*
NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR, FILE_UPLOAD_BUTTON, INPUT_PLACEHOLDER,
SLIDER_THUMB, SEARCH_CANCEL_BUTTON, SEARCH_DECORATION, SEARCH_RESULTS_DECORATION, SEARCH_RESULTS_BUTTON, MEDIA_CONTROLS_PANEL,
MEDIA_CONTROLS_PLAY_BUTTON, MEDIA_CONTROLS_MUTE_BUTTON, MEDIA_CONTROLS_TIMELINE, MEDIA_CONTROLS_TIMELINE_CONTAINER,
- MEDIA_CONTROLS_VOLUME_SLIDER, MEDIA_CONTROLS_VOLUME_SLIDER_CONTAINER, MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, MEDIA_CONTROLS_TIME_REMAINING_DISPLAY, MEDIA_CONTROLS_SEEK_BACK_BUTTON,
- MEDIA_CONTROLS_SEEK_FORWARD_BUTTON, MEDIA_CONTROLS_FULLSCREEN_BUTTON, MEDIA_CONTROLS_REWIND_BUTTON, MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON,
+ MEDIA_CONTROLS_VOLUME_SLIDER, MEDIA_CONTROLS_VOLUME_SLIDER_CONTAINER, MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, MEDIA_CONTROLS_TIME_REMAINING_DISPLAY,
+ MEDIA_CONTROLS_SEEK_BACK_BUTTON, MEDIA_CONTROLS_SEEK_FORWARD_BUTTON, MEDIA_CONTROLS_FULLSCREEN_BUTTON, MEDIA_CONTROLS_REWIND_BUTTON,
+ MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON, MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON,
MEDIA_CONTROLS_STATUS_DISPLAY, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER,
INPUT_LIST_BUTTON,
+2009-11-19 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/7035231>
+ Support closed caption in <video> element
+
+ * English.lproj/Localizable.strings:
+ Add strings for toggle captions button.
+
2009-11-18 Michelangelo De Simone <micdesim@gmail.com>
Reviewed by Darin Adler.
+2009-11-19 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/7035231>
+ Support closed caption in <video> element
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface):
+ Add QTMovieHasClosedCaptions and QTMovieSetShowClosedCaptions.
+
+ * WebCoreSupport/WebViewFactory.mm:
+ (-[WebViewFactory localizedMediaControlElementString:]):
+ (-[WebViewFactory localizedMediaControlElementHelpText:]):
+ Add accessibility help strings for media controller closed caption button.
+
2009-11-18 Michelangelo De Simone <micdesim@gmail.com>
Reviewed by Darin Adler.
INIT(QTMovieMaxTimeLoadedChangeNotification);
INIT(QTMovieMaxTimeSeekable);
INIT(QTMovieGetType);
+ INIT(QTMovieHasClosedCaptions);
+ INIT(QTMovieSetShowClosedCaptions);
INIT(QTMovieViewSetDrawSynchronously);
#ifndef BUILDING_ON_TIGER
return UI_STRING("fast forward", "accessibility role description for fast forward button");
if ([name isEqualToString:@"SeekBackButton"])
return UI_STRING("fast reverse", "accessibility role description for fast reverse button");
+ if ([name isEqualToString:@"ShowClosedCaptionsButton"])
+ return UI_STRING("show closed captions", "accessibility role description for show closed captions button");
+ if ([name isEqualToString:@"HideClosedCaptionsButton"])
+ return UI_STRING("hide closed captions", "accessibility role description for hide closed captions button");
+
ASSERT_NOT_REACHED();
return @"";
}
return UI_STRING("seek quickly forward", "accessibility help text for fast forward button");
if ([name isEqualToString:@"FullscreenButton"])
return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button");
+ if ([name isEqualToString:@"ShowClosedCaptionsButton"])
+ return UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button");
+ if ([name isEqualToString:@"HideClosedCaptionsButton"])
+ return UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button");
ASSERT_NOT_REACHED();
return @"";
}
+2009-11-19 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/7035231>
+ Support closed caption in <video> element
+
+ * WebCoreLocalizedStrings.cpp:
+ (WebCore::localizedMediaControlElementString):
+ (WebCore::localizedMediaControlElementHelpText):
+ Add accessibility help strings for media controller closed caption button.
+
2009-11-18 Michelangelo De Simone <micdesim@gmail.com>
Reviewed by Darin Adler.
return String(LPCTSTR_UI_STRING("fast forward", "accessibility role description for fast forward button"));
if (name == "SeekBackButton")
return String(LPCTSTR_UI_STRING("fast reverse", "accessibility role description for fast reverse button"));
+ if (name == "ShowClosedCaptionsButton")
+ return String(LPCTSTR_UI_STRING("show closed captions", "accessibility role description for show closed captions button"));
+ if (name == "HideClosedCaptionsButton")
+ return String(LPCTSTR_UI_STRING("hide closed captions", "accessibility role description for hide closed captions button"));
ASSERT_NOT_REACHED();
return String();
return String(LPCTSTR_UI_STRING("seek quickly forward", "accessibility help text for fast forward button"));
if (name == "FullscreenButton")
return String(LPCTSTR_UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button"));
+ if (name == "ShowClosedCaptionsButton")
+ return String(LPCTSTR_UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button"));
+ if (name == "HideClosedCaptionsButton")
+ return String(LPCTSTR_UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button"));
ASSERT_NOT_REACHED();
return String();
+2009-11-19 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/7035231>
+ Support closed caption in <video> element
+
+ * WebKitSystemInterface.h:
+ Add prototypes for WKQTMovieHasClosedCaptions and WKQTMovieSetShowClosedCaptions,
+ define WKMediaUIPartToggleClosedCaptionsButton.
+
2009-11-13 Anders Carlsson <andersca@apple.com>
Reviewed by Dan Bernstein.
int WKQTMovieGetType(QTMovie* movie);
+BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
+void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
+
unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
int WKQTMovieDataRate(QTMovie* movie);
float WKQTMovieMaxTimeLoaded(QTMovie* movie);
WKMediaUIPartSliderThumb,
WKMediaUIPartRewindButton,
WKMediaUIPartSeekToRealtimeButton,
+ WKMediaUIPartToggleClosedCaptionsButton,
WKMediaUIPartUnMuteButton,
WKMediaUIPartPauseButton,
WKMediaUIPartBackground,