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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2684103005: Allow media track switching. (Closed)
Patch Set: Fixed comments Created 3 years, 8 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 | « media/base/video_renderer.h ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 1673e039c862f2d48686e2b17dcfd60f9ec56d00..055754169443b2f01ce6c66554ed5813c22cfd22 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -1021,20 +1021,25 @@ void WebMediaPlayerImpl::OnFFmpegMediaTracksUpdated(
DCHECK(demuxer_.get());
DCHECK(!chunk_demuxer_);
- // Report the media track information to blink.
+ // Report the media track information to blink. Only the first audio track and
+ // the first video track are enabled by default to match blink logic.
+ bool is_first_audio_track = true;
+ bool is_first_video_track = true;
for (const auto& track : tracks->tracks()) {
if (track->type() == MediaTrack::Audio) {
client_->AddAudioTrack(blink::WebString::FromUTF8(track->id()),
blink::WebMediaPlayerClient::kAudioTrackKindMain,
blink::WebString::FromUTF8(track->label()),
blink::WebString::FromUTF8(track->language()),
- /*enabled*/ true);
+ is_first_audio_track);
+ is_first_audio_track = false;
} else if (track->type() == MediaTrack::Video) {
client_->AddVideoTrack(blink::WebString::FromUTF8(track->id()),
blink::WebMediaPlayerClient::kVideoTrackKindMain,
blink::WebString::FromUTF8(track->label()),
blink::WebString::FromUTF8(track->language()),
- /*selected*/ true);
+ is_first_video_track);
+ is_first_video_track = false;
} else {
// Text tracks are not supported through this code path yet.
NOTREACHED();
« no previous file with comments | « media/base/video_renderer.h ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698