OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
425 m_playingRemotely(false), | 425 m_playingRemotely(false), |
426 m_inOverlayFullscreenVideo(false), | 426 m_inOverlayFullscreenVideo(false), |
427 m_mostlyFillingViewport(false), | 427 m_mostlyFillingViewport(false), |
428 m_audioTracks(this, AudioTrackList::create(*this)), | 428 m_audioTracks(this, AudioTrackList::create(*this)), |
429 m_videoTracks(this, VideoTrackList::create(*this)), | 429 m_videoTracks(this, VideoTrackList::create(*this)), |
430 m_textTracks(this, nullptr), | 430 m_textTracks(this, nullptr), |
431 m_audioSourceNode(nullptr), | 431 m_audioSourceNode(nullptr), |
432 m_autoplayUmaHelper(AutoplayUmaHelper::create(this)), | 432 m_autoplayUmaHelper(AutoplayUmaHelper::create(this)), |
433 m_remotePlaybackClient(nullptr), | 433 m_remotePlaybackClient(nullptr), |
434 m_autoplayVisibilityObserver(nullptr), | 434 m_autoplayVisibilityObserver(nullptr), |
435 m_mediaControls(nullptr) { | 435 m_mediaControls(nullptr), |
436 m_controlsList(HTMLMediaElementControlsList::create(this)) { | |
436 BLINK_MEDIA_LOG << "HTMLMediaElement(" << (void*)this << ")"; | 437 BLINK_MEDIA_LOG << "HTMLMediaElement(" << (void*)this << ")"; |
437 | 438 |
438 m_lockedPendingUserGesture = computeLockedPendingUserGesture(document); | 439 m_lockedPendingUserGesture = computeLockedPendingUserGesture(document); |
439 m_lockedPendingUserGestureIfCrossOriginExperimentEnabled = | 440 m_lockedPendingUserGestureIfCrossOriginExperimentEnabled = |
440 isDocumentCrossOrigin(document); | 441 isDocumentCrossOrigin(document); |
441 | 442 |
442 LocalFrame* frame = document.frame(); | 443 LocalFrame* frame = document.frame(); |
443 if (frame) { | 444 if (frame) { |
444 m_remotePlaybackClient = | 445 m_remotePlaybackClient = |
445 frame->loader().client()->createWebRemotePlaybackClient(*this); | 446 frame->loader().client()->createWebRemotePlaybackClient(*this); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
556 << ", srcAttr, old=" << params.oldValue | 557 << ", srcAttr, old=" << params.oldValue |
557 << ", new=" << params.newValue << ")"; | 558 << ", new=" << params.newValue << ")"; |
558 // Trigger a reload, as long as the 'src' attribute is present. | 559 // Trigger a reload, as long as the 'src' attribute is present. |
559 if (!params.newValue.isNull()) { | 560 if (!params.newValue.isNull()) { |
560 m_ignorePreloadNone = false; | 561 m_ignorePreloadNone = false; |
561 invokeLoadAlgorithm(); | 562 invokeLoadAlgorithm(); |
562 } | 563 } |
563 } else if (name == controlsAttr) { | 564 } else if (name == controlsAttr) { |
564 UseCounter::count(document(), | 565 UseCounter::count(document(), |
565 UseCounter::HTMLMediaElementControlsAttribute); | 566 UseCounter::HTMLMediaElementControlsAttribute); |
567 if (m_controlsList->value() != fastGetAttribute(controlsAttr)) | |
568 m_controlsList->setValue(fastGetAttribute(controlsAttr)); | |
fs
2017/01/25 09:34:16
m_controlsList->setValue(params.newValue);
(and p
whywhat
2017/03/01 16:17:20
Done.
| |
566 updateControlsVisibility(); | 569 updateControlsVisibility(); |
567 } else if (name == preloadAttr) { | 570 } else if (name == preloadAttr) { |
568 setPlayerPreload(); | 571 setPlayerPreload(); |
569 } else if (name == disableremoteplaybackAttr) { | 572 } else if (name == disableremoteplaybackAttr) { |
570 // This attribute is an extension described in the Remote Playback API spec. | 573 // This attribute is an extension described in the Remote Playback API spec. |
571 // Please see: https://w3c.github.io/remote-playback | 574 // Please see: https://w3c.github.io/remote-playback |
572 UseCounter::count(document(), UseCounter::DisableRemotePlaybackAttribute); | 575 UseCounter::count(document(), UseCounter::DisableRemotePlaybackAttribute); |
573 if (params.oldValue != params.newValue) { | 576 if (params.oldValue != params.newValue) { |
574 if (m_webMediaPlayer) { | 577 if (m_webMediaPlayer) { |
575 m_webMediaPlayer->requestRemotePlaybackDisabled( | 578 m_webMediaPlayer->requestRemotePlaybackDisabled( |
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2380 if (recordMetrics == RecordMetricsBehavior::DoRecord) | 2383 if (recordMetrics == RecordMetricsBehavior::DoRecord) |
2381 showControlsHistogram().count(MediaControlsShowNoScript); | 2384 showControlsHistogram().count(MediaControlsShowNoScript); |
2382 return true; | 2385 return true; |
2383 } | 2386 } |
2384 | 2387 |
2385 if (recordMetrics == RecordMetricsBehavior::DoRecord) | 2388 if (recordMetrics == RecordMetricsBehavior::DoRecord) |
2386 showControlsHistogram().count(MediaControlsShowNotShown); | 2389 showControlsHistogram().count(MediaControlsShowNotShown); |
2387 return false; | 2390 return false; |
2388 } | 2391 } |
2389 | 2392 |
2393 DOMTokenList* HTMLMediaElement::controlsList() const { | |
2394 return m_controlsList.get(); | |
2395 } | |
2396 | |
2397 void HTMLMediaElement::controlsListValueWasSet() { | |
2398 // Update the attribute value which will update the controls visibility. | |
2399 if (fastGetAttribute(controlsAttr) != m_controlsList->value()) | |
2400 setAttribute(controlsAttr, m_controlsList->value()); | |
fs
2017/01/25 09:34:16
Could (should?) use setSynchronizedLazyAttribute,
whywhat
2017/03/01 16:17:20
Done. Have to call updateControlsVisibility here.
| |
2401 } | |
2402 | |
2390 double HTMLMediaElement::volume() const { | 2403 double HTMLMediaElement::volume() const { |
2391 return m_volume; | 2404 return m_volume; |
2392 } | 2405 } |
2393 | 2406 |
2394 void HTMLMediaElement::setVolume(double vol, ExceptionState& exceptionState) { | 2407 void HTMLMediaElement::setVolume(double vol, ExceptionState& exceptionState) { |
2395 BLINK_MEDIA_LOG << "setVolume(" << (void*)this << ", " << vol << ")"; | 2408 BLINK_MEDIA_LOG << "setVolume(" << (void*)this << ", " << vol << ")"; |
2396 | 2409 |
2397 if (m_volume == vol) | 2410 if (m_volume == vol) |
2398 return; | 2411 return; |
2399 | 2412 |
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3766 visitor->trace(m_textTracks); | 3779 visitor->trace(m_textTracks); |
3767 visitor->trace(m_textTracksWhenResourceSelectionBegan); | 3780 visitor->trace(m_textTracksWhenResourceSelectionBegan); |
3768 visitor->trace(m_playPromiseResolvers); | 3781 visitor->trace(m_playPromiseResolvers); |
3769 visitor->trace(m_playPromiseResolveList); | 3782 visitor->trace(m_playPromiseResolveList); |
3770 visitor->trace(m_playPromiseRejectList); | 3783 visitor->trace(m_playPromiseRejectList); |
3771 visitor->trace(m_audioSourceProvider); | 3784 visitor->trace(m_audioSourceProvider); |
3772 visitor->trace(m_autoplayUmaHelper); | 3785 visitor->trace(m_autoplayUmaHelper); |
3773 visitor->trace(m_srcObject); | 3786 visitor->trace(m_srcObject); |
3774 visitor->trace(m_autoplayVisibilityObserver); | 3787 visitor->trace(m_autoplayVisibilityObserver); |
3775 visitor->trace(m_mediaControls); | 3788 visitor->trace(m_mediaControls); |
3789 visitor->trace(m_controlsList); | |
3776 visitor->template registerWeakMembers<HTMLMediaElement, | 3790 visitor->template registerWeakMembers<HTMLMediaElement, |
3777 &HTMLMediaElement::clearWeakMembers>( | 3791 &HTMLMediaElement::clearWeakMembers>( |
3778 this); | 3792 this); |
3779 Supplementable<HTMLMediaElement>::trace(visitor); | 3793 Supplementable<HTMLMediaElement>::trace(visitor); |
3780 HTMLElement::trace(visitor); | 3794 HTMLElement::trace(visitor); |
3781 SuspendableObject::trace(visitor); | 3795 SuspendableObject::trace(visitor); |
3782 } | 3796 } |
3783 | 3797 |
3784 DEFINE_TRACE_WRAPPERS(HTMLMediaElement) { | 3798 DEFINE_TRACE_WRAPPERS(HTMLMediaElement) { |
3785 visitor->traceWrappers(m_videoTracks); | 3799 visitor->traceWrappers(m_videoTracks); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4128 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4142 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
4129 } | 4143 } |
4130 | 4144 |
4131 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4145 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
4132 m_mostlyFillingViewport = true; | 4146 m_mostlyFillingViewport = true; |
4133 if (m_webMediaPlayer) | 4147 if (m_webMediaPlayer) |
4134 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4148 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
4135 } | 4149 } |
4136 | 4150 |
4137 } // namespace blink | 4151 } // namespace blink |
OLD | NEW |