| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 // This class implements blink::WebMediaPlayer by keeping the android | 77 // This class implements blink::WebMediaPlayer by keeping the android |
| 78 // media player in the browser process. It listens to all the status changes | 78 // media player in the browser process. It listens to all the status changes |
| 79 // sent from the browser process and sends playback controls to the media | 79 // sent from the browser process and sends playback controls to the media |
| 80 // player. | 80 // player. |
| 81 class WebMediaPlayerAndroid : public blink::WebMediaPlayer, | 81 class WebMediaPlayerAndroid : public blink::WebMediaPlayer, |
| 82 public cc::VideoFrameProvider, | 82 public cc::VideoFrameProvider, |
| 83 public RenderFrameObserver, | 83 public RenderFrameObserver, |
| 84 public StreamTextureFactoryContextObserver { | 84 public StreamTextureFactoryContextObserver { |
| 85 public: | 85 public: |
| 86 // Test whether the path of a URL ends with ".m3u8". |
| 87 static bool IsHLSURL(const GURL& url); |
| 88 |
| 89 // Test whether a URL contains "m3u8". (Using exactly the same logic as |
| 90 // NuPlayer does to determine if a stream is HLS.) |
| 91 static bool IsHLSPath(const GURL& url); |
| 92 |
| 86 // Construct a WebMediaPlayerAndroid object. This class communicates with the | 93 // Construct a WebMediaPlayerAndroid object. This class communicates with the |
| 87 // MediaPlayerAndroid object in the browser process through |proxy|. | 94 // MediaPlayerAndroid object in the browser process through |proxy|. |
| 88 // TODO(qinmin): |frame| argument is used to determine whether the current | 95 // TODO(qinmin): |frame| argument is used to determine whether the current |
| 89 // player can enter fullscreen. This logic should probably be moved into | 96 // player can enter fullscreen. This logic should probably be moved into |
| 90 // blink, so that enterFullscreen() will not be called if another video is | 97 // blink, so that enterFullscreen() will not be called if another video is |
| 91 // already in fullscreen. | 98 // already in fullscreen. |
| 92 WebMediaPlayerAndroid( | 99 WebMediaPlayerAndroid( |
| 93 blink::WebFrame* frame, | 100 blink::WebFrame* frame, |
| 94 blink::WebMediaPlayerClient* client, | 101 blink::WebMediaPlayerClient* client, |
| 95 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, | 102 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 546 |
| 540 // NOTE: Weak pointers must be invalidated before all other member variables. | 547 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 541 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 548 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
| 542 | 549 |
| 543 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 550 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
| 544 }; | 551 }; |
| 545 | 552 |
| 546 } // namespace content | 553 } // namespace content |
| 547 | 554 |
| 548 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 555 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| OLD | NEW |