| 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 LOG(Media, "HTMLMediaElement::scheduleLoad"); | 494 LOG(Media, "HTMLMediaElement::scheduleLoad"); |
| 495 | 495 |
| 496 if ((actionType & LoadMediaResource) && !(m_pendingActionFlags & LoadMediaRe
source)) { | 496 if ((actionType & LoadMediaResource) && !(m_pendingActionFlags & LoadMediaRe
source)) { |
| 497 prepareForLoad(); | 497 prepareForLoad(); |
| 498 m_pendingActionFlags |= LoadMediaResource; | 498 m_pendingActionFlags |= LoadMediaResource; |
| 499 } | 499 } |
| 500 | 500 |
| 501 if (RuntimeEnabledFeatures::videoTrackEnabled() && (actionType & LoadTextTra
ckResource)) | 501 if (RuntimeEnabledFeatures::videoTrackEnabled() && (actionType & LoadTextTra
ckResource)) |
| 502 m_pendingActionFlags |= LoadTextTrackResource; | 502 m_pendingActionFlags |= LoadTextTrackResource; |
| 503 | 503 |
| 504 #if USE(PLATFORM_TEXT_TRACK_MENU) | |
| 505 if (actionType & TextTrackChangesNotification) | |
| 506 m_pendingActionFlags |= TextTrackChangesNotification; | |
| 507 #endif | |
| 508 | |
| 509 if (!m_loadTimer.isActive()) | 504 if (!m_loadTimer.isActive()) |
| 510 m_loadTimer.startOneShot(0); | 505 m_loadTimer.startOneShot(0); |
| 511 } | 506 } |
| 512 | 507 |
| 513 void HTMLMediaElement::scheduleNextSourceChild() | 508 void HTMLMediaElement::scheduleNextSourceChild() |
| 514 { | 509 { |
| 515 // Schedule the timer to try the next <source> element WITHOUT resetting sta
te ala prepareForLoad. | 510 // Schedule the timer to try the next <source> element WITHOUT resetting sta
te ala prepareForLoad. |
| 516 m_pendingActionFlags |= LoadMediaResource; | 511 m_pendingActionFlags |= LoadMediaResource; |
| 517 m_loadTimer.startOneShot(0); | 512 m_loadTimer.startOneShot(0); |
| 518 } | 513 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 535 if (RuntimeEnabledFeatures::videoTrackEnabled() && (m_pendingActionFlags & L
oadTextTrackResource)) | 530 if (RuntimeEnabledFeatures::videoTrackEnabled() && (m_pendingActionFlags & L
oadTextTrackResource)) |
| 536 configureTextTracks(); | 531 configureTextTracks(); |
| 537 | 532 |
| 538 if (m_pendingActionFlags & LoadMediaResource) { | 533 if (m_pendingActionFlags & LoadMediaResource) { |
| 539 if (m_loadState == LoadingFromSourceElement) | 534 if (m_loadState == LoadingFromSourceElement) |
| 540 loadNextSourceChild(); | 535 loadNextSourceChild(); |
| 541 else | 536 else |
| 542 loadInternal(); | 537 loadInternal(); |
| 543 } | 538 } |
| 544 | 539 |
| 545 #if USE(PLATFORM_TEXT_TRACK_MENU) | |
| 546 if (RuntimeEnabledFeatures::videoTrackEnabled() && (m_pendingActionFlags & T
extTrackChangesNotification)) | |
| 547 notifyMediaPlayerOfTextTrackChanges(); | |
| 548 #endif | |
| 549 | |
| 550 m_pendingActionFlags = 0; | 540 m_pendingActionFlags = 0; |
| 551 } | 541 } |
| 552 | 542 |
| 553 PassRefPtr<MediaError> HTMLMediaElement::error() const | 543 PassRefPtr<MediaError> HTMLMediaElement::error() const |
| 554 { | 544 { |
| 555 return m_error; | 545 return m_error; |
| 556 } | 546 } |
| 557 | 547 |
| 558 void HTMLMediaElement::setSrc(const String& url) | 548 void HTMLMediaElement::setSrc(const String& url) |
| 559 { | 549 { |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1182 | 1172 |
| 1183 // If this is the first added track, create the list of text tra
cks. | 1173 // If this is the first added track, create the list of text tra
cks. |
| 1184 if (!m_textTracks) | 1174 if (!m_textTracks) |
| 1185 m_textTracks = TextTrackList::create(this, ActiveDOMObject::sc
riptExecutionContext()); | 1175 m_textTracks = TextTrackList::create(this, ActiveDOMObject::sc
riptExecutionContext()); |
| 1186 } | 1176 } |
| 1187 break; | 1177 break; |
| 1188 } | 1178 } |
| 1189 } else if (track->trackType() == TextTrack::AddTrack && track->mode() != Tex
tTrack::disabledKeyword()) | 1179 } else if (track->trackType() == TextTrack::AddTrack && track->mode() != Tex
tTrack::disabledKeyword()) |
| 1190 textTrackAddCues(track, track->cues()); | 1180 textTrackAddCues(track, track->cues()); |
| 1191 | 1181 |
| 1192 #if USE(PLATFORM_TEXT_TRACK_MENU) | |
| 1193 if (platformTextTrackMenu()) | |
| 1194 platformTextTrackMenu()->trackWasSelected(track->platformTextTrack()); | |
| 1195 #endif | |
| 1196 | |
| 1197 configureTextTrackDisplay(); | 1182 configureTextTrackDisplay(); |
| 1198 updateActiveTextTrackCues(currentTime()); | 1183 updateActiveTextTrackCues(currentTime()); |
| 1199 } | 1184 } |
| 1200 | 1185 |
| 1201 void HTMLMediaElement::textTrackKindChanged(TextTrack* track) | 1186 void HTMLMediaElement::textTrackKindChanged(TextTrack* track) |
| 1202 { | 1187 { |
| 1203 if (track->kind() != TextTrack::captionsKeyword() && track->kind() != TextTr
ack::subtitlesKeyword() && track->mode() == TextTrack::showingKeyword()) | 1188 if (track->kind() != TextTrack::captionsKeyword() && track->kind() != TextTr
ack::subtitlesKeyword() && track->mode() == TextTrack::showingKeyword()) |
| 1204 track->setMode(TextTrack::hiddenKeyword()); | 1189 track->setMode(TextTrack::hiddenKeyword()); |
| 1205 } | 1190 } |
| 1206 | 1191 |
| (...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3456 | 3441 |
| 3457 // Reset m_readyState since m_player is gone. | 3442 // Reset m_readyState since m_player is gone. |
| 3458 m_readyState = HAVE_NOTHING; | 3443 m_readyState = HAVE_NOTHING; |
| 3459 updateMediaController(); | 3444 updateMediaController(); |
| 3460 if (RuntimeEnabledFeatures::videoTrackEnabled()) | 3445 if (RuntimeEnabledFeatures::videoTrackEnabled()) |
| 3461 updateActiveTextTrackCues(0); | 3446 updateActiveTextTrackCues(0); |
| 3462 } | 3447 } |
| 3463 | 3448 |
| 3464 void HTMLMediaElement::clearMediaPlayer(int flags) | 3449 void HTMLMediaElement::clearMediaPlayer(int flags) |
| 3465 { | 3450 { |
| 3466 #if USE(PLATFORM_TEXT_TRACK_MENU) | |
| 3467 if (platformTextTrackMenu()) { | |
| 3468 m_platformMenu->setClient(0); | |
| 3469 m_platformMenu = 0; | |
| 3470 } | |
| 3471 #endif | |
| 3472 | |
| 3473 removeAllInbandTracks(); | 3451 removeAllInbandTracks(); |
| 3474 | 3452 |
| 3475 closeMediaSource(); | 3453 closeMediaSource(); |
| 3476 | 3454 |
| 3477 m_player.clear(); | 3455 m_player.clear(); |
| 3478 stopPeriodicTimers(); | 3456 stopPeriodicTimers(); |
| 3479 m_loadTimer.stop(); | 3457 m_loadTimer.stop(); |
| 3480 | 3458 |
| 3481 m_pendingActionFlags &= ~flags; | 3459 m_pendingActionFlags &= ~flags; |
| 3482 m_loadState = WaitingForSource; | 3460 m_loadState = WaitingForSource; |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4040 info.addMember(m_mediaGroup, "mediaGroup"); | 4018 info.addMember(m_mediaGroup, "mediaGroup"); |
| 4041 info.addMember(m_mediaController, "mediaController"); | 4019 info.addMember(m_mediaController, "mediaController"); |
| 4042 | 4020 |
| 4043 #if ENABLE(WEB_AUDIO) | 4021 #if ENABLE(WEB_AUDIO) |
| 4044 info.addMember(m_audioSourceNode, "audioSourceNode"); | 4022 info.addMember(m_audioSourceNode, "audioSourceNode"); |
| 4045 #endif | 4023 #endif |
| 4046 | 4024 |
| 4047 } | 4025 } |
| 4048 | 4026 |
| 4049 } | 4027 } |
| OLD | NEW |