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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 #include "modules/webaudio/MediaElementAudioSourceNode.h" | 85 #include "modules/webaudio/MediaElementAudioSourceNode.h" |
86 #endif | 86 #endif |
87 | 87 |
88 #if ENABLE(ENCRYPTED_MEDIA_V2) | 88 #if ENABLE(ENCRYPTED_MEDIA_V2) |
89 // FIXME: Remove dependency on modules/encryptedmedia (http://crbug.com/242754). | 89 // FIXME: Remove dependency on modules/encryptedmedia (http://crbug.com/242754). |
90 #include "modules/encryptedmedia/MediaKeyNeededEvent.h" | 90 #include "modules/encryptedmedia/MediaKeyNeededEvent.h" |
91 #include "modules/encryptedmedia/MediaKeys.h" | 91 #include "modules/encryptedmedia/MediaKeys.h" |
92 #endif | 92 #endif |
93 | 93 |
94 using namespace std; | 94 using namespace std; |
95 using WebKit::WebMimeRegistry; | 95 using blink::WebMimeRegistry; |
96 | 96 |
97 namespace WebCore { | 97 namespace WebCore { |
98 | 98 |
99 #if !LOG_DISABLED | 99 #if !LOG_DISABLED |
100 static String urlForLoggingMedia(const KURL& url) | 100 static String urlForLoggingMedia(const KURL& url) |
101 { | 101 { |
102 static const unsigned maximumURLLengthForLogging = 128; | 102 static const unsigned maximumURLLengthForLogging = 128; |
103 | 103 |
104 if (url.string().length() < maximumURLLengthForLogging) | 104 if (url.string().length() < maximumURLLengthForLogging) |
105 return url.string(); | 105 return url.string(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 } | 202 } |
203 | 203 |
204 // If no MIME type is specified, always attempt to load. | 204 // If no MIME type is specified, always attempt to load. |
205 if (contentMIMEType.isEmpty()) | 205 if (contentMIMEType.isEmpty()) |
206 return true; | 206 return true; |
207 | 207 |
208 // 4.8.10.3 MIME types - In the absence of a specification to the contrary,
the MIME type "application/octet-stream" | 208 // 4.8.10.3 MIME types - In the absence of a specification to the contrary,
the MIME type "application/octet-stream" |
209 // when used with parameters, e.g. "application/octet-stream;codecs=theora",
is a type that the user agent knows | 209 // when used with parameters, e.g. "application/octet-stream;codecs=theora",
is a type that the user agent knows |
210 // it cannot render. | 210 // it cannot render. |
211 if (contentMIMEType != "application/octet-stream" || contentTypeCodecs.isEmp
ty()) { | 211 if (contentMIMEType != "application/octet-stream" || contentTypeCodecs.isEmp
ty()) { |
212 WebMimeRegistry::SupportsType supported = WebKit::Platform::current()->m
imeRegistry()->supportsMediaMIMEType(contentMIMEType, contentTypeCodecs, keySyst
em.lower()); | 212 WebMimeRegistry::SupportsType supported = blink::Platform::current()->mi
meRegistry()->supportsMediaMIMEType(contentMIMEType, contentTypeCodecs, keySyste
m.lower()); |
213 return supported > WebMimeRegistry::IsNotSupported; | 213 return supported > WebMimeRegistry::IsNotSupported; |
214 } | 214 } |
215 | 215 |
216 return false; | 216 return false; |
217 } | 217 } |
218 | 218 |
219 WebMimeRegistry::SupportsType HTMLMediaElement::supportsType(const ContentType&
contentType, const String& keySystem) | 219 WebMimeRegistry::SupportsType HTMLMediaElement::supportsType(const ContentType&
contentType, const String& keySystem) |
220 { | 220 { |
221 DEFINE_STATIC_LOCAL(const String, codecs, ("codecs")); | 221 DEFINE_STATIC_LOCAL(const String, codecs, ("codecs")); |
222 | 222 |
223 if (!RuntimeEnabledFeatures::mediaEnabled()) | 223 if (!RuntimeEnabledFeatures::mediaEnabled()) |
224 return WebMimeRegistry::IsNotSupported; | 224 return WebMimeRegistry::IsNotSupported; |
225 | 225 |
226 String type = contentType.type().lower(); | 226 String type = contentType.type().lower(); |
227 // The codecs string is not lower-cased because MP4 values are case sensitiv
e | 227 // The codecs string is not lower-cased because MP4 values are case sensitiv
e |
228 // per http://tools.ietf.org/html/rfc4281#page-7. | 228 // per http://tools.ietf.org/html/rfc4281#page-7. |
229 String typeCodecs = contentType.parameter(codecs); | 229 String typeCodecs = contentType.parameter(codecs); |
230 String system = keySystem.lower(); | 230 String system = keySystem.lower(); |
231 | 231 |
232 if (type.isEmpty()) | 232 if (type.isEmpty()) |
233 return WebMimeRegistry::IsNotSupported; | 233 return WebMimeRegistry::IsNotSupported; |
234 | 234 |
235 // 4.8.10.3 MIME types - The canPlayType(type) method must return the empty
string if type is a type that the | 235 // 4.8.10.3 MIME types - The canPlayType(type) method must return the empty
string if type is a type that the |
236 // user agent knows it cannot render or is the type "application/octet-strea
m" | 236 // user agent knows it cannot render or is the type "application/octet-strea
m" |
237 if (type == "application/octet-stream") | 237 if (type == "application/octet-stream") |
238 return WebMimeRegistry::IsNotSupported; | 238 return WebMimeRegistry::IsNotSupported; |
239 | 239 |
240 return WebKit::Platform::current()->mimeRegistry()->supportsMediaMIMEType(ty
pe, typeCodecs, system); | 240 return blink::Platform::current()->mimeRegistry()->supportsMediaMIMEType(typ
e, typeCodecs, system); |
241 } | 241 } |
242 | 242 |
243 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
ent, bool createdByParser) | 243 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
ent, bool createdByParser) |
244 : HTMLElement(tagName, document) | 244 : HTMLElement(tagName, document) |
245 , ActiveDOMObject(&document) | 245 , ActiveDOMObject(&document) |
246 , m_loadTimer(this, &HTMLMediaElement::loadTimerFired) | 246 , m_loadTimer(this, &HTMLMediaElement::loadTimerFired) |
247 , m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired) | 247 , m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired) |
248 , m_playbackProgressTimer(this, &HTMLMediaElement::playbackProgressTimerFire
d) | 248 , m_playbackProgressTimer(this, &HTMLMediaElement::playbackProgressTimerFire
d) |
249 , m_playedTimeRanges() | 249 , m_playedTimeRanges() |
250 , m_asyncEventQueue(GenericEventQueue::create(this)) | 250 , m_asyncEventQueue(GenericEventQueue::create(this)) |
(...skipping 3219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3470 } | 3470 } |
3471 | 3471 |
3472 void HTMLMediaElement::willStopBeingFullscreenElement() | 3472 void HTMLMediaElement::willStopBeingFullscreenElement() |
3473 { | 3473 { |
3474 if (hasMediaControls()) | 3474 if (hasMediaControls()) |
3475 mediaControls()->exitedFullscreen(); | 3475 mediaControls()->exitedFullscreen(); |
3476 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isVideo()) | 3476 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isVideo()) |
3477 document().renderView()->compositor()->setCompositingLayersNeedRebuild(t
rue); | 3477 document().renderView()->compositor()->setCompositingLayersNeedRebuild(t
rue); |
3478 } | 3478 } |
3479 | 3479 |
3480 WebKit::WebLayer* HTMLMediaElement::platformLayer() const | 3480 blink::WebLayer* HTMLMediaElement::platformLayer() const |
3481 { | 3481 { |
3482 return m_player ? m_player->platformLayer() : 0; | 3482 return m_player ? m_player->platformLayer() : 0; |
3483 } | 3483 } |
3484 | 3484 |
3485 bool HTMLMediaElement::hasClosedCaptions() const | 3485 bool HTMLMediaElement::hasClosedCaptions() const |
3486 { | 3486 { |
3487 if (RuntimeEnabledFeatures::videoTrackEnabled() && m_textTracks) { | 3487 if (RuntimeEnabledFeatures::videoTrackEnabled() && m_textTracks) { |
3488 for (unsigned i = 0; i < m_textTracks->length(); ++i) { | 3488 for (unsigned i = 0; i < m_textTracks->length(); ++i) { |
3489 if (m_textTracks->item(i)->readinessState() == TextTrack::FailedToLo
ad) | 3489 if (m_textTracks->item(i)->readinessState() == TextTrack::FailedToLo
ad) |
3490 continue; | 3490 continue; |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3871 { | 3871 { |
3872 scheduleLayerUpdate(); | 3872 scheduleLayerUpdate(); |
3873 } | 3873 } |
3874 | 3874 |
3875 bool HTMLMediaElement::isInteractiveContent() const | 3875 bool HTMLMediaElement::isInteractiveContent() const |
3876 { | 3876 { |
3877 return fastHasAttribute(controlsAttr); | 3877 return fastHasAttribute(controlsAttr); |
3878 } | 3878 } |
3879 | 3879 |
3880 } | 3880 } |
OLD | NEW |