OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 if (cue->startTime() < existingCue->startTime() || (cue->startTime() ==
existingCue->startTime() && cue->endTime() > existingCue->endTime())) | 475 if (cue->startTime() < existingCue->startTime() || (cue->startTime() ==
existingCue->startTime() && cue->endTime() > existingCue->endTime())) |
476 searchEnd = index; | 476 searchEnd = index; |
477 else | 477 else |
478 searchStart = index + 1; | 478 searchStart = index + 1; |
479 } | 479 } |
480 | 480 |
481 ASSERT_NOT_REACHED(); | 481 ASSERT_NOT_REACHED(); |
482 return false; | 482 return false; |
483 } | 483 } |
484 | 484 |
485 #if USE(PLATFORM_TEXT_TRACK_MENU) | |
486 PassRefPtr<PlatformTextTrack> TextTrack::platformTextTrack() | |
487 { | |
488 if (m_platformTextTrack) | |
489 return m_platformTextTrack; | |
490 | |
491 PlatformTextTrack::TrackKind kind = PlatformTextTrack::Caption; | |
492 if (m_kind == subtitlesKeyword()) | |
493 kind = PlatformTextTrack::Subtitle; | |
494 else if (m_kind == captionsKeyword()) | |
495 kind = PlatformTextTrack::Caption; | |
496 else if (m_kind == descriptionsKeyword()) | |
497 kind = PlatformTextTrack::Description; | |
498 else if (m_kind == chaptersKeyword()) | |
499 kind = PlatformTextTrack::Chapter; | |
500 else if (m_kind == metadataKeyword()) | |
501 kind = PlatformTextTrack::MetaData; | |
502 | |
503 PlatformTextTrack::TrackType type = PlatformTextTrack::OutOfBand; | |
504 if (m_trackType == TrackElement) | |
505 type = PlatformTextTrack::OutOfBand; | |
506 else if (m_trackType == AddTrack) | |
507 type = PlatformTextTrack::Script; | |
508 else if (m_trackType == InBand) | |
509 type = PlatformTextTrack::InBand; | |
510 | |
511 m_platformTextTrack = PlatformTextTrack::create(this, m_label, m_language, k
ind, type); | |
512 | |
513 return m_platformTextTrack; | |
514 } | |
515 #endif | |
516 | |
517 bool TextTrack::isMainProgramContent() const | 485 bool TextTrack::isMainProgramContent() const |
518 { | 486 { |
519 // "Main program" content is intrinsic to the presentation of the media file
, regardless of locale. Content such as | 487 // "Main program" content is intrinsic to the presentation of the media file
, regardless of locale. Content such as |
520 // directors commentary is not "main program" because it is not essential fo
r the presentation. HTML5 doesn't have | 488 // directors commentary is not "main program" because it is not essential fo
r the presentation. HTML5 doesn't have |
521 // a way to express this in a machine-reable form, it is typically done with
the track label, so we assume that caption | 489 // a way to express this in a machine-reable form, it is typically done with
the track label, so we assume that caption |
522 // tracks are main content and all other track types are not. | 490 // tracks are main content and all other track types are not. |
523 return m_kind == captionsKeyword(); | 491 return m_kind == captionsKeyword(); |
524 } | 492 } |
525 | 493 |
526 } // namespace WebCore | 494 } // namespace WebCore |
527 | 495 |
OLD | NEW |