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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 setPlayerPreload(); | 989 setPlayerPreload(); |
990 | 990 |
991 if (fastHasAttribute(mutedAttr)) | 991 if (fastHasAttribute(mutedAttr)) |
992 m_muted = true; | 992 m_muted = true; |
993 updateVolume(); | 993 updateVolume(); |
994 | 994 |
995 ASSERT(!m_mediaSource); | 995 ASSERT(!m_mediaSource); |
996 | 996 |
997 bool attemptLoad = true; | 997 bool attemptLoad = true; |
998 | 998 |
999 if (source.isMediaStream() || url.protocolIs(mediaSourceBlobProtocol)) { | 999 bool isStreamOrBlobUrl = source.isMediaStream() || url.protocolIs(mediaSourc
eBlobProtocol); |
| 1000 if (isStreamOrBlobUrl) { |
1000 bool isMediaStream = source.isMediaStream() || (source.isURL() && isMedi
aStreamURL(url.getString())); | 1001 bool isMediaStream = source.isMediaStream() || (source.isURL() && isMedi
aStreamURL(url.getString())); |
1001 if (isMediaStream) { | 1002 if (isMediaStream) { |
1002 m_autoplayHelper->removeUserGestureRequirement(GesturelessPlaybackEn
abledByStream); | 1003 m_autoplayHelper->removeUserGestureRequirement(GesturelessPlaybackEn
abledByStream); |
1003 } else { | 1004 } else { |
1004 m_mediaSource = HTMLMediaSource::lookup(url.getString()); | 1005 m_mediaSource = HTMLMediaSource::lookup(url.getString()); |
1005 | 1006 |
1006 if (m_mediaSource) { | 1007 if (m_mediaSource) { |
1007 if (!m_mediaSource->attachToElement(this)) { | 1008 if (!m_mediaSource->attachToElement(this)) { |
1008 // Forget our reference to the MediaSource, so we leave it a
lone | 1009 // Forget our reference to the MediaSource, so we leave it a
lone |
1009 // while processing remainder of load failure. | 1010 // while processing remainder of load failure. |
1010 m_mediaSource = nullptr; | 1011 m_mediaSource = nullptr; |
1011 attemptLoad = false; | 1012 attemptLoad = false; |
1012 } | 1013 } |
1013 } | 1014 } |
1014 } | 1015 } |
1015 } | 1016 } |
1016 | 1017 |
1017 bool canLoadResource = source.isMediaStream() || canLoadURL(url, contentType
); | 1018 bool canLoadResource = source.isMediaStream() || canLoadURL(url, contentType
); |
1018 if (attemptLoad && canLoadResource) { | 1019 if (attemptLoad && canLoadResource) { |
1019 ASSERT(!webMediaPlayer()); | 1020 ASSERT(!webMediaPlayer()); |
1020 | 1021 |
1021 if (effectivePreloadType() == WebMediaPlayer::PreloadNone) { | 1022 // Conditionally defer the load if effective preload is 'none'. |
| 1023 // Skip this optional deferral for MediaStream sources or any blob URL, |
| 1024 // including MediaSource blob URLs. |
| 1025 if (!isStreamOrBlobUrl && effectivePreloadType() == WebMediaPlayer::Prel
oadNone) { |
1022 WTF_LOG(Media, "HTMLMediaElement::loadResource(%p) : Delaying load b
ecause preload == 'none'", this); | 1026 WTF_LOG(Media, "HTMLMediaElement::loadResource(%p) : Delaying load b
ecause preload == 'none'", this); |
1023 deferLoad(); | 1027 deferLoad(); |
1024 } else { | 1028 } else { |
1025 startPlayerLoad(); | 1029 startPlayerLoad(); |
1026 } | 1030 } |
1027 } else { | 1031 } else { |
1028 mediaLoadingFailed(WebMediaPlayer::NetworkStateFormatError); | 1032 mediaLoadingFailed(WebMediaPlayer::NetworkStateFormatError); |
1029 } | 1033 } |
1030 | 1034 |
1031 // If there is no poster to display, allow the media engine to render video
frames as soon as | 1035 // If there is no poster to display, allow the media engine to render video
frames as soon as |
(...skipping 2814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3846 | 3850 |
3847 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co
nst | 3851 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co
nst |
3848 { | 3852 { |
3849 IntRect result; | 3853 IntRect result; |
3850 if (LayoutObject* object = m_element->layoutObject()) | 3854 if (LayoutObject* object = m_element->layoutObject()) |
3851 result = object->absoluteBoundingBoxRect(); | 3855 result = object->absoluteBoundingBoxRect(); |
3852 return result; | 3856 return result; |
3853 } | 3857 } |
3854 | 3858 |
3855 } // namespace blink | 3859 } // namespace blink |
OLD | NEW |