Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2619)

Unified Diff: content/renderer/render_view_impl.cc

Issue 10382048: create WebMediaPlayer based on URL (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | webkit/media/media_stream_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
===================================================================
--- content/renderer/render_view_impl.cc (revision 135772)
+++ content/renderer/render_view_impl.cc (working copy)
@@ -173,6 +173,7 @@
#include "webkit/glue/weburlresponse_extradata_impl.h"
#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
#include "webkit/media/webmediaplayer_impl.h"
+#include "webkit/media/webmediaplayer_ms.h"
#include "webkit/plugins/npapi/plugin_list.h"
#include "webkit/plugins/npapi/webplugin_delegate.h"
#include "webkit/plugins/npapi/webplugin_delegate_impl.h"
@@ -2199,7 +2200,7 @@
}
WebMediaPlayer* RenderViewImpl::createMediaPlayer(
- WebFrame* frame, WebMediaPlayerClient* client) {
+ WebFrame* frame, WebMediaPlayerClient* client, const WebURL& url) {
FOR_EACH_OBSERVER(
RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client));
@@ -2256,14 +2257,20 @@
}
#endif
- webkit_media::WebMediaPlayerImpl* media_player =
+ WebMediaPlayer* media_player =
content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer(
this, frame, client, AsWeakPtr(), collection, audio_source_provider,
message_loop_factory, media_stream_impl_, render_media_log);
if (!media_player) {
- media_player = new webkit_media::WebMediaPlayerImpl(
- frame, client, AsWeakPtr(), collection, audio_source_provider,
- message_loop_factory, media_stream_impl_, render_media_log);
+ if (media_stream_impl_ && media_stream_impl_->IsMediaStream(url)) {
+ media_player = new webkit_media::WebMediaPlayerMS(
+ frame, client, AsWeakPtr(),
+ message_loop_factory, media_stream_impl_, render_media_log);
+ } else {
+ media_player = new webkit_media::WebMediaPlayerImpl(
+ frame, client, AsWeakPtr(), collection, audio_source_provider,
+ message_loop_factory, media_stream_impl_, render_media_log);
+ }
}
return media_player;
}
@@ -3748,7 +3755,7 @@
return &cookie_jar_;
}
-void RenderViewImpl::DidPlay(webkit_media::WebMediaPlayerImpl* player) {
+void RenderViewImpl::DidPlay(WebKit::WebMediaPlayer* player) {
Send(new ViewHostMsg_MediaNotification(routing_id_,
reinterpret_cast<int64>(player),
player->hasVideo(),
@@ -3756,7 +3763,7 @@
true));
}
-void RenderViewImpl::DidPause(webkit_media::WebMediaPlayerImpl* player) {
+void RenderViewImpl::DidPause(WebKit::WebMediaPlayer* player) {
Send(new ViewHostMsg_MediaNotification(routing_id_,
reinterpret_cast<int64>(player),
player->hasVideo(),
@@ -3764,7 +3771,7 @@
false));
}
-void RenderViewImpl::PlayerGone(webkit_media::WebMediaPlayerImpl* player) {
+void RenderViewImpl::PlayerGone(WebKit::WebMediaPlayer* player) {
DidPause(player);
}
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | webkit/media/media_stream_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698