-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
null out currentSource_ on tech dispose and src change #3314
Conversation
@@ -813,6 +813,8 @@ Tech.withSourceHandlers = function(_Tech){ | |||
// than clear all of our current tracks | |||
if (this.currentSource_) { | |||
this.clearTracks(['audio', 'video']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brandonocasey is there a reason why we don't want to just always call clearTracks()
here?
There was a problem hiding this comment.
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 entirely remember but I think it had to do with saving keeping Audio/Video Tracks that were added before we had a currentSource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll see what I can find out. Currently, the tests break because of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ended up removing clearing out the currentSource_
in disposeSourceHandler
and only doing it inside this if statement.
Looks good to me |
LGTM |
Follow up to #3285, we need
currentSource_
to be cleared out if we're switching sources on a tech and we're no longer using a source handler. Plus, when the tech is disposed, we should clear out thecurrentSource_
.