-
eric.carlson@apple.com authored
https://bugs.webkit.org/show_bug.cgi?id=119643 Source/WebCore: Reviewed by Jere Noble. No new tests, existing tests updated. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_captionDisplayMode from settings if possible. (WebCore::HTMLMediaElement::configureTextTrackGroup): Don't enable a default track when preferences say captions should be disabled. Don't disable an already visible track if we don't find a match unless preferences say captions should be disabled. m_forcedOrAutomaticSubtitleTrackLanguage -> m_subtitleTrackLanguage. (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): If the language of the primary audio track changes, only kick off a text track recalc if caption preference are set to "automatic". * html/HTMLMediaElement.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): Initialize m_characteristicsChanged and m_delayCharacteristicsChangedNotification. (WebCore::MediaPlayerPrivateAVFoundation::setHasVideo): Call characteristicsChanged. (WebCore::MediaPlayerPrivateAVFoundation::setHasAudio): Ditto. (WebCore::MediaPlayerPrivateAVFoundation::setHasClosedCaptions): Ditto. (WebCore::MediaPlayerPrivateAVFoundation::characteristicsChanged): New, allows us to coalesce calls to the media player when we know several characteristics may change. (WebCore::MediaPlayerPrivateAVFoundation::setDelayCharacteristicsChangedNotification): Enable or disable notification delay. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Always call languageOfPrimaryAudioTrack(), a track may have changed so we may have a new language. (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Call [AVAssetTrack languageCode] if [AVAssetTrack extendedLanguageTag] returns NULL in case the media file has an old QuickTime language code. LayoutTests: Reviewed by Jer Noble. Explicitly set caption mode to "Automatic" so the track 'default' attribute works. * media/track/text-track-cue-is-reachable.html: * media/track/text-track-is-reachable.html: * media/track/track-active-cues.html: * media/track/track-cue-overlap-snap-to-lines-not-set.html: * media/track/track-cue-rendering-horizontal.html: * media/track/track-cue-rendering-vertical.html: * media/track/track-kind.html: * media/track/track-large-timestamp.html: * media/track/track-mode.html: * media/track/track-text-track-cue-list.html: * media/track/track-webvtt-tc000-empty.html: * media/track/track-webvtt-tc002-bom.html: * media/track/track-webvtt-tc010-no-timings.html: * media/track/track-webvtt-tc027-empty-cue.html: * media/track/track-webvtt-tc028-unsupported-markup.html: * media/track/track-word-breaking.html: * media/video-test.js: (setCaptionDisplayMode): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
e2ae3748