| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "webkit/media/android/webmediaplayer_android.h" | 5 #include "webkit/media/android/webmediaplayer_android.h" | 
| 6 | 6 | 
| 7 #include <string> | 7 #include <string> | 
| 8 | 8 | 
| 9 #include "base/bind.h" | 9 #include "base/bind.h" | 
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" | 
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 92   } | 92   } | 
| 93 | 93 | 
| 94   manager_->UnregisterMediaPlayer(player_id_); | 94   manager_->UnregisterMediaPlayer(player_id_); | 
| 95 } | 95 } | 
| 96 | 96 | 
| 97 void WebMediaPlayerAndroid::InitIncognito(bool incognito_mode) { | 97 void WebMediaPlayerAndroid::InitIncognito(bool incognito_mode) { | 
| 98   incognito_mode_ = incognito_mode; | 98   incognito_mode_ = incognito_mode; | 
| 99 } | 99 } | 
| 100 | 100 | 
| 101 void WebMediaPlayerAndroid::load(const WebURL& url) { | 101 void WebMediaPlayerAndroid::load(const WebURL& url) { | 
|  | 102   load(url, CORSModeUnspecified); | 
|  | 103 } | 
|  | 104 | 
|  | 105 void WebMediaPlayerAndroid::load(const WebURL& url, CORSMode cors_mode) { | 
|  | 106   if (cors_mode != CORSModeUnspecified) | 
|  | 107     NOTIMPLEMENTED() << "No CORS support"; | 
|  | 108 | 
| 102   url_ = url; | 109   url_ = url; | 
| 103 | 110 | 
| 104   UpdateNetworkState(WebMediaPlayer::NetworkStateLoading); | 111   UpdateNetworkState(WebMediaPlayer::NetworkStateLoading); | 
| 105   UpdateReadyState(WebMediaPlayer::ReadyStateHaveNothing); | 112   UpdateReadyState(WebMediaPlayer::ReadyStateHaveNothing); | 
| 106 | 113 | 
| 107   // Calling InitializeMediaPlayer() will cause android mediaplayer to start | 114   // Calling InitializeMediaPlayer() will cause android mediaplayer to start | 
| 108   // buffering and decoding the data. On mobile devices, this costs a lot of | 115   // buffering and decoding the data. On mobile devices, this costs a lot of | 
| 109   // data usage and could even introduce performance issues. So we don't | 116   // data usage and could even introduce performance issues. So we don't | 
| 110   // initialize the player unless it is a local file. We will start loading | 117   // initialize the player unless it is a local file. We will start loading | 
| 111   // the media only when play/seek/fullsceen button is clicked. | 118   // the media only when play/seek/fullsceen button is clicked. | 
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 562 } | 569 } | 
| 563 | 570 | 
| 564 // This gets called both on compositor and main thread. | 571 // This gets called both on compositor and main thread. | 
| 565 void WebMediaPlayerAndroid::setStreamTextureClient( | 572 void WebMediaPlayerAndroid::setStreamTextureClient( | 
| 566     WebKit::WebStreamTextureClient* client) { | 573     WebKit::WebStreamTextureClient* client) { | 
| 567   if (stream_texture_proxy_.get()) | 574   if (stream_texture_proxy_.get()) | 
| 568     stream_texture_proxy_->SetClient(client); | 575     stream_texture_proxy_->SetClient(client); | 
| 569 } | 576 } | 
| 570 | 577 | 
| 571 }  // namespace webkit_media | 578 }  // namespace webkit_media | 
| OLD | NEW | 
|---|