| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 enum LoadType { | 98 enum LoadType { |
| 99 LoadTypeURL = 0, | 99 LoadTypeURL = 0, |
| 100 LoadTypeMediaSource = 1, | 100 LoadTypeMediaSource = 1, |
| 101 LoadTypeMediaStream = 2, | 101 LoadTypeMediaStream = 2, |
| 102 LoadTypeMax = LoadTypeMediaStream, | 102 LoadTypeMax = LoadTypeMediaStream, |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 typedef WebString TrackId; | 105 typedef WebString TrackId; |
| 106 enum TrackType { TextTrack, AudioTrack, VideoTrack }; | 106 enum TrackType { TextTrack, AudioTrack, VideoTrack }; |
| 107 | 107 |
| 108 // Overlay fullscreen video can work in these modes. VideoLayerVisible will |
| 109 // leave the contents of the GraphicsLayer associated with the video element |
| 110 // visible, whereas VideoLayerInvisible will hide it so that only the |
| 111 // controls are visible. |
| 112 enum class OverlayFullscreenVideoMode { |
| 113 Disabled, |
| 114 VideoLayerVisible, |
| 115 VideoLayerInvisible, |
| 116 }; |
| 117 |
| 108 virtual ~WebMediaPlayer() { } | 118 virtual ~WebMediaPlayer() { } |
| 109 | 119 |
| 110 virtual void load(LoadType, const WebMediaPlayerSource&, CORSMode) = 0; | 120 virtual void load(LoadType, const WebMediaPlayerSource&, CORSMode) = 0; |
| 111 | 121 |
| 112 // Playback controls. | 122 // Playback controls. |
| 113 virtual void play() = 0; | 123 virtual void play() = 0; |
| 114 virtual void pause() = 0; | 124 virtual void pause() = 0; |
| 115 virtual bool supportsSave() const = 0; | 125 virtual bool supportsSave() const = 0; |
| 116 virtual void seek(double seconds) = 0; | 126 virtual void seek(double seconds) = 0; |
| 117 virtual void setRate(double) = 0; | 127 virtual void setRate(double) = 0; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 unsigned texture, int level, int xoffset, int yoffset, bool premultiplyA
lpha, | 191 unsigned texture, int level, int xoffset, int yoffset, bool premultiplyA
lpha, |
| 182 bool flipY) { return false; } | 192 bool flipY) { return false; } |
| 183 | 193 |
| 184 virtual WebAudioSourceProvider* getAudioSourceProvider() { return nullptr; } | 194 virtual WebAudioSourceProvider* getAudioSourceProvider() { return nullptr; } |
| 185 | 195 |
| 186 virtual void setContentDecryptionModule(WebContentDecryptionModule* cdm, Web
ContentDecryptionModuleResult result) { result.completeWithError(WebContentDecry
ptionModuleExceptionNotSupportedError, 0, "ERROR"); } | 196 virtual void setContentDecryptionModule(WebContentDecryptionModule* cdm, Web
ContentDecryptionModuleResult result) { result.completeWithError(WebContentDecry
ptionModuleExceptionNotSupportedError, 0, "ERROR"); } |
| 187 | 197 |
| 188 // Sets the poster image URL. | 198 // Sets the poster image URL. |
| 189 virtual void setPoster(const WebURL& poster) { } | 199 virtual void setPoster(const WebURL& poster) { } |
| 190 | 200 |
| 191 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When | 201 // Which OverlayFullscreenVideoMode should be used in fullscren. |
| 192 // this is true, the video layer will be removed from the layer tree when | 202 virtual OverlayFullscreenVideoMode getOverlayFullscreenVideoMode() { return
OverlayFullscreenVideoMode::Disabled; } |
| 193 // entering fullscreen, and the WebMediaPlayer is responsible for displaying | |
| 194 // the video in enteredFullscreen(). | |
| 195 virtual bool supportsOverlayFullscreenVideo() { return false; } | |
| 196 // Inform WebMediaPlayer when the element has entered/exited fullscreen. | 203 // Inform WebMediaPlayer when the element has entered/exited fullscreen. |
| 197 virtual void enteredFullscreen() { } | 204 virtual void enteredFullscreen() { } |
| 198 virtual void exitedFullscreen() { } | 205 virtual void exitedFullscreen() { } |
| 199 | 206 |
| 200 virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrac
kIds) { } | 207 virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrac
kIds) { } |
| 201 // |selectedTrackId| is null if no track is selected. | 208 // |selectedTrackId| is null if no track is selected. |
| 202 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { } | 209 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { } |
| 203 }; | 210 }; |
| 204 | 211 |
| 205 } // namespace blink | 212 } // namespace blink |
| 206 | 213 |
| 207 #endif | 214 #endif |
| OLD | NEW |