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

stop stream when close publisher #4261

Open
liushuaiyu opened this issue Dec 18, 2024 · 2 comments
Open

stop stream when close publisher #4261

liushuaiyu opened this issue Dec 18, 2024 · 2 comments
Labels
TransByAI Translated by AI/GPT.

Comments

@liushuaiyu
Copy link

liushuaiyu commented Dec 18, 2024

!!! Before submitting a new feature request, please ensure you have searched for any existing features and utilized
the Ask AI feature at https://ossrs.io or https://ossrs.net (for users in China). Duplicate issues or
questions that are overly simple or already addressed in the documentation will be removed without any
response.
When I called srs.sdk.js to close the pc, I found that the browser page was still using the camera

What is the business background? Please provide a description.
Who are the users? How do they utilize this feature? What problem does this feature address?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.
// Close the publisher. stop stream when close publisher
self.close = function () {
self.pc && self.pc.close()
self.pc = null
// If a local stream exists, stop all of its tracks.
if (self.stream) {
console.log('close publisher stream')
self.stream.getTracks().forEach(track => track.stop())
self.stream = null
}
}
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

TRANS_BY_GPT4

@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Dec 18, 2024
@Sanderluc5
Copy link

Sanderluc5 commented Dec 30, 2024

I recently switched to SRT and the SRS_VHOST_PUBLISH_KICKOFF_FOR_IDLE=5 stopped working. It seems that SRT is not detecting that there are 0 people watching...

It seems a error is throwing up:
Screenshot 2024-12-30 at 17 40 34
Screenshot 2024-12-30 at 17 46 01

@Sanderluc5
Copy link

It seems that the first connection is preventing the stream from stopping. There is always 1 client connected to the stream. Even before the on_play event got triggered.
Screenshot 2024-12-30 at 18 57 24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

3 participants