html5rocks / www.html5rocks.com

....a top-notch resource for web developers
https://html5rocks.com
Other
2.22k stars 771 forks source link

Updated WebRTC demos to use mediaDevices.getUserMedia and video.srcObject #1480

Closed samdutton closed 6 years ago

samdutton commented 6 years ago

Also fixed the gUM demos.

Except in a couple of places, I haven't updated otherwise. The articles could all do with a proper review from the WebRTC folks, since they still get a lot of views and we probably want to port to /web.

The translations will also need to be updated.

@cwilso @ebidel @fippo @jpmedley fyi

samdutton commented 6 years ago

Got it — thank you — done.

On 22 January 2018 at 20:28, Philipp Hancke notifications@github.com wrote:

@fippo commented on this pull request.

In content/tutorials/webrtc/basics/en/index.html https://github.com/html5rocks/www.html5rocks.com/pull/1480#discussion_r163059001 :

-

In Chrome or Opera, the URL.createObjectURL() method converts a MediaStream to a Blob URL which can be set as the src of a video element. (In Firefox and Opera, the src of the video can be set from the stream itself.) Since version M25, Chromium-based browsers (Chrome and Opera) allow audio data from getUserMedia to be passed to an audio or video element (but note that by default the media element will be muted in this case).

+

A MediaStream can be set as the src of a video element by using the srcObject method. (The URL.createObjectURL() method is deprecated.) Since version M25, Chromium-based browsers (Chrome and Opera) allow audio data from getUserMedia to be passed to an audio or video element (but note that by default the media element will be muted in this case).

ah... now it gets clearer. How is this:

A MediaStream can be attached to a video element by setting the srcObject attribute.. Previously this was done by setting the src attribute to an object URL created with URL.createObjectURL() method is deprecated; this has been deprecated.

Since version M25, Chromium-based browsers (Chrome and Opera) allow audio data from getUserMedia to be passed to an audio or video element (but note that by default the media element will be muted in this case).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .

samdutton commented 6 years ago

@cwilso @ebidel @PaulKinlan @petele Any objection if I merge this?

Once merged, I'll ask the WebRTC team to review these articles.

samdutton commented 6 years ago

@petele Hi Pete — could we merge/publish this?

webrtc-eng will review it after that's done, then we can port to WF.