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

destroy videostream (if any) when file is destroyed. #1704

Open
wants to merge 1 commit into
base: master
from
Open
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -119,7 +119,7 @@ class File extends EventEmitter {

renderTo (elem, opts, cb) {
if (typeof window === 'undefined') throw new Error('browser-only method')
render.render(this, elem, opts, cb)
this._stream = render.render(this, elem, opts, cb)

This comment has been minimized.

Copy link
@feross

feross Aug 14, 2019

Member

See feedback on your PR to render-media, but this won't work if render doesn't return a Videostream instance and instead uses one of the other strategies.

}

_getMimeType () {
@@ -129,6 +129,8 @@ class File extends EventEmitter {
_destroy () {
this._destroyed = true
this._torrent = null
this._stream && this._stream.destroy()
this._stream = null
}
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.