| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; | 60 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; |
| 61 typedef CueIntervalTree::IntervalType CueInterval; | 61 typedef CueIntervalTree::IntervalType CueInterval; |
| 62 typedef Vector<CueInterval> CueList; | 62 typedef Vector<CueInterval> CueList; |
| 63 | 63 |
| 64 // FIXME: The inheritance from MediaPlayerClient here should be private inherita
nce. | 64 // FIXME: The inheritance from MediaPlayerClient here should be private inherita
nce. |
| 65 // But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so
it | 65 // But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so
it |
| 66 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement. | 66 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement. |
| 67 | 67 |
| 68 class HTMLMediaElement : public HTMLElement, public MediaPlayerClient, public Ac
tiveDOMObject, public MediaControllerInterface | 68 class HTMLMediaElement : public HTMLElement, public MediaPlayerClient, public Ac
tiveDOMObject, public MediaControllerInterface |
| 69 , private TextTrackClient | 69 , private TextTrackClient |
| 70 #if USE(PLATFORM_TEXT_TRACK_MENU) | |
| 71 , public PlatformTextTrackMenuClient | |
| 72 #endif | |
| 73 { | 70 { |
| 74 public: | 71 public: |
| 75 MediaPlayer* player() const { return m_player.get(); } | 72 MediaPlayer* player() const { return m_player.get(); } |
| 76 | 73 |
| 77 virtual bool isVideo() const = 0; | 74 virtual bool isVideo() const = 0; |
| 78 virtual bool hasVideo() const { return false; } | 75 virtual bool hasVideo() const { return false; } |
| 79 virtual bool hasAudio() const; | 76 virtual bool hasAudio() const; |
| 80 | 77 |
| 81 void rewind(double timeDelta); | 78 void rewind(double timeDelta); |
| 82 void returnToRealtime(); | 79 void returnToRealtime(); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 void removeAllInbandTracks(); | 203 void removeAllInbandTracks(); |
| 207 void closeCaptionTracksChanged(); | 204 void closeCaptionTracksChanged(); |
| 208 void notifyMediaPlayerOfTextTrackChanges(); | 205 void notifyMediaPlayerOfTextTrackChanges(); |
| 209 | 206 |
| 210 virtual void didAddTrack(HTMLTrackElement*); | 207 virtual void didAddTrack(HTMLTrackElement*); |
| 211 virtual void didRemoveTrack(HTMLTrackElement*); | 208 virtual void didRemoveTrack(HTMLTrackElement*); |
| 212 | 209 |
| 213 virtual void mediaPlayerDidAddTrack(PassRefPtr<InbandTextTrackPrivate>) OVER
RIDE; | 210 virtual void mediaPlayerDidAddTrack(PassRefPtr<InbandTextTrackPrivate>) OVER
RIDE; |
| 214 virtual void mediaPlayerDidRemoveTrack(PassRefPtr<InbandTextTrackPrivate>) O
VERRIDE; | 211 virtual void mediaPlayerDidRemoveTrack(PassRefPtr<InbandTextTrackPrivate>) O
VERRIDE; |
| 215 | 212 |
| 216 #if USE(PLATFORM_TEXT_TRACK_MENU) | |
| 217 virtual void setSelectedTextTrack(PassRefPtr<PlatformTextTrack>) OVERRIDE; | |
| 218 virtual Vector<RefPtr<PlatformTextTrack> > platformTextTracks() OVERRIDE; | |
| 219 PlatformTextTrackMenuInterface* platformTextTrackMenu(); | |
| 220 #endif | |
| 221 | |
| 222 struct TrackGroup { | 213 struct TrackGroup { |
| 223 enum GroupKind { CaptionsAndSubtitles, Description, Chapter, Metadata, O
ther }; | 214 enum GroupKind { CaptionsAndSubtitles, Description, Chapter, Metadata, O
ther }; |
| 224 | 215 |
| 225 TrackGroup(GroupKind kind) | 216 TrackGroup(GroupKind kind) |
| 226 : visibleTrack(0) | 217 : visibleTrack(0) |
| 227 , defaultTrack(0) | 218 , defaultTrack(0) |
| 228 , kind(kind) | 219 , kind(kind) |
| 229 , hasSrcLang(false) | 220 , hasSrcLang(false) |
| 230 { | 221 { |
| 231 } | 222 } |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 | 618 |
| 628 String m_mediaGroup; | 619 String m_mediaGroup; |
| 629 friend class MediaController; | 620 friend class MediaController; |
| 630 RefPtr<MediaController> m_mediaController; | 621 RefPtr<MediaController> m_mediaController; |
| 631 | 622 |
| 632 friend class TrackDisplayUpdateScope; | 623 friend class TrackDisplayUpdateScope; |
| 633 | 624 |
| 634 #if ENABLE(ENCRYPTED_MEDIA_V2) | 625 #if ENABLE(ENCRYPTED_MEDIA_V2) |
| 635 RefPtr<MediaKeys> m_mediaKeys; | 626 RefPtr<MediaKeys> m_mediaKeys; |
| 636 #endif | 627 #endif |
| 637 | |
| 638 #if USE(PLATFORM_TEXT_TRACK_MENU) | |
| 639 RefPtr<PlatformTextTrackMenuInterface> m_platformMenu; | |
| 640 #endif | |
| 641 }; | 628 }; |
| 642 | 629 |
| 643 #ifndef NDEBUG | 630 #ifndef NDEBUG |
| 644 // Template specializations required by PodIntervalTree in debug mode. | 631 // Template specializations required by PodIntervalTree in debug mode. |
| 645 template <> | 632 template <> |
| 646 struct ValueToString<double> { | 633 struct ValueToString<double> { |
| 647 static String string(const double value) | 634 static String string(const double value) |
| 648 { | 635 { |
| 649 return String::number(value); | 636 return String::number(value); |
| 650 } | 637 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 666 | 653 |
| 667 inline HTMLMediaElement* toMediaElement(Node* node) | 654 inline HTMLMediaElement* toMediaElement(Node* node) |
| 668 { | 655 { |
| 669 ASSERT_WITH_SECURITY_IMPLICATION(!node || isMediaElement(node)); | 656 ASSERT_WITH_SECURITY_IMPLICATION(!node || isMediaElement(node)); |
| 670 return static_cast<HTMLMediaElement*>(node); | 657 return static_cast<HTMLMediaElement*>(node); |
| 671 } | 658 } |
| 672 | 659 |
| 673 } //namespace | 660 } //namespace |
| 674 | 661 |
| 675 #endif | 662 #endif |
| OLD | NEW |