| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 { | 246 { |
| 247 ASSERT(!s_mediaStreamRegistry); | 247 ASSERT(!s_mediaStreamRegistry); |
| 248 s_mediaStreamRegistry = registry; | 248 s_mediaStreamRegistry = registry; |
| 249 } | 249 } |
| 250 | 250 |
| 251 bool HTMLMediaElement::isMediaStreamURL(const String& url) | 251 bool HTMLMediaElement::isMediaStreamURL(const String& url) |
| 252 { | 252 { |
| 253 return s_mediaStreamRegistry ? s_mediaStreamRegistry->contains(url) : false; | 253 return s_mediaStreamRegistry ? s_mediaStreamRegistry->contains(url) : false; |
| 254 } | 254 } |
| 255 | 255 |
| 256 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
ent, bool createdByParser) | 256 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
ent) |
| 257 : HTMLElement(tagName, document) | 257 : HTMLElement(tagName, document) |
| 258 , ActiveDOMObject(&document) | 258 , ActiveDOMObject(&document) |
| 259 , m_loadTimer(this, &HTMLMediaElement::loadTimerFired) | 259 , m_loadTimer(this, &HTMLMediaElement::loadTimerFired) |
| 260 , m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired) | 260 , m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired) |
| 261 , m_playbackProgressTimer(this, &HTMLMediaElement::playbackProgressTimerFire
d) | 261 , m_playbackProgressTimer(this, &HTMLMediaElement::playbackProgressTimerFire
d) |
| 262 , m_playedTimeRanges() | 262 , m_playedTimeRanges() |
| 263 , m_asyncEventQueue(GenericEventQueue::create(this)) | 263 , m_asyncEventQueue(GenericEventQueue::create(this)) |
| 264 , m_playbackRate(1.0f) | 264 , m_playbackRate(1.0f) |
| 265 , m_defaultPlaybackRate(1.0f) | 265 , m_defaultPlaybackRate(1.0f) |
| 266 , m_networkState(NETWORK_EMPTY) | 266 , m_networkState(NETWORK_EMPTY) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 292 , m_muted(false) | 292 , m_muted(false) |
| 293 , m_paused(true) | 293 , m_paused(true) |
| 294 , m_seeking(false) | 294 , m_seeking(false) |
| 295 , m_sentStalledEvent(false) | 295 , m_sentStalledEvent(false) |
| 296 , m_sentEndEvent(false) | 296 , m_sentEndEvent(false) |
| 297 , m_pausedInternal(false) | 297 , m_pausedInternal(false) |
| 298 , m_closedCaptionsVisible(false) | 298 , m_closedCaptionsVisible(false) |
| 299 , m_loadInitiatedByUserGesture(false) | 299 , m_loadInitiatedByUserGesture(false) |
| 300 , m_completelyLoaded(false) | 300 , m_completelyLoaded(false) |
| 301 , m_havePreparedToPlay(false) | 301 , m_havePreparedToPlay(false) |
| 302 , m_parsingInProgress(createdByParser) | |
| 303 , m_tracksAreReady(true) | 302 , m_tracksAreReady(true) |
| 304 , m_haveVisibleTextTrack(false) | 303 , m_haveVisibleTextTrack(false) |
| 305 , m_processingPreferenceChange(false) | 304 , m_processingPreferenceChange(false) |
| 306 , m_lastTextTrackUpdateTime(-1) | 305 , m_lastTextTrackUpdateTime(-1) |
| 307 , m_textTracks(0) | 306 , m_textTracks(0) |
| 308 , m_ignoreTrackDisplayUpdate(0) | 307 , m_ignoreTrackDisplayUpdate(0) |
| 309 #if ENABLE(WEB_AUDIO) | 308 #if ENABLE(WEB_AUDIO) |
| 310 , m_audioSourceNode(0) | 309 , m_audioSourceNode(0) |
| 311 #endif | 310 #endif |
| 312 , m_emeMode(EmeModeNotSelected) | 311 , m_emeMode(EmeModeNotSelected) |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 setMediaGroup(value); | 457 setMediaGroup(value); |
| 459 else if (name == onbeforeloadAttr) | 458 else if (name == onbeforeloadAttr) |
| 460 setAttributeEventListener(EventTypeNames::beforeload, createAttributeEve
ntListener(this, name, value)); | 459 setAttributeEventListener(EventTypeNames::beforeload, createAttributeEve
ntListener(this, name, value)); |
| 461 else | 460 else |
| 462 HTMLElement::parseAttribute(name, value); | 461 HTMLElement::parseAttribute(name, value); |
| 463 } | 462 } |
| 464 | 463 |
| 465 void HTMLMediaElement::finishParsingChildren() | 464 void HTMLMediaElement::finishParsingChildren() |
| 466 { | 465 { |
| 467 HTMLElement::finishParsingChildren(); | 466 HTMLElement::finishParsingChildren(); |
| 468 m_parsingInProgress = false; | |
| 469 | 467 |
| 470 if (!RuntimeEnabledFeatures::videoTrackEnabled()) | 468 if (!RuntimeEnabledFeatures::videoTrackEnabled()) |
| 471 return; | 469 return; |
| 472 | 470 |
| 473 for (Node* node = firstChild(); node; node = node->nextSibling()) { | 471 for (Node* node = firstChild(); node; node = node->nextSibling()) { |
| 474 if (node->hasTagName(trackTag)) { | 472 if (node->hasTagName(trackTag)) { |
| 475 scheduleDelayedAction(LoadTextTrackResource); | 473 scheduleDelayedAction(LoadTextTrackResource); |
| 476 break; | 474 break; |
| 477 } | 475 } |
| 478 } | 476 } |
| (...skipping 2187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2666 // then the user agent must add the track element's corresponding text track
to the | 2664 // then the user agent must add the track element's corresponding text track
to the |
| 2667 // media element's list of text tracks ... [continues in TextTrackList::appe
nd] | 2665 // media element's list of text tracks ... [continues in TextTrackList::appe
nd] |
| 2668 RefPtr<TextTrack> textTrack = trackElement->track(); | 2666 RefPtr<TextTrack> textTrack = trackElement->track(); |
| 2669 if (!textTrack) | 2667 if (!textTrack) |
| 2670 return; | 2668 return; |
| 2671 | 2669 |
| 2672 addTrack(textTrack.get()); | 2670 addTrack(textTrack.get()); |
| 2673 | 2671 |
| 2674 // Do not schedule the track loading until parsing finishes so we don't star
t before all tracks | 2672 // Do not schedule the track loading until parsing finishes so we don't star
t before all tracks |
| 2675 // in the markup have been added. | 2673 // in the markup have been added. |
| 2676 if (!m_parsingInProgress) | 2674 if (isFinishedParsingChildren()) |
| 2677 scheduleDelayedAction(LoadTextTrackResource); | 2675 scheduleDelayedAction(LoadTextTrackResource); |
| 2678 | 2676 |
| 2679 if (hasMediaControls()) | 2677 if (hasMediaControls()) |
| 2680 mediaControls()->closedCaptionTracksChanged(); | 2678 mediaControls()->closedCaptionTracksChanged(); |
| 2681 } | 2679 } |
| 2682 | 2680 |
| 2683 void HTMLMediaElement::didRemoveTrack(HTMLTrackElement* trackElement) | 2681 void HTMLMediaElement::didRemoveTrack(HTMLTrackElement* trackElement) |
| 2684 { | 2682 { |
| 2685 ASSERT(trackElement->hasTagName(trackTag)); | 2683 ASSERT(trackElement->hasTagName(trackTag)); |
| 2686 | 2684 |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3981 { | 3979 { |
| 3982 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); | 3980 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); |
| 3983 } | 3981 } |
| 3984 | 3982 |
| 3985 bool HTMLMediaElement::isInteractiveContent() const | 3983 bool HTMLMediaElement::isInteractiveContent() const |
| 3986 { | 3984 { |
| 3987 return fastHasAttribute(controlsAttr); | 3985 return fastHasAttribute(controlsAttr); |
| 3988 } | 3986 } |
| 3989 | 3987 |
| 3990 } | 3988 } |
| OLD | NEW |