| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | |
| 3 * | |
| 4 * Redistribution and use in source and binary forms, with or without | |
| 5 * modification, are permitted provided that the following conditions | |
| 6 * are met: | |
| 7 * 1. Redistributions of source code must retain the above copyright | |
| 8 * notice, this list of conditions and the following disclaimer. | |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | |
| 10 * notice, this list of conditions and the following disclaimer in the | |
| 11 * documentation and/or other materials provided with the distribution. | |
| 12 * | |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 24 */ | |
| 25 | |
| 26 #ifndef MediaPlayer_h | |
| 27 #define MediaPlayer_h | |
| 28 | |
| 29 #include "public/platform/WebMediaPlayer.h" | |
| 30 #include "wtf/Forward.h" | |
| 31 #include "wtf/Noncopyable.h" | |
| 32 | |
| 33 namespace blink { | |
| 34 | |
| 35 class AudioSourceProvider; | |
| 36 class KURL; | |
| 37 class MediaPlayer; | |
| 38 class WebInbandTextTrack; | |
| 39 class WebLayer; | |
| 40 class WebMediaSource; | |
| 41 | |
| 42 class PLATFORM_EXPORT MediaPlayerClient { | |
| 43 public: | |
| 44 MediaPlayerClient() { } | |
| 45 virtual ~MediaPlayerClient() { } | |
| 46 | |
| 47 // the network state has changed | |
| 48 virtual void mediaPlayerNetworkStateChanged() = 0; | |
| 49 | |
| 50 // the ready state has changed | |
| 51 virtual void mediaPlayerReadyStateChanged() = 0; | |
| 52 | |
| 53 // time has jumped, eg. not as a result of normal playback | |
| 54 virtual void mediaPlayerTimeChanged() = 0; | |
| 55 | |
| 56 // the media file duration has changed, or is now known | |
| 57 virtual void mediaPlayerDurationChanged() = 0; | |
| 58 | |
| 59 // the play/pause status changed | |
| 60 virtual void mediaPlayerPlaybackStateChanged() = 0; | |
| 61 | |
| 62 virtual void mediaPlayerRequestFullscreen() = 0; | |
| 63 | |
| 64 virtual void mediaPlayerRequestSeek(double) = 0; | |
| 65 | |
| 66 // The URL for video poster image. | |
| 67 // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not d
epend on it. | |
| 68 virtual KURL mediaPlayerPosterURL() = 0; | |
| 69 | |
| 70 // Presentation-related methods | |
| 71 // a new frame of video is available | |
| 72 virtual void mediaPlayerRepaint() = 0; | |
| 73 | |
| 74 // the movie size has changed | |
| 75 virtual void mediaPlayerSizeChanged() = 0; | |
| 76 | |
| 77 virtual void mediaPlayerSetWebLayer(WebLayer*) = 0; | |
| 78 | |
| 79 virtual void mediaPlayerDidAddTextTrack(WebInbandTextTrack*) = 0; | |
| 80 virtual void mediaPlayerDidRemoveTextTrack(WebInbandTextTrack*) = 0; | |
| 81 | |
| 82 virtual void mediaPlayerMediaSourceOpened(WebMediaSource*) = 0; | |
| 83 }; | |
| 84 | |
| 85 typedef PassOwnPtr<MediaPlayer> (*CreateMediaEnginePlayer)(MediaPlayerClient*); | |
| 86 | |
| 87 class PLATFORM_EXPORT MediaPlayer { | |
| 88 WTF_MAKE_NONCOPYABLE(MediaPlayer); | |
| 89 public: | |
| 90 static PassOwnPtr<MediaPlayer> create(MediaPlayerClient*); | |
| 91 static void setMediaEngineCreateFunction(CreateMediaEnginePlayer); | |
| 92 | |
| 93 MediaPlayer() { } | |
| 94 virtual ~MediaPlayer() { } | |
| 95 | |
| 96 virtual void load(WebMediaPlayer::LoadType, const String& url, WebMediaPlaye
r::CORSMode) = 0; | |
| 97 | |
| 98 enum Preload { None, MetaData, Auto }; | |
| 99 virtual void setPreload(Preload) = 0; | |
| 100 | |
| 101 #if ENABLE(WEB_AUDIO) | |
| 102 virtual AudioSourceProvider* audioSourceProvider() = 0; | |
| 103 #endif | |
| 104 virtual WebMediaPlayer* webMediaPlayer() const = 0; | |
| 105 }; | |
| 106 | |
| 107 } // namespace blink | |
| 108 | |
| 109 #endif // MediaPlayer_h | |
| OLD | NEW |