Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add srcObject for getUserMedia #9146

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/renderers/dom/shared/HTMLDOMPropertyConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ var HTMLDOMPropertyConfig = {
srcDoc: 0,
srcLang: 0,
srcSet: 0,
srcObject: 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like srcObject should be set as a property on the element, not as an attribute. We should use MUST_USE_PROPERTY instead of 0 here to force React to set it as a property on the element.

Copy link

@michael-donat michael-donat Jun 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow here. What is the difference between property and an attribute?

srcObject is no different to src really, the only difference is that one accepts a stream while the other a url.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference is between:

video.setAttribute('srcObject', stream)

and

video.srcObject = stream

Since stream is likely an instance of MediaStream, setting it as an attribute wouldn't work since it would coerce it to a string

<video srcobject="[object MediaStream]"></video>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, makes sense, thanks for explaining this!

start: HAS_NUMERIC_VALUE,
step: 0,
style: 0,
Expand Down