feat(VVideo): add src-object prop for MediaStream/WebRTC#22670
feat(VVideo): add src-object prop for MediaStream/WebRTC#22670J-Sek merged 9 commits intovuetifyjs:masterfrom
src-object prop for MediaStream/WebRTC#22670Conversation
Closes vuetifyjs#22568 Adds a `srcObject` prop to allow attaching a `MediaStream`, `MediaSource`, or `Blob` as the video source. This is especially useful for WebRTC streaming where a `MediaStream` is obtained from `getUserMedia` or a peer connection. Unlike `src`, the `srcObject` property must be set programmatically on the `<video>` element rather than as an HTML attribute. Example: ```vue <v-video :src-object="stream" /> ```
J-Sek
left a comment
There was a problem hiding this comment.
I have upgraded the demo in the description. Would it make sense for the VVideo to show an error state instead of spinning infinitely?
…ilure - Add onError handler to video element that sets state to 'error' - Emit new 'error' event when video fails to load - Hide loading spinner and poster in error state - Show error icon overlay (using $error icon alias) - Clicking in error state retries via videoRef.load()
|
Great point, @J-Sek! I've just pushed a fix for this — the video element now has an
The |
|
If the device does not have a camera, this I have updated the demo in the PR description again. Let me know if you can test it against disconnecting device or interrupting the stream somehow (after it started successfully). I want to make sure the |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The error prop now syncs both ways — internal video errors set the model, and parent can set error externally. Retry clears the model. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Updated the |
src-object prop for MediaStream/WebRTC
Description
Adds a
srcObjectprop tov-video, allowing users to attach aMediaStream,MediaSource, orBlobas the video source without using thesrcattribute.This is particularly useful for WebRTC streaming where a
MediaStreamis obtained fromnavigator.mediaDevices.getUserMedia()or anRTCPeerConnection.Changes
srcObjectprop (MediaStream | MediaSource | Blob) tomakeVVideoProps()videoRef.value.srcObjectwhen the prop changes, and triggers the video element to render if neededvideoRefto apply a pendingsrcObjectwhen the element lazily mountsVVideo.json) with a description for the new propUsage
Closes
Closes #22568