Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| index 4b0c964be78172ce5cc7eae3c9642c835a39a006..5889a8f795c07f25f1ac9d8627c0aa344c51fb03 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| @@ -2408,14 +2408,15 @@ AudioTrackList& HTMLMediaElement::audioTracks() |
| return *m_audioTracks; |
| } |
| -void HTMLMediaElement::audioTrackChanged(WebMediaPlayer::TrackId trackId, bool enabled) |
| +void HTMLMediaElement::audioTrackChanged(AudioTrack* track) |
| { |
| - BLINK_MEDIA_LOG << "audioTrackChanged(" << (void*)this << ") trackId= " << String(trackId) << " enabled=" << boolString(enabled); |
| + BLINK_MEDIA_LOG << "audioTrackChanged(" << (void*)this << ") trackId= " << String(track->id()) << " enabled=" << boolString(track->enabled()); |
| DCHECK(RuntimeEnabledFeatures::audioVideoTracksEnabled()); |
| audioTracks().scheduleChangeEvent(); |
| - // FIXME: Add call on m_mediaSource to notify it of track changes once the SourceBuffer.audioTracks attribute is added. |
| + if (m_mediaSource) |
| + m_mediaSource->onTrackChanged(track); |
| if (!m_audioTracksTimer.isActive()) |
| m_audioTracksTimer.startOneShot(0, BLINK_FROM_HERE); |
| @@ -2464,17 +2465,21 @@ VideoTrackList& HTMLMediaElement::videoTracks() |
| return *m_videoTracks; |
| } |
| -void HTMLMediaElement::selectedVideoTrackChanged(WebMediaPlayer::TrackId* selectedTrackId) |
| +void HTMLMediaElement::selectedVideoTrackChanged(VideoTrack* track) |
| { |
| - BLINK_MEDIA_LOG << "selectedVideoTrackChanged(" << (void*)this << ") selectedTrackId=" << (selectedTrackId ? String(*selectedTrackId) : "none"); |
| + BLINK_MEDIA_LOG << "selectedVideoTrackChanged(" << (void*)this << ") selectedTrackId=" << (track->selected() ? String(track->id()) : "none"); |
| DCHECK(RuntimeEnabledFeatures::audioVideoTracksEnabled()); |
| - if (selectedTrackId) |
| - videoTracks().trackSelected(*selectedTrackId); |
| + if (track->selected()) |
| + videoTracks().trackSelected(track->id()); |
| + |
| + videoTracks().scheduleChangeEvent(); |
| - // FIXME: Add call on m_mediaSource to notify it of track changes once the SourceBuffer.videoTracks attribute is added. |
| + if (m_mediaSource) |
| + m_mediaSource->onTrackChanged(track); |
| - webMediaPlayer()->selectedVideoTrackChanged(selectedTrackId); |
| + WebMediaPlayer::TrackId id = track->id(); |
| + webMediaPlayer()->selectedVideoTrackChanged(track->selected() ? &id : nullptr); |
|
mlamouri (slow - plz ping)
2016/08/24 16:08:46
Should you pass `&track->id()` instead of making a
servolk
2016/08/25 00:50:18
No, that causes an error:
../../third_party/WebKit
|
| } |
| WebMediaPlayer::TrackId HTMLMediaElement::addVideoTrack(const WebString& id, WebMediaPlayerClient::VideoTrackKind kind, const WebString& label, const WebString& language, bool selected) |