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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 #if ENABLE(WEB_AUDIO) | 269 #if ENABLE(WEB_AUDIO) |
270 MediaElementAudioSourceNode* audioSourceNode() { return m_audioSourceNode; } | 270 MediaElementAudioSourceNode* audioSourceNode() { return m_audioSourceNode; } |
271 void setAudioSourceNode(MediaElementAudioSourceNode*); | 271 void setAudioSourceNode(MediaElementAudioSourceNode*); |
272 | 272 |
273 AudioSourceProvider* audioSourceProvider(); | 273 AudioSourceProvider* audioSourceProvider(); |
274 #endif | 274 #endif |
275 | 275 |
276 enum InvalidURLAction { DoNothing, Complain }; | 276 enum InvalidURLAction { DoNothing, Complain }; |
277 bool isSafeToLoadURL(const KURL&, InvalidURLAction); | 277 bool isSafeToLoadURL(const KURL&, InvalidURLAction); |
278 | 278 |
279 const String& mediaGroup() const; | |
280 void setMediaGroup(const String&); | |
281 | |
282 MediaController* controller() const; | 279 MediaController* controller() const; |
283 void setController(PassRefPtr<MediaController>); | 280 void setController(PassRefPtr<MediaController>); // Resets the MediaGroup an
d sets the MediaController. |
284 | 281 |
285 protected: | 282 protected: |
286 HTMLMediaElement(const QualifiedName&, Document&, bool); | 283 HTMLMediaElement(const QualifiedName&, Document&, bool); |
287 virtual ~HTMLMediaElement(); | 284 virtual ~HTMLMediaElement(); |
288 | 285 |
289 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 286 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
290 virtual void finishParsingChildren() OVERRIDE; | 287 virtual void finishParsingChildren() OVERRIDE; |
291 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; | 288 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; |
292 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; | 289 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; |
293 | 290 |
294 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; | 291 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; |
295 | 292 |
296 enum DisplayMode { Unknown, None, Poster, PosterWaitingForVideo, Video }; | 293 enum DisplayMode { Unknown, None, Poster, PosterWaitingForVideo, Video }; |
297 DisplayMode displayMode() const { return m_displayMode; } | 294 DisplayMode displayMode() const { return m_displayMode; } |
298 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } | 295 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } |
299 | 296 |
300 virtual bool isMediaElement() const OVERRIDE { return true; } | 297 virtual bool isMediaElement() const OVERRIDE { return true; } |
301 | 298 |
| 299 void setControllerInternal(PassRefPtr<MediaController>); |
| 300 |
302 // Restrictions to change default behaviors. | 301 // Restrictions to change default behaviors. |
303 enum BehaviorRestrictionFlags { | 302 enum BehaviorRestrictionFlags { |
304 NoRestrictions = 0, | 303 NoRestrictions = 0, |
305 RequireUserGestureForLoadRestriction = 1 << 0, | 304 RequireUserGestureForLoadRestriction = 1 << 0, |
306 RequireUserGestureForRateChangeRestriction = 1 << 1, | 305 RequireUserGestureForRateChangeRestriction = 1 << 1, |
307 RequireUserGestureForFullscreenRestriction = 1 << 2, | 306 RequireUserGestureForFullscreenRestriction = 1 << 2, |
308 RequirePageConsentToLoadMediaRestriction = 1 << 3, | 307 RequirePageConsentToLoadMediaRestriction = 1 << 3, |
309 }; | 308 }; |
310 typedef unsigned BehaviorRestrictions; | 309 typedef unsigned BehaviorRestrictions; |
311 | 310 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 | 444 |
446 void prepareMediaFragmentURI(); | 445 void prepareMediaFragmentURI(); |
447 void applyMediaFragmentURI(); | 446 void applyMediaFragmentURI(); |
448 | 447 |
449 virtual void* preDispatchEventHandler(Event*) OVERRIDE; | 448 virtual void* preDispatchEventHandler(Event*) OVERRIDE; |
450 | 449 |
451 void changeNetworkStateFromLoadingToIdle(); | 450 void changeNetworkStateFromLoadingToIdle(); |
452 | 451 |
453 void removeBehaviorsRestrictionsAfterFirstUserGesture(); | 452 void removeBehaviorsRestrictionsAfterFirstUserGesture(); |
454 | 453 |
| 454 const AtomicString& mediaGroup() const; |
| 455 void setMediaGroup(const AtomicString&); |
455 void updateMediaController(); | 456 void updateMediaController(); |
456 bool isBlocked() const; | 457 bool isBlocked() const; |
457 bool isBlockedOnMediaController() const; | 458 bool isBlockedOnMediaController() const; |
458 bool hasCurrentSrc() const { return !m_currentSrc.isEmpty(); } | 459 bool hasCurrentSrc() const { return !m_currentSrc.isEmpty(); } |
459 bool isAutoplaying() const { return m_autoplaying; } | 460 bool isAutoplaying() const { return m_autoplaying; } |
460 | 461 |
461 Timer<HTMLMediaElement> m_loadTimer; | 462 Timer<HTMLMediaElement> m_loadTimer; |
462 Timer<HTMLMediaElement> m_progressEventTimer; | 463 Timer<HTMLMediaElement> m_progressEventTimer; |
463 Timer<HTMLMediaElement> m_playbackProgressTimer; | 464 Timer<HTMLMediaElement> m_playbackProgressTimer; |
464 RefPtr<TimeRanges> m_playedTimeRanges; | 465 RefPtr<TimeRanges> m_playedTimeRanges; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 CueList m_currentlyActiveCues; | 553 CueList m_currentlyActiveCues; |
553 int m_ignoreTrackDisplayUpdate; | 554 int m_ignoreTrackDisplayUpdate; |
554 | 555 |
555 #if ENABLE(WEB_AUDIO) | 556 #if ENABLE(WEB_AUDIO) |
556 // This is a weak reference, since m_audioSourceNode holds a reference to us
. | 557 // This is a weak reference, since m_audioSourceNode holds a reference to us
. |
557 // The value is set just after the MediaElementAudioSourceNode is created. | 558 // The value is set just after the MediaElementAudioSourceNode is created. |
558 // The value is cleared in MediaElementAudioSourceNode::~MediaElementAudioSo
urceNode(). | 559 // The value is cleared in MediaElementAudioSourceNode::~MediaElementAudioSo
urceNode(). |
559 MediaElementAudioSourceNode* m_audioSourceNode; | 560 MediaElementAudioSourceNode* m_audioSourceNode; |
560 #endif | 561 #endif |
561 | 562 |
562 String m_mediaGroup; | |
563 friend class MediaController; | 563 friend class MediaController; |
564 RefPtr<MediaController> m_mediaController; | 564 RefPtr<MediaController> m_mediaController; |
565 | 565 |
566 friend class TrackDisplayUpdateScope; | 566 friend class TrackDisplayUpdateScope; |
567 | 567 |
568 #if ENABLE(ENCRYPTED_MEDIA_V2) | 568 #if ENABLE(ENCRYPTED_MEDIA_V2) |
569 RefPtr<MediaKeys> m_mediaKeys; | 569 RefPtr<MediaKeys> m_mediaKeys; |
570 #endif | 570 #endif |
571 }; | 571 }; |
572 | 572 |
(...skipping 24 matching lines...) Expand all Loading... |
597 inline bool isHTMLMediaElement(const Node& node) | 597 inline bool isHTMLMediaElement(const Node& node) |
598 { | 598 { |
599 return node.isElementNode() && toElement(node).isMediaElement(); | 599 return node.isElementNode() && toElement(node).isMediaElement(); |
600 } | 600 } |
601 | 601 |
602 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 602 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
603 | 603 |
604 } //namespace | 604 } //namespace |
605 | 605 |
606 #endif | 606 #endif |
OLD | NEW |