| 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 30 matching lines...) Expand all Loading... |
| 41 class WebInbandTextTrack; | 41 class WebInbandTextTrack; |
| 42 class WebLayer; | 42 class WebLayer; |
| 43 } | 43 } |
| 44 | 44 |
| 45 namespace WebCore { | 45 namespace WebCore { |
| 46 | 46 |
| 47 #if ENABLE(WEB_AUDIO) | 47 #if ENABLE(WEB_AUDIO) |
| 48 class AudioSourceProvider; | 48 class AudioSourceProvider; |
| 49 class AudioSourceProviderClient; | 49 class AudioSourceProviderClient; |
| 50 #endif | 50 #endif |
| 51 class AudioTrackList; |
| 51 class ContentType; | 52 class ContentType; |
| 52 class Event; | 53 class Event; |
| 53 class ExceptionState; | 54 class ExceptionState; |
| 54 class HTMLSourceElement; | 55 class HTMLSourceElement; |
| 55 class HTMLTrackElement; | 56 class HTMLTrackElement; |
| 56 class KURL; | 57 class KURL; |
| 57 class MediaController; | 58 class MediaController; |
| 58 class MediaControls; | 59 class MediaControls; |
| 59 class MediaError; | 60 class MediaError; |
| 60 class HTMLMediaSource; | 61 class HTMLMediaSource; |
| 61 class TextTrackList; | 62 class TextTrackList; |
| 62 class TimeRanges; | 63 class TimeRanges; |
| 63 class URLRegistry; | 64 class URLRegistry; |
| 65 class VideoTrackList; |
| 64 | 66 |
| 65 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; | 67 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; |
| 66 typedef CueIntervalTree::IntervalType CueInterval; | 68 typedef CueIntervalTree::IntervalType CueInterval; |
| 67 typedef Vector<CueInterval> CueList; | 69 typedef Vector<CueInterval> CueList; |
| 68 | 70 |
| 69 // FIXME: The inheritance from MediaPlayerClient here should be private inherita
nce. | 71 // FIXME: The inheritance from MediaPlayerClient here should be private inherita
nce. |
| 70 // But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so
it | 72 // But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so
it |
| 71 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement. | 73 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement. |
| 72 | 74 |
| 73 class HTMLMediaElement : public HTMLElement, public WillBeHeapSupplementable<HTM
LMediaElement>, public MediaPlayerClient, public ActiveDOMObject | 75 class HTMLMediaElement : public HTMLElement, public WillBeHeapSupplementable<HTM
LMediaElement>, public MediaPlayerClient, public ActiveDOMObject |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 double volume() const; | 159 double volume() const; |
| 158 void setVolume(double, ExceptionState&); | 160 void setVolume(double, ExceptionState&); |
| 159 bool muted() const; | 161 bool muted() const; |
| 160 void setMuted(bool); | 162 void setMuted(bool); |
| 161 | 163 |
| 162 // play/pause toggling that uses the media controller if present. togglePlay
StateWillPlay() is | 164 // play/pause toggling that uses the media controller if present. togglePlay
StateWillPlay() is |
| 163 // true if togglePlayState() will call play() or unpause() on the media elem
ent or controller. | 165 // true if togglePlayState() will call play() or unpause() on the media elem
ent or controller. |
| 164 bool togglePlayStateWillPlay() const; | 166 bool togglePlayStateWillPlay() const; |
| 165 void togglePlayState(); | 167 void togglePlayState(); |
| 166 | 168 |
| 169 AudioTrackList& audioTracks(); |
| 170 void audioTrackChanged(const String& audioTrackID); |
| 171 |
| 172 VideoTrackList& videoTracks(); |
| 173 void selectedVideoTrackChanged(const String& selectedTrackID); |
| 174 |
| 167 PassRefPtrWillBeRawPtr<TextTrack> addTextTrack(const AtomicString& kind, con
st AtomicString& label, const AtomicString& language, ExceptionState&); | 175 PassRefPtrWillBeRawPtr<TextTrack> addTextTrack(const AtomicString& kind, con
st AtomicString& label, const AtomicString& language, ExceptionState&); |
| 168 PassRefPtrWillBeRawPtr<TextTrack> addTextTrack(const AtomicString& kind, con
st AtomicString& label, ExceptionState& exceptionState) { return addTextTrack(ki
nd, label, emptyAtom, exceptionState); } | 176 PassRefPtrWillBeRawPtr<TextTrack> addTextTrack(const AtomicString& kind, con
st AtomicString& label, ExceptionState& exceptionState) { return addTextTrack(ki
nd, label, emptyAtom, exceptionState); } |
| 169 PassRefPtrWillBeRawPtr<TextTrack> addTextTrack(const AtomicString& kind, Exc
eptionState& exceptionState) { return addTextTrack(kind, emptyAtom, emptyAtom, e
xceptionState); } | 177 PassRefPtrWillBeRawPtr<TextTrack> addTextTrack(const AtomicString& kind, Exc
eptionState& exceptionState) { return addTextTrack(kind, emptyAtom, emptyAtom, e
xceptionState); } |
| 170 | 178 |
| 171 TextTrackList* textTracks(); | 179 TextTrackList* textTracks(); |
| 172 CueList currentlyActiveCues() const { return m_currentlyActiveCues; } | 180 CueList currentlyActiveCues() const { return m_currentlyActiveCues; } |
| 173 | 181 |
| 174 void addTextTrack(TextTrack*); | 182 void addTextTrack(TextTrack*); |
| 175 void removeTextTrack(TextTrack*); | 183 void removeTextTrack(TextTrack*); |
| 176 void closeCaptionTracksChanged(); | 184 void closeCaptionTracksChanged(); |
| 177 void notifyMediaPlayerOfTextTrackChanges(); | 185 void notifyMediaPlayerOfTextTrackChanges(); |
| 178 | 186 |
| 179 // Implements the "forget the media element's media-resource-specific tracks
" algorithm in the HTML5 spec. | 187 // Implements the "forget the media element's media-resource-specific tracks
" algorithm in the HTML5 spec. |
| 180 void forgetResourceSpecificTracks(); | 188 void forgetResourceSpecificTracks(); |
| 181 | 189 |
| 182 void didAddTrackElement(HTMLTrackElement*); | 190 void didAddTrackElement(HTMLTrackElement*); |
| 183 void didRemoveTrackElement(HTMLTrackElement*); | 191 void didRemoveTrackElement(HTMLTrackElement*); |
| 184 | 192 |
| 193 void addAudioTrack(const String& id, blink::WebMediaPlayerClient::AudioTrack
Kind, const AtomicString& label, const AtomicString& language, bool enabled); |
| 194 void removeAudioTrack(const String& id); |
| 195 void addVideoTrack(const String& id, blink::WebMediaPlayerClient::VideoTrack
Kind, const AtomicString& label, const AtomicString& language, bool selected); |
| 196 void removeVideoTrack(const String& id); |
| 197 |
| 185 virtual void mediaPlayerDidAddTextTrack(blink::WebInbandTextTrack*) OVERRIDE
FINAL; | 198 virtual void mediaPlayerDidAddTextTrack(blink::WebInbandTextTrack*) OVERRIDE
FINAL; |
| 186 virtual void mediaPlayerDidRemoveTextTrack(blink::WebInbandTextTrack*) OVERR
IDE FINAL; | 199 virtual void mediaPlayerDidRemoveTextTrack(blink::WebInbandTextTrack*) OVERR
IDE FINAL; |
| 187 // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not d
epend on it. | 200 // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not d
epend on it. |
| 188 virtual KURL mediaPlayerPosterURL() OVERRIDE { return KURL(); } | 201 virtual KURL mediaPlayerPosterURL() OVERRIDE { return KURL(); } |
| 189 | 202 |
| 190 class TrackGroup { | 203 class TrackGroup { |
| 191 STACK_ALLOCATED(); | 204 STACK_ALLOCATED(); |
| 192 public: | 205 public: |
| 193 enum GroupKind { CaptionsAndSubtitles, Description, Chapter, Metadata, O
ther }; | 206 enum GroupKind { CaptionsAndSubtitles, Description, Chapter, Metadata, O
ther }; |
| 194 | 207 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 | 425 |
| 413 const AtomicString& mediaGroup() const; | 426 const AtomicString& mediaGroup() const; |
| 414 void setMediaGroup(const AtomicString&); | 427 void setMediaGroup(const AtomicString&); |
| 415 void updateMediaController(); | 428 void updateMediaController(); |
| 416 bool isBlocked() const; | 429 bool isBlocked() const; |
| 417 bool isBlockedOnMediaController() const; | 430 bool isBlockedOnMediaController() const; |
| 418 bool isAutoplaying() const { return m_autoplaying; } | 431 bool isAutoplaying() const { return m_autoplaying; } |
| 419 | 432 |
| 420 blink::WebMediaPlayer::CORSMode corsMode() const; | 433 blink::WebMediaPlayer::CORSMode corsMode() const; |
| 421 | 434 |
| 435 // Creates placeholder AudioTrack and/or VideoTrack objects when WebMemediaP
layer objects |
| 436 // advertise they have audio and/or video, but don't explicity signal them v
ia |
| 437 // mediaPlayerDidAddAudioTrack() and mediaPlayerDidAddVideoTrack(). |
| 438 // FIXME: Remove this once all WebMediaPlayer implementations properly repor
t their track info. |
| 439 void createPlaceholderTracksIfNecessary(); |
| 440 |
| 441 // Sets the selected/enabled tracks if they aren't set before we initially |
| 442 // transition to HAVE_METADATA. |
| 443 void selectInitialTracksIfNecessary(); |
| 444 |
| 445 void audioTracksTimerFired(Timer<HTMLMediaElement>*); |
| 446 |
| 422 Timer<HTMLMediaElement> m_loadTimer; | 447 Timer<HTMLMediaElement> m_loadTimer; |
| 423 Timer<HTMLMediaElement> m_progressEventTimer; | 448 Timer<HTMLMediaElement> m_progressEventTimer; |
| 424 Timer<HTMLMediaElement> m_playbackProgressTimer; | 449 Timer<HTMLMediaElement> m_playbackProgressTimer; |
| 450 Timer<HTMLMediaElement> m_audioTracksTimer; |
| 425 RefPtr<TimeRanges> m_playedTimeRanges; | 451 RefPtr<TimeRanges> m_playedTimeRanges; |
| 426 OwnPtr<GenericEventQueue> m_asyncEventQueue; | 452 OwnPtr<GenericEventQueue> m_asyncEventQueue; |
| 427 | 453 |
| 428 double m_playbackRate; | 454 double m_playbackRate; |
| 429 double m_defaultPlaybackRate; | 455 double m_defaultPlaybackRate; |
| 430 NetworkState m_networkState; | 456 NetworkState m_networkState; |
| 431 ReadyState m_readyState; | 457 ReadyState m_readyState; |
| 432 ReadyState m_readyStateMaximum; | 458 ReadyState m_readyStateMaximum; |
| 433 KURL m_currentSrc; | 459 KURL m_currentSrc; |
| 434 | 460 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 | 522 |
| 497 bool m_completelyLoaded : 1; | 523 bool m_completelyLoaded : 1; |
| 498 bool m_havePreparedToPlay : 1; | 524 bool m_havePreparedToPlay : 1; |
| 499 bool m_delayingLoadForPreloadNone : 1; | 525 bool m_delayingLoadForPreloadNone : 1; |
| 500 | 526 |
| 501 bool m_tracksAreReady : 1; | 527 bool m_tracksAreReady : 1; |
| 502 bool m_haveVisibleTextTrack : 1; | 528 bool m_haveVisibleTextTrack : 1; |
| 503 bool m_processingPreferenceChange : 1; | 529 bool m_processingPreferenceChange : 1; |
| 504 double m_lastTextTrackUpdateTime; | 530 double m_lastTextTrackUpdateTime; |
| 505 | 531 |
| 532 RefPtr<AudioTrackList> m_audioTracks; |
| 533 RefPtr<VideoTrackList> m_videoTracks; |
| 506 RefPtrWillBeMember<TextTrackList> m_textTracks; | 534 RefPtrWillBeMember<TextTrackList> m_textTracks; |
| 507 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_textTracksWhenResourceSel
ectionBegan; | 535 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_textTracksWhenResourceSel
ectionBegan; |
| 508 | 536 |
| 509 CueIntervalTree m_cueTree; | 537 CueIntervalTree m_cueTree; |
| 510 | 538 |
| 511 CueList m_currentlyActiveCues; | 539 CueList m_currentlyActiveCues; |
| 512 int m_ignoreTrackDisplayUpdate; | 540 int m_ignoreTrackDisplayUpdate; |
| 513 | 541 |
| 514 #if ENABLE(WEB_AUDIO) | 542 #if ENABLE(WEB_AUDIO) |
| 515 // This is a weak reference, since m_audioSourceNode holds a reference to us
. | 543 // This is a weak reference, since m_audioSourceNode holds a reference to us
. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 inline bool isHTMLMediaElement(const HTMLElement& element) | 580 inline bool isHTMLMediaElement(const HTMLElement& element) |
| 553 { | 581 { |
| 554 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 582 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
| 555 } | 583 } |
| 556 | 584 |
| 557 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 585 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
| 558 | 586 |
| 559 } //namespace | 587 } //namespace |
| 560 | 588 |
| 561 #endif | 589 #endif |
| OLD | NEW |