OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "core/html/track/TextTrackContainer.h" | 58 #include "core/html/track/TextTrackContainer.h" |
59 #include "core/html/track/TextTrackList.h" | 59 #include "core/html/track/TextTrackList.h" |
60 #include "core/html/track/VideoTrack.h" | 60 #include "core/html/track/VideoTrack.h" |
61 #include "core/html/track/VideoTrackList.h" | 61 #include "core/html/track/VideoTrackList.h" |
62 #include "core/inspector/ConsoleMessage.h" | 62 #include "core/inspector/ConsoleMessage.h" |
63 #include "core/layout/LayoutVideo.h" | 63 #include "core/layout/LayoutVideo.h" |
64 #include "core/layout/LayoutView.h" | 64 #include "core/layout/LayoutView.h" |
65 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" | 65 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" |
66 #include "core/loader/FrameLoader.h" | 66 #include "core/loader/FrameLoader.h" |
67 #include "core/loader/FrameLoaderClient.h" | 67 #include "core/loader/FrameLoaderClient.h" |
| 68 #include "core/page/ChromeClient.h" |
68 #include "platform/ContentType.h" | 69 #include "platform/ContentType.h" |
69 #include "platform/Logging.h" | 70 #include "platform/Logging.h" |
70 #include "platform/MIMETypeFromURL.h" | 71 #include "platform/MIMETypeFromURL.h" |
71 #include "platform/MIMETypeRegistry.h" | 72 #include "platform/MIMETypeRegistry.h" |
72 #include "platform/RuntimeEnabledFeatures.h" | 73 #include "platform/RuntimeEnabledFeatures.h" |
73 #include "platform/UserGestureIndicator.h" | 74 #include "platform/UserGestureIndicator.h" |
74 #include "platform/graphics/GraphicsLayer.h" | 75 #include "platform/graphics/GraphicsLayer.h" |
75 #include "platform/weborigin/SecurityOrigin.h" | 76 #include "platform/weborigin/SecurityOrigin.h" |
76 #include "public/platform/Platform.h" | 77 #include "public/platform/Platform.h" |
77 #include "public/platform/WebContentDecryptionModule.h" | 78 #include "public/platform/WebContentDecryptionModule.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 , m_completelyLoaded(false) | 355 , m_completelyLoaded(false) |
355 , m_havePreparedToPlay(false) | 356 , m_havePreparedToPlay(false) |
356 , m_tracksAreReady(true) | 357 , m_tracksAreReady(true) |
357 , m_haveVisibleTextTrack(false) | 358 , m_haveVisibleTextTrack(false) |
358 , m_processingPreferenceChange(false) | 359 , m_processingPreferenceChange(false) |
359 , m_remoteRoutesAvailable(false) | 360 , m_remoteRoutesAvailable(false) |
360 , m_playingRemotely(false) | 361 , m_playingRemotely(false) |
361 , m_isFinalizing(false) | 362 , m_isFinalizing(false) |
362 , m_initialPlayWithoutUserGestures(false) | 363 , m_initialPlayWithoutUserGestures(false) |
363 , m_autoplayMediaCounted(false) | 364 , m_autoplayMediaCounted(false) |
| 365 , m_inOverlayFullscreenVideo(false) |
364 , m_audioTracks(AudioTrackList::create(*this)) | 366 , m_audioTracks(AudioTrackList::create(*this)) |
365 , m_videoTracks(VideoTrackList::create(*this)) | 367 , m_videoTracks(VideoTrackList::create(*this)) |
366 , m_textTracks(nullptr) | 368 , m_textTracks(nullptr) |
367 #if ENABLE(WEB_AUDIO) | 369 #if ENABLE(WEB_AUDIO) |
368 , m_audioSourceNode(nullptr) | 370 , m_audioSourceNode(nullptr) |
369 #endif | 371 #endif |
370 { | 372 { |
371 #if ENABLE(OILPAN) | 373 #if ENABLE(OILPAN) |
372 ThreadState::current()->registerPreFinalizer(this); | 374 ThreadState::current()->registerPreFinalizer(this); |
373 #endif | 375 #endif |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 m_audioSourceProvider.wrap(m_webMediaPlayer->audioSourceProvider()); | 1044 m_audioSourceProvider.wrap(m_webMediaPlayer->audioSourceProvider()); |
1043 #endif | 1045 #endif |
1044 m_webMediaPlayer->setVolume(effectiveMediaVolume()); | 1046 m_webMediaPlayer->setVolume(effectiveMediaVolume()); |
1045 | 1047 |
1046 m_webMediaPlayer->setPoster(posterImageURL()); | 1048 m_webMediaPlayer->setPoster(posterImageURL()); |
1047 | 1049 |
1048 m_webMediaPlayer->setPreload(effectivePreloadType()); | 1050 m_webMediaPlayer->setPreload(effectivePreloadType()); |
1049 | 1051 |
1050 m_webMediaPlayer->load(loadType(), kurl, corsMode()); | 1052 m_webMediaPlayer->load(loadType(), kurl, corsMode()); |
1051 | 1053 |
1052 if (isFullscreen()) | 1054 if (isFullscreen()) { |
1053 m_webMediaPlayer->enterFullscreen(); | 1055 // This handles any transition to or from fullscreen overlay mode. |
| 1056 document().frame()->chromeClient().enterFullScreenForElement(this); |
| 1057 } |
1054 } | 1058 } |
1055 | 1059 |
1056 void HTMLMediaElement::setPlayerPreload() | 1060 void HTMLMediaElement::setPlayerPreload() |
1057 { | 1061 { |
1058 if (m_webMediaPlayer) | 1062 if (m_webMediaPlayer) |
1059 m_webMediaPlayer->setPreload(effectivePreloadType()); | 1063 m_webMediaPlayer->setPreload(effectivePreloadType()); |
1060 | 1064 |
1061 if (loadIsDeferred() && preloadType() != WebMediaPlayer::PreloadNone) | 1065 if (loadIsDeferred() && preloadType() != WebMediaPlayer::PreloadNone) |
1062 startDeferredLoad(); | 1066 startDeferredLoad(); |
1063 } | 1067 } |
(...skipping 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3192 { | 3196 { |
3193 WTF_LOG(Media, "HTMLMediaElement::exitFullscreen(%p)", this); | 3197 WTF_LOG(Media, "HTMLMediaElement::exitFullscreen(%p)", this); |
3194 | 3198 |
3195 Fullscreen::from(document()).exitFullscreen(); | 3199 Fullscreen::from(document()).exitFullscreen(); |
3196 } | 3200 } |
3197 | 3201 |
3198 void HTMLMediaElement::didBecomeFullscreenElement() | 3202 void HTMLMediaElement::didBecomeFullscreenElement() |
3199 { | 3203 { |
3200 if (mediaControls()) | 3204 if (mediaControls()) |
3201 mediaControls()->enteredFullscreen(); | 3205 mediaControls()->enteredFullscreen(); |
3202 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isHTMLVideoEl
ement()) | 3206 // Cache this in case the player is destroyed before leaving fullscreen. |
| 3207 m_inOverlayFullscreenVideo = usesOverlayFullscreenVideo(); |
| 3208 if (m_inOverlayFullscreenVideo) |
3203 document().layoutView()->compositor()->setNeedsCompositingUpdate(Composi
tingUpdateRebuildTree); | 3209 document().layoutView()->compositor()->setNeedsCompositingUpdate(Composi
tingUpdateRebuildTree); |
3204 } | 3210 } |
3205 | 3211 |
3206 void HTMLMediaElement::willStopBeingFullscreenElement() | 3212 void HTMLMediaElement::willStopBeingFullscreenElement() |
3207 { | 3213 { |
3208 if (mediaControls()) | 3214 if (mediaControls()) |
3209 mediaControls()->exitedFullscreen(); | 3215 mediaControls()->exitedFullscreen(); |
3210 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isHTMLVideoEl
ement()) | 3216 if (m_inOverlayFullscreenVideo) |
3211 document().layoutView()->compositor()->setNeedsCompositingUpdate(Composi
tingUpdateRebuildTree); | 3217 document().layoutView()->compositor()->setNeedsCompositingUpdate(Composi
tingUpdateRebuildTree); |
| 3218 m_inOverlayFullscreenVideo = false; |
3212 } | 3219 } |
3213 | 3220 |
3214 WebLayer* HTMLMediaElement::platformLayer() const | 3221 WebLayer* HTMLMediaElement::platformLayer() const |
3215 { | 3222 { |
3216 return m_webLayer; | 3223 return m_webLayer; |
3217 } | 3224 } |
3218 | 3225 |
3219 bool HTMLMediaElement::hasClosedCaptions() const | 3226 bool HTMLMediaElement::hasClosedCaptions() const |
3220 { | 3227 { |
3221 if (m_textTracks) { | 3228 if (m_textTracks) { |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3783 visitor->trace(m_client); | 3790 visitor->trace(m_client); |
3784 } | 3791 } |
3785 | 3792 |
3786 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) | 3793 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) |
3787 { | 3794 { |
3788 visitor->trace(m_client); | 3795 visitor->trace(m_client); |
3789 } | 3796 } |
3790 #endif | 3797 #endif |
3791 | 3798 |
3792 } | 3799 } |
OLD | NEW |