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_isMediaInFullscreen(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::updateMediaInFullscreen(bool isFullscreen) |
| 3323 { |
| 3324 m_isMediaInFullscreen = isFullscreen; |
| 3325 if (webMediaPlayer()) |
| 3326 webMediaPlayer()->updateMediaInFullscreen(isFullscreen); |
| 3327 } |
| 3328 |
3321 WebLayer* HTMLMediaElement::platformLayer() const | 3329 WebLayer* HTMLMediaElement::platformLayer() const |
3322 { | 3330 { |
3323 return m_webLayer; | 3331 return m_webLayer; |
3324 } | 3332 } |
3325 | 3333 |
3326 bool HTMLMediaElement::hasClosedCaptions() const | 3334 bool HTMLMediaElement::hasClosedCaptions() const |
3327 { | 3335 { |
3328 if (m_textTracks) { | 3336 if (m_textTracks) { |
3329 for (unsigned i = 0; i < m_textTracks->length(); ++i) { | 3337 for (unsigned i = 0; i < m_textTracks->length(); ++i) { |
3330 if (m_textTracks->anonymousIndexedGetter(i)->canBeRendered()) | 3338 if (m_textTracks->anonymousIndexedGetter(i)->canBeRendered()) |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4038 | 4046 |
4039 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co
nst | 4047 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co
nst |
4040 { | 4048 { |
4041 IntRect result; | 4049 IntRect result; |
4042 if (LayoutObject* object = m_element->layoutObject()) | 4050 if (LayoutObject* object = m_element->layoutObject()) |
4043 result = object->absoluteBoundingBoxRect(); | 4051 result = object->absoluteBoundingBoxRect(); |
4044 return result; | 4052 return result; |
4045 } | 4053 } |
4046 | 4054 |
4047 } // namespace blink | 4055 } // namespace blink |
OLD | NEW |