OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/html/track/CueTimeline.h" | 5 #include "core/html/track/CueTimeline.h" |
6 | 6 |
7 #include "core/events/Event.h" | 7 #include "core/events/Event.h" |
8 #include "core/html/HTMLMediaElement.h" | 8 #include "core/html/HTMLMediaElement.h" |
9 #include "core/html/HTMLTrackElement.h" | 9 #include "core/html/HTMLTrackElement.h" |
10 #include "core/html/track/LoadableTextTrack.h" | 10 #include "core/html/track/LoadableTextTrack.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 // task to fire a simple event named cuechange at the TextTrack object, and, | 320 // task to fire a simple event named cuechange at the TextTrack object, and, |
321 // ... | 321 // ... |
322 for (const auto& track : affectedTracks) { | 322 for (const auto& track : affectedTracks) { |
323 mediaElement.scheduleEvent( | 323 mediaElement.scheduleEvent( |
324 createEventWithTarget(EventTypeNames::cuechange, track.get())); | 324 createEventWithTarget(EventTypeNames::cuechange, track.get())); |
325 | 325 |
326 // ... if the text track has a corresponding track element, to then fire a | 326 // ... if the text track has a corresponding track element, to then fire a |
327 // simple event named cuechange at the track element as well. | 327 // simple event named cuechange at the track element as well. |
328 if (track->trackType() == TextTrack::TrackElement) { | 328 if (track->trackType() == TextTrack::TrackElement) { |
329 HTMLTrackElement* trackElement = | 329 HTMLTrackElement* trackElement = |
330 static_cast<LoadableTextTrack*>(track.get())->trackElement(); | 330 toLoadableTextTrack(track.get())->trackElement(); |
331 DCHECK(trackElement); | 331 DCHECK(trackElement); |
332 mediaElement.scheduleEvent( | 332 mediaElement.scheduleEvent( |
333 createEventWithTarget(EventTypeNames::cuechange, trackElement)); | 333 createEventWithTarget(EventTypeNames::cuechange, trackElement)); |
334 } | 334 } |
335 } | 335 } |
336 | 336 |
337 // 16 - Set the text track cue active flag of all the cues in the current | 337 // 16 - Set the text track cue active flag of all the cues in the current |
338 // cues, and unset the text track cue active flag of all the cues in the | 338 // cues, and unset the text track cue active flag of all the cues in the |
339 // other cues. | 339 // other cues. |
340 for (const auto& cue : currentCues) | 340 for (const auto& cue : currentCues) |
(...skipping 21 matching lines...) Expand all Loading... |
362 --m_ignoreUpdate; | 362 --m_ignoreUpdate; |
363 if (!m_ignoreUpdate) | 363 if (!m_ignoreUpdate) |
364 updateActiveCues(mediaElement().currentTime()); | 364 updateActiveCues(mediaElement().currentTime()); |
365 } | 365 } |
366 | 366 |
367 DEFINE_TRACE(CueTimeline) { | 367 DEFINE_TRACE(CueTimeline) { |
368 visitor->trace(m_mediaElement); | 368 visitor->trace(m_mediaElement); |
369 } | 369 } |
370 | 370 |
371 } // namespace blink | 371 } // namespace blink |
OLD | NEW |