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

options for don't autoplay #878

Closed
zh99998 opened this issue Jul 30, 2016 · 5 comments
Closed

options for don't autoplay #878

zh99998 opened this issue Jul 30, 2016 · 5 comments

Comments

@zh99998
Copy link

@zh99998 zh99998 commented Jul 30, 2016

now webtorrent enforce autoplay on render, could give a options for disable that?

@yciabaud

This comment has been minimized.

Copy link
Contributor

@yciabaud yciabaud commented Jul 30, 2016

Hello,

I am afraid there is no such option in appendTo function but you can still create the element on your own and use renderTo function.

Will this be ok for you?

@zh99998

This comment has been minimized.

Copy link
Author

@zh99998 zh99998 commented Jul 30, 2016

even though I create own element without autoplay, and use renderTo, it will autoplay.
maybe it's caused by this?
https://github.com/feross/render-media/blob/f7331ef538e60826b25ce94a001f8eecc4c3c366/index.js#L234

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 4, 2016

I just added an optional opts parameter to render-media and exposed it in WebTorrent.

If provided, opts can contain the following options:

  • autoplay: Autoplay video/audio files (default: true)
  • controls: Show video/audio player controls (default: true)
feross added a commit to feross/render-media that referenced this issue Aug 4, 2016
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 4, 2016

Use it like this:

file.renderTo(elem, { autoplay: false }, callback)

Released as WebTorrent 0.96.0.

@feross feross closed this in 58cf082 Aug 4, 2016
@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.