| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 return WebMimeRegistry::IsNotSupported; | 231 return WebMimeRegistry::IsNotSupported; |
| 232 | 232 |
| 233 // 4.8.10.3 MIME types - The canPlayType(type) method must return the empty
string if type is a type that the | 233 // 4.8.10.3 MIME types - The canPlayType(type) method must return the empty
string if type is a type that the |
| 234 // user agent knows it cannot render or is the type "application/octet-strea
m" | 234 // user agent knows it cannot render or is the type "application/octet-strea
m" |
| 235 if (type == "application/octet-stream") | 235 if (type == "application/octet-stream") |
| 236 return WebMimeRegistry::IsNotSupported; | 236 return WebMimeRegistry::IsNotSupported; |
| 237 | 237 |
| 238 return WebKit::Platform::current()->mimeRegistry()->supportsMediaMIMEType(ty
pe, typeCodecs, system); | 238 return WebKit::Platform::current()->mimeRegistry()->supportsMediaMIMEType(ty
pe, typeCodecs, system); |
| 239 } | 239 } |
| 240 | 240 |
| 241 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* docum
ent, bool createdByParser) | 241 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
ent, bool createdByParser) |
| 242 : HTMLElement(tagName, document) | 242 : HTMLElement(tagName, document) |
| 243 , ActiveDOMObject(document) | 243 , ActiveDOMObject(&document) |
| 244 , m_loadTimer(this, &HTMLMediaElement::loadTimerFired) | 244 , m_loadTimer(this, &HTMLMediaElement::loadTimerFired) |
| 245 , m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired) | 245 , m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired) |
| 246 , m_playbackProgressTimer(this, &HTMLMediaElement::playbackProgressTimerFire
d) | 246 , m_playbackProgressTimer(this, &HTMLMediaElement::playbackProgressTimerFire
d) |
| 247 , m_playedTimeRanges() | 247 , m_playedTimeRanges() |
| 248 , m_asyncEventQueue(GenericEventQueue::create(this)) | 248 , m_asyncEventQueue(GenericEventQueue::create(this)) |
| 249 , m_playbackRate(1.0f) | 249 , m_playbackRate(1.0f) |
| 250 , m_defaultPlaybackRate(1.0f) | 250 , m_defaultPlaybackRate(1.0f) |
| 251 , m_webkitPreservesPitch(true) | 251 , m_webkitPreservesPitch(true) |
| 252 , m_networkState(NETWORK_EMPTY) | 252 , m_networkState(NETWORK_EMPTY) |
| 253 , m_readyState(HAVE_NOTHING) | 253 , m_readyState(HAVE_NOTHING) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 , m_ignoreTrackDisplayUpdate(0) | 294 , m_ignoreTrackDisplayUpdate(0) |
| 295 #if ENABLE(WEB_AUDIO) | 295 #if ENABLE(WEB_AUDIO) |
| 296 , m_audioSourceNode(0) | 296 , m_audioSourceNode(0) |
| 297 #endif | 297 #endif |
| 298 { | 298 { |
| 299 ASSERT(RuntimeEnabledFeatures::mediaEnabled()); | 299 ASSERT(RuntimeEnabledFeatures::mediaEnabled()); |
| 300 | 300 |
| 301 LOG(Media, "HTMLMediaElement::HTMLMediaElement"); | 301 LOG(Media, "HTMLMediaElement::HTMLMediaElement"); |
| 302 ScriptWrappable::init(this); | 302 ScriptWrappable::init(this); |
| 303 | 303 |
| 304 if (document->settings() && document->settings()->mediaPlaybackRequiresUserG
esture()) { | 304 if (document.settings() && document.settings()->mediaPlaybackRequiresUserGes
ture()) { |
| 305 addBehaviorRestriction(RequireUserGestureForRateChangeRestriction); | 305 addBehaviorRestriction(RequireUserGestureForRateChangeRestriction); |
| 306 addBehaviorRestriction(RequireUserGestureForLoadRestriction); | 306 addBehaviorRestriction(RequireUserGestureForLoadRestriction); |
| 307 } | 307 } |
| 308 | 308 |
| 309 setHasCustomStyleCallbacks(); | 309 setHasCustomStyleCallbacks(); |
| 310 addElementToDocumentMap(this, document); | 310 addElementToDocumentMap(this, &document); |
| 311 | 311 |
| 312 } | 312 } |
| 313 | 313 |
| 314 HTMLMediaElement::~HTMLMediaElement() | 314 HTMLMediaElement::~HTMLMediaElement() |
| 315 { | 315 { |
| 316 LOG(Media, "HTMLMediaElement::~HTMLMediaElement"); | 316 LOG(Media, "HTMLMediaElement::~HTMLMediaElement"); |
| 317 | 317 |
| 318 m_asyncEventQueue->close(); | 318 m_asyncEventQueue->close(); |
| 319 | 319 |
| 320 setShouldDelayLoadEvent(false); | 320 setShouldDelayLoadEvent(false); |
| (...skipping 3359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3680 } | 3680 } |
| 3681 | 3681 |
| 3682 return false; | 3682 return false; |
| 3683 } | 3683 } |
| 3684 | 3684 |
| 3685 bool HTMLMediaElement::createMediaControls() | 3685 bool HTMLMediaElement::createMediaControls() |
| 3686 { | 3686 { |
| 3687 if (hasMediaControls()) | 3687 if (hasMediaControls()) |
| 3688 return true; | 3688 return true; |
| 3689 | 3689 |
| 3690 RefPtr<MediaControls> mediaControls = MediaControls::create(&document()); | 3690 RefPtr<MediaControls> mediaControls = MediaControls::create(document()); |
| 3691 if (!mediaControls) | 3691 if (!mediaControls) |
| 3692 return false; | 3692 return false; |
| 3693 | 3693 |
| 3694 mediaControls->setMediaController(m_mediaController ? m_mediaController.get(
) : static_cast<MediaControllerInterface*>(this)); | 3694 mediaControls->setMediaController(m_mediaController ? m_mediaController.get(
) : static_cast<MediaControllerInterface*>(this)); |
| 3695 mediaControls->reset(); | 3695 mediaControls->reset(); |
| 3696 if (isFullscreen()) | 3696 if (isFullscreen()) |
| 3697 mediaControls->enteredFullscreen(); | 3697 mediaControls->enteredFullscreen(); |
| 3698 | 3698 |
| 3699 ensureUserAgentShadowRoot()->appendChild(mediaControls); | 3699 ensureUserAgentShadowRoot()->appendChild(mediaControls); |
| 3700 | 3700 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3981 { | 3981 { |
| 3982 m_restrictions = NoRestrictions; | 3982 m_restrictions = NoRestrictions; |
| 3983 } | 3983 } |
| 3984 | 3984 |
| 3985 void HTMLMediaElement::mediaPlayerScheduleLayerUpdate() | 3985 void HTMLMediaElement::mediaPlayerScheduleLayerUpdate() |
| 3986 { | 3986 { |
| 3987 scheduleLayerUpdate(); | 3987 scheduleLayerUpdate(); |
| 3988 } | 3988 } |
| 3989 | 3989 |
| 3990 } | 3990 } |
| OLD | NEW |