OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/VideoTrack.h" | 5 #include "core/html/track/VideoTrack.h" |
6 | 6 |
7 #include "core/html/HTMLMediaElement.h" | 7 #include "core/html/HTMLMediaElement.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
11 VideoTrack::VideoTrack(const String& id, const AtomicString& kind, const AtomicS
tring& label, const AtomicString& language, bool selected) | 11 VideoTrack::VideoTrack(const String& id, const AtomicString& kind, const AtomicS
tring& label, const AtomicString& language, bool selected) |
12 : TrackBase(WebMediaPlayer::VideoTrack, label, language, id) | 12 : TrackBase(WebMediaPlayer::VideoTrack, kind, label, language, id) |
13 , m_selected(selected) | 13 , m_selected(selected) |
14 { | 14 { |
15 setKind(kind); | |
16 } | 15 } |
17 | 16 |
18 VideoTrack::~VideoTrack() | 17 VideoTrack::~VideoTrack() |
19 { | 18 { |
20 } | 19 } |
21 | 20 |
22 DEFINE_TRACE(VideoTrack) | 21 DEFINE_TRACE(VideoTrack) |
23 { | 22 { |
24 TrackBase::trace(visitor); | 23 TrackBase::trace(visitor); |
25 } | 24 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 67 } |
69 | 68 |
70 const AtomicString& VideoTrack::commentaryKeyword() | 69 const AtomicString& VideoTrack::commentaryKeyword() |
71 { | 70 { |
72 DEFINE_STATIC_LOCAL(const AtomicString, keyword, ("commentary")); | 71 DEFINE_STATIC_LOCAL(const AtomicString, keyword, ("commentary")); |
73 return keyword; | 72 return keyword; |
74 } | 73 } |
75 | 74 |
76 bool VideoTrack::isValidKindKeyword(const String& kind) | 75 bool VideoTrack::isValidKindKeyword(const String& kind) |
77 { | 76 { |
78 return (kind == alternativeKeyword()) | 77 return kind == alternativeKeyword() |
79 || (kind == captionsKeyword()) | 78 || kind == captionsKeyword() |
80 || (kind == mainKeyword()) | 79 || kind == mainKeyword() |
81 || (kind == signKeyword()) | 80 || kind == signKeyword() |
82 || (kind == subtitlesKeyword()) | 81 || kind == subtitlesKeyword() |
83 || (kind == commentaryKeyword()) | 82 || kind == commentaryKeyword() |
84 || (kind == emptyAtom); | 83 || kind == emptyAtom; |
85 } | |
86 | |
87 AtomicString VideoTrack::invalidValueDefaultKind() const | |
88 { | |
89 return emptyAtom; | |
90 } | 84 } |
91 | 85 |
92 } // namespace blink | 86 } // namespace blink |
OLD | NEW |