| 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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 , m_audioTracks(AudioTrackList::create(*this)) | 444 , m_audioTracks(AudioTrackList::create(*this)) |
| 445 , m_videoTracks(VideoTrackList::create(*this)) | 445 , m_videoTracks(VideoTrackList::create(*this)) |
| 446 , m_textTracks(nullptr) | 446 , m_textTracks(nullptr) |
| 447 , m_playPromiseResolveTask(CancellableTaskFactory::create(this, &HTMLMediaEl
ement::resolveScheduledPlayPromises)) | 447 , m_playPromiseResolveTask(CancellableTaskFactory::create(this, &HTMLMediaEl
ement::resolveScheduledPlayPromises)) |
| 448 , m_playPromiseRejectTask(CancellableTaskFactory::create(this, &HTMLMediaEle
ment::rejectScheduledPlayPromises)) | 448 , m_playPromiseRejectTask(CancellableTaskFactory::create(this, &HTMLMediaEle
ment::rejectScheduledPlayPromises)) |
| 449 , m_audioSourceNode(nullptr) | 449 , m_audioSourceNode(nullptr) |
| 450 , m_autoplayHelperClient(AutoplayHelperClientImpl::create(this)) | 450 , m_autoplayHelperClient(AutoplayHelperClientImpl::create(this)) |
| 451 , m_autoplayHelper(AutoplayExperimentHelper::create(m_autoplayHelperClient.g
et())) | 451 , m_autoplayHelper(AutoplayExperimentHelper::create(m_autoplayHelperClient.g
et())) |
| 452 , m_remotePlaybackClient(nullptr) | 452 , m_remotePlaybackClient(nullptr) |
| 453 , m_autoplayVisibilityObserver(nullptr) | 453 , m_autoplayVisibilityObserver(nullptr) |
| 454 , m_isParentInFullscreen(false) |
| 454 { | 455 { |
| 455 ThreadState::current()->registerPreFinalizer(this); | 456 ThreadState::current()->registerPreFinalizer(this); |
| 456 | 457 |
| 457 BLINK_MEDIA_LOG << "HTMLMediaElement(" << (void*)this << ")"; | 458 BLINK_MEDIA_LOG << "HTMLMediaElement(" << (void*)this << ")"; |
| 458 | 459 |
| 459 // If any experiment is enabled, then we want to enable a user gesture by | 460 // If any experiment is enabled, then we want to enable a user gesture by |
| 460 // default, otherwise the experiment does nothing. | 461 // default, otherwise the experiment does nothing. |
| 461 if ((document.settings() && document.settings()->mediaPlaybackRequiresUserGe
sture()) | 462 if ((document.settings() && document.settings()->mediaPlaybackRequiresUserGe
sture()) |
| 462 || m_autoplayHelper->isExperimentEnabled()) { | 463 || m_autoplayHelper->isExperimentEnabled()) { |
| 463 m_lockedPendingUserGesture = true; | 464 m_lockedPendingUserGesture = true; |
| (...skipping 2847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3311 { | 3312 { |
| 3312 if (mediaControls()) | 3313 if (mediaControls()) |
| 3313 mediaControls()->exitedFullscreen(); | 3314 mediaControls()->exitedFullscreen(); |
| 3314 if (webMediaPlayer()) | 3315 if (webMediaPlayer()) |
| 3315 webMediaPlayer()->exitedFullscreen(); | 3316 webMediaPlayer()->exitedFullscreen(); |
| 3316 if (m_inOverlayFullscreenVideo) | 3317 if (m_inOverlayFullscreenVideo) |
| 3317 document().layoutViewItem().compositor()->setNeedsCompositingUpdate(Comp
ositingUpdateRebuildTree); | 3318 document().layoutViewItem().compositor()->setNeedsCompositingUpdate(Comp
ositingUpdateRebuildTree); |
| 3318 m_inOverlayFullscreenVideo = false; | 3319 m_inOverlayFullscreenVideo = false; |
| 3319 } | 3320 } |
| 3320 | 3321 |
| 3322 void HTMLMediaElement::parentEnteredFullscreen() |
| 3323 { |
| 3324 m_isParentInFullscreen = true; |
| 3325 // Notify webMediaPlayer() the video enters full screen display. |
| 3326 // TODO(xjz): this size check seems not work for youtube videos. |
| 3327 if (webMediaPlayer() && (clientWidth() >= document().domWindow()->innerWidth
()) && (clientHeight() >= document().domWindow()->innerHeight())) { |
| 3328 webMediaPlayer()->videoEnteredFullscreen(); |
| 3329 } |
| 3330 } |
| 3331 |
| 3332 void HTMLMediaElement::parentExitedFullscreen() |
| 3333 { |
| 3334 m_isParentInFullscreen = false; |
| 3335 if (webMediaPlayer()) |
| 3336 webMediaPlayer()->videoExitedFullscreen(); |
| 3337 } |
| 3338 |
| 3321 WebLayer* HTMLMediaElement::platformLayer() const | 3339 WebLayer* HTMLMediaElement::platformLayer() const |
| 3322 { | 3340 { |
| 3323 return m_webLayer; | 3341 return m_webLayer; |
| 3324 } | 3342 } |
| 3325 | 3343 |
| 3326 bool HTMLMediaElement::hasClosedCaptions() const | 3344 bool HTMLMediaElement::hasClosedCaptions() const |
| 3327 { | 3345 { |
| 3328 if (m_textTracks) { | 3346 if (m_textTracks) { |
| 3329 for (unsigned i = 0; i < m_textTracks->length(); ++i) { | 3347 for (unsigned i = 0; i < m_textTracks->length(); ++i) { |
| 3330 if (m_textTracks->anonymousIndexedGetter(i)->canBeRendered()) | 3348 if (m_textTracks->anonymousIndexedGetter(i)->canBeRendered()) |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4038 | 4056 |
| 4039 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co
nst | 4057 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co
nst |
| 4040 { | 4058 { |
| 4041 IntRect result; | 4059 IntRect result; |
| 4042 if (LayoutObject* object = m_element->layoutObject()) | 4060 if (LayoutObject* object = m_element->layoutObject()) |
| 4043 result = object->absoluteBoundingBoxRect(); | 4061 result = object->absoluteBoundingBoxRect(); |
| 4044 return result; | 4062 return result; |
| 4045 } | 4063 } |
| 4046 | 4064 |
| 4047 } // namespace blink | 4065 } // namespace blink |
| OLD | NEW |