Re: Issue 110938 in chromium: video.onloadedmetadata event doesn't fire when setting video.src to LocalMediaStream blob url

142 views
Skip to first unread message

chro...@googlecode.com

unread,
Jul 30, 2012, 6:22:36 AM7/30/12
to chromi...@chromium.org

Comment #4 on issue 110938 by ser...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

ping wija. Could you take a look?

chro...@googlecode.com

unread,
Jul 30, 2012, 10:34:45 AM7/30/12
to chromi...@chromium.org

Comment #5 on issue 110938 by w...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

I will look into this after I am done with device monitoring.

chro...@googlecode.com

unread,
Sep 24, 2012, 10:04:07 PM9/24/12
to chromi...@chromium.org

Comment #6 on issue 110938 by bugdro...@chromium.org:
video.onloadedmetadata event doesn't fire when setting video.src to
LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938#c6

The following revision refers to this bug:
http://src.chromium.org/viewvc/chrome?view=rev&revision=158490

------------------------------------------------------------------------
r158490 | wj...@chromium.org | 2012-09-25T01:28:39.396472Z

Changed paths:
M
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/support/webkit_support.cc?r1=158490&r2=158489&pathrev=158490
M
http://src.chromium.org/viewvc/chrome/trunk/src/media/video/capture/video_capture.h?r1=158490&r2=158489&pathrev=158490
M
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/support/test_media_stream_client.cc?r1=158490&r2=158489&pathrev=158490
M
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/support/test_media_stream_client.h?r1=158490&r2=158489&pathrev=158490
M
http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/render_process_host_impl.cc?r1=158490&r2=158489&pathrev=158490
A
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/media/webmediaplayer_ms.cc?r1=158490&r2=158489&pathrev=158490
M
http://src.chromium.org/viewvc/chrome/trunk/src/content/content_renderer.gypi?r1=158490&r2=158489&pathrev=158490
M
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/media/media_stream_client.h?r1=158490&r2=158489&pathrev=158490
A
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/media/video_frame_provider.cc?r1=158490&r2=158489&pathrev=158490
A
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/media/webmediaplayer_ms.h?r1=158490&r2=158489&pathrev=158490
A
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/media/video_frame_provider.h?r1=158490&r2=158489&pathrev=158490
A
http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/media/local_video_capture.cc?r1=158490&r2=158489&pathrev=158490
M
http://src.chromium.org/viewvc/chrome/trunk/src/content/public/common/content_switches.cc?r1=158490&r2=158489&pathrev=158490
A
http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/media/rtc_video_renderer.cc?r1=158490&r2=158489&pathrev=158490
A
http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/media/local_video_capture.h?r1=158490&r2=158489&pathrev=158490
A
http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/media/rtc_video_renderer.h?r1=158490&r2=158489&pathrev=158490
M
http://src.chromium.org/viewvc/chrome/trunk/src/content/public/common/content_switches.h?r1=158490&r2=158489&pathrev=158490
A
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/media/simple_video_frame_provider.cc?r1=158490&r2=158489&pathrev=158490
A
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/media/simple_video_frame_provider.h?r1=158490&r2=158489&pathrev=158490
M
http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/render_view_impl.cc?r1=158490&r2=158489&pathrev=158490
M
http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/media/media_stream_impl.cc?r1=158490&r2=158489&pathrev=158490
M
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/media/webkit_media.gypi?r1=158490&r2=158489&pathrev=158490
M
http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/media/media_stream_impl.h?r1=158490&r2=158489&pathrev=158490

create a separate WebMediaPlayer for URL derived from media stream
When the "src" of <video> is derived from media stream, WebMediaPlayerMS is
created.
Its real time charateristics allows it to simplify some controls in
WebMediaPlayer, e.g., no buffering, no preload, etc.

WebMediaPlayerMS has 2 different VideoFrameProviders: LocalVideoCapture(for
local preview) and RTCVideoRender(for remote view).

Audio will be added in the following patches.

BUG=142988,110938
TEST=turn on WebMediaPlayer_MS, run apprtc.appspot.com/?debug=loopback
Review URL: https://chromiumcodereview.appspot.com/10918052
------------------------------------------------------------------------

chro...@googlecode.com

unread,
Oct 21, 2012, 5:17:45 AM10/21/12
to chromi...@chromium.org

Comment #7 on issue 110938 by ricardo....@gmail.com: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

video.videoWidth and video.videoHeight is 0 when the loadedmetadata is
dispatched. Is is intentional?

chro...@googlecode.com

unread,
Oct 24, 2012, 3:24:26 PM10/24/12
to chromi...@chromium.org

Comment #8 on issue 110938 by bugdro...@chromium.org:
video.onloadedmetadata event doesn't fire when setting video.src to
LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938#c8

The following revision refers to this bug:
http://src.chromium.org/viewvc/chrome?view=rev&revision=163872

------------------------------------------------------------------------
r163872 | wj...@chromium.org | 2012-10-24T18:26:49.334784Z

Changed paths:
M
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/media/webmediaplayer_ms.cc?r1=163872&r2=163871&pathrev=163872
M
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/media/webmediaplayer_ms.h?r1=163872&r2=163871&pathrev=163872

Fix media stream playback event as media element.

When media stream is played with <video>, it needs to emit events as media
element (defined at
http://dev.w3.org/html5/spec-author-view/video.html#mediaevents). This
patch fixes events: canplay, play, playing and timeupdate.

VideoFrameProvider will be started when player is loaded. HaveMetaData and
HaveEnoughData will be sent out when the first frame is received in player.

In autoplay off mode, <video> for media stream will display black window
till play is requrested.

BUG=156310, 142988, 110938
Review URL: https://codereview.chromium.org/11198055
------------------------------------------------------------------------

chro...@googlecode.com

unread,
Nov 7, 2012, 4:31:30 AM11/7/12
to chromi...@chromium.org
Updates:
Cc: pe...@chromium.org

Comment #9 on issue 110938 by kjellan...@chromium.org:
video.onloadedmetadata event doesn't fire when setting video.src to
LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

I'm trying to create a test page that automatically re-sizes the <video>
element as soon a stream starts playing in it.

I have tried hooking up the following function to the following events:
onloadeddata
onloadedmetadata
onplay
onplaying
onprogress
ontimeupdate
onwaiting

But for all of them, I still get 0 size for video.videoWidth and
video.videoHeight. Could it be that the events are fired too early?
I tried 24.0.1312.5-166104 and 25.0.1318.0-166155 on Ubuntu Precise.

chro...@googlecode.com

unread,
Mar 1, 2013, 8:29:03 AM3/1/13
to chromi...@chromium.org

Comment #10 on issue 110938 by jans...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

friendly ping, any news?

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Mar 1, 2013, 10:29:18 AM3/1/13
to chromi...@chromium.org

Comment #11 on issue 110938 by w...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

I will look into this today. From the code
(https://code.google.com/p/chromium/codesearch#chromium/src/webkit/media/webmediaplayer_ms.cc&sq=package:chromium&type=cs&q=webmediaplayer_ms&l=406),
when onloadedmetadata is fired, the video frame size should be correct.

It's possible I need call
GetClient()->sizeChanged();
before SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata);

Need debug it a bit. Will update later.

chro...@googlecode.com

unread,
Mar 4, 2013, 3:50:10 AM3/4/13
to chromi...@chromium.org

Comment #13 on issue 110938 by jans...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

In our WebRTC peerconnection.html test page we call a function to update
the video tag size based on the videotag via jsep01_call.js.

/** @private */
function addStreamCallback_(event) {
debug('Receiving remote stream...');
var videoTag = document.getElementById('remote-view');
videoTag.src = webkitURL.createObjectURL(event.stream);
// Due to crbug.com/110938 the size is 0 when onloadedmetadata fires.
debugger;
videoTag.onloadedmetadata = updateVideoTagSize_('remote-view');
// Use setTimeout as a workaround for now.
//setTimeout(function() {updateVideoTagSize_('remote-view')}, 500);
}

As you can see in the function above I've added debugger; and then entered
the following in the Chrome console:

videoTag.videoHeight
0
videoTag.videoWidth
0

The width and height are stil 0.
Chrome Version 26.0.1410.19

chro...@googlecode.com

unread,
Mar 4, 2013, 4:26:19 AM3/4/13
to chromi...@chromium.org

Comment #14 on issue 110938 by jans...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

Hmm it is not consistent, most of the time the video sizes actually are
defined but not always. Will dig deeper to see if I can find out what it
can be.

chro...@googlecode.com

unread,
Mar 4, 2013, 6:00:17 AM3/4/13
to chromi...@chromium.org
Updates:
Status: Assigned
Owner: w...@chromium.org
Cc: -w...@chromium.org jans...@chromium.org

Comment #15 on issue 110938 by jans...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

Did some more testing and it is consistent, it is not consistent when using
a timeout for 500ms however .

It happens both for local and remote streams consistently, also got some
input from Henrik K that I should not add things that affects timings to
much in JS so I removed debugger and the conditions so that we always
update the video size even if it is 0.

/**
* @private
* @param {string} videoTagId The ID of the video tag to update.
*/
function updateVideoTagSize_(videoTagId) {
var videoTag = $(videoTagId);
// Don't update if sizes are 0 (happens for Chrome M23).
debug('updateVideoTagSize: Set video tag "' + videoTagId + '" width and
height to ' +
videoTag.videoWidth + 'x' + videoTag.videoHeight);
videoTag.width = videoTag.videoWidth;
videoTag.height = videoTag.videoHeight;
}

peer_2604 says: updateVideoTagSize: Set video tag "local-view" width and
height to
0x0
peer_2604 says: updateVideoTagSize: Set video tag "remote-view" width and
height to 0x0

Link to the unmodified test page, update the function updateVideoTagSize in
getusermedia.js according to the function above:
http://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/data/webrtc/manual/peerconnection.html

How did you test this?

chro...@googlecode.com

unread,
Mar 5, 2013, 1:48:40 PM3/5/13
to chromi...@chromium.org

Comment #16 on issue 110938 by w...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

jansson@, see attached test file.

Attachments:
preview_event.html 3.0 KB

chro...@googlecode.com

unread,
Mar 6, 2013, 11:10:44 AM3/6/13
to chromi...@chromium.org

Comment #17 on issue 110938 by jans...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

Thanks!

That page works for me as well, I haven't had much time for this today,
will focus on it tomorrow and see if a can see the difference.

chro...@googlecode.com

unread,
Mar 8, 2013, 4:42:23 AM3/8/13
to chromi...@chromium.org

Comment #18 on issue 110938 by jans...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

The preview_event.html does not update the video tag in the HTML nor does
it display any video feed from the camera (camera led turns on and a stream
blob is present). However the video sizes are not 0 unlike the
peerconnection.html page.

Will continue investigating

chro...@googlecode.com

unread,
Apr 26, 2013, 1:47:20 AM4/26/13
to chromi...@chromium.org

Comment #21 on issue 110938 by a...@tokbox.com: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

Also onloadedmetadata never seems to fire if the video tracks are disabled.
ie. if you do the following to make a stream audio only then the
onloadedmetadata event will never fire on the video element:

getUserMedia({audio:true, video:true}, function(webRTCStream) {
var videoTracks = webRTCStream.getVideoTracks();
for (var i=0, num=videoTracks.length; i<num; ++i) {
videoTracks[i].enabled = false;
}
}

Is this intentional?

chro...@googlecode.com

unread,
Nov 22, 2013, 7:11:42 AM11/22/13
to chromi...@chromium.org

Comment #23 on issue 110938 by AniMatri...@gmail.com:
video.onloadedmetadata event doesn't fire when setting video.src to
LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

This problem still remains unfortunately. It is also quite unreliable to
use timers to determine the resolution after 500ms. It should be enough,
but a good working callback should be the solution.

chro...@googlecode.com

unread,
Dec 15, 2013, 8:07:40 PM12/15/13
to chromi...@chromium.org

Comment #24 on issue 110938 by lois.diq...@gmail.com:
video.onloadedmetadata event doesn't fire when setting video.src to
LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

As a temporary solution, it's possible to detect the onloadedmetadata by
attaching an event listener to the window element:

window.addEventListener('loadedmetadata', function(ev) {
// ev.srcElement.clientWidth is populated correctly
}, true);

chro...@googlecode.com

unread,
May 12, 2014, 1:14:06 PM5/12/14
to chromi...@chromium.org
Updates:
Owner: nik...@chromium.org

Comment #26 on issue 110938 by w...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

Niklas, could you re-assign?

chro...@googlecode.com

unread,
Jul 15, 2014, 11:12:54 AM7/15/14
to chromi...@chromium.org

Comment #28 on issue 110938 by mmccl...@brightcove.com:
video.onloadedmetadata event doesn't fire when setting video.src to
LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

This does not seem to be an issue anymore. I just tested with Chrome
35.0.1916.153 and onloadedmetadata fired as expected.

chro...@googlecode.com

unread,
Jul 24, 2014, 8:22:39 PM7/24/14
to chromi...@chromium.org

Comment #29 on issue 110938 by p...@tokbox.com: video.onloadedmetadata event
doesn't fire when setting video.src to LocalMediaStream blob url
http://code.google.com/p/chromium/issues/detail?id=110938

I am still seeing this behavior under 36 when the video track is disabled
by the remote peer.

chro...@googlecode.com

unread,
Nov 3, 2014, 5:48:26 PM11/3/14
to chromi...@chromium.org
Updates:
Labels: WebrtcTriaged M-42

Comment #30 on issue 110938 by v...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
https://code.google.com/p/chromium/issues/detail?id=110938

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Jan 12, 2015, 5:29:32 PM1/12/15
to chromi...@chromium.org

Comment #31 on issue 110938 by jub...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
https://code.google.com/p/chromium/issues/detail?id=110938

#29, are you still seeing this issue? can you make a jsfiddle to
demonstrate the problem?

chro...@googlecode.com

unread,
Jan 15, 2015, 1:51:38 AM1/15/15
to chromi...@chromium.org

Comment #33 on issue 110938 by jub...@chromium.org: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
https://code.google.com/p/chromium/issues/detail?id=110938

http://jsfiddle.net/dwLfa37x/1/ - works for local media, even when
disabled. Haven't tried remote media, as in #29.

chro...@googlecode.com

unread,
Jan 18, 2015, 8:01:07 PM1/18/15
to chromi...@chromium.org

Comment #34 on issue 110938 by patr...@m.ac.nz: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
https://code.google.com/p/chromium/issues/detail?id=110938

#31 I'm still seeing it, and with remote media. I'll see if I can make a
jsfiddle or something to do a remote (I can easily reproduce it inside the
tokbox sdk, but that's not super helpful here)

chro...@googlecode.com

unread,
Jan 23, 2015, 12:40:40 PM1/23/15
to chromi...@chromium.org
Updates:
Status: Available
Owner: ---
Cc: to...@chromium.org

Comment #35 on issue 110938 by tnak...@chromium.org:
video.onloadedmetadata event doesn't fire when setting video.src to
LocalMediaStream blob url
https://code.google.com/p/chromium/issues/detail?id=110938

#34 - thanks!

I'm going to remove this from tommi@ for now since local media works (#33),
but we're still waiting for a consistent repro for remote media (#34).

chro...@googlecode.com

unread,
Jan 26, 2015, 2:38:47 PM1/26/15
to chromi...@chromium.org

Comment #36 on issue 110938 by pthatc...@google.com: video.onloadedmetadata
event doesn't fire when setting video.src to LocalMediaStream blob url
https://code.google.com/p/chromium/issues/detail?id=110938

We'll wait for #34 to repro in a JSFiddle.

chro...@googlecode.com

unread,
Feb 5, 2015, 8:43:22 AM2/5/15
to chromi...@chromium.org

Comment #37 on issue 110938 by phog...@chromium.org:
video.onloadedmetadata event doesn't fire when setting video.src to
LocalMediaStream blob url
https://code.google.com/p/chromium/issues/detail?id=110938

[triage]: ping patrick as per #34.
Reply all
Reply to author
Forward
0 new messages