AirenSoft / OvenPlayer

OvenPlayer is JavaScript-based LLHLS and WebRTC Player for OvenMediaEngine.
https://OvenMediaEngine.com/ovenplayer
MIT License
506 stars 125 forks source link

If the player pauses, will streaming continue? #119

Closed alex-jhones closed 4 years ago

alex-jhones commented 4 years ago

Hi

I found in testing that streaming continues while the player video is paused. or the browser continued to play without timeout even when minimized without closing the browser.

Is there any way to stop streaming? Because this causes depletion of data capacity on mobile devices and accelerates battery consumption when considering services.

If there are other reasons to continue streaming, I would like to know the background.

I checked the oven player API but couldn't find any related support. I would like to know how to solve this.

[chrome://webrtc-internals] image

SangwonOh commented 4 years ago

@alex-jhones Once peer connection established, player keeps connection even if pausing video. Because OvenPlayer is not implemented to close peer connection when playback is paused.

To stop data transfering, using remove() API will be an option.

alex-jhones commented 4 years ago

I can't find the api on the web page. Can I get the information? https://airensoft.gitbook.io/ovenplayer/api-reference/api

SangwonOh commented 4 years ago

Please refer this. Thank you.

https://github.com/AirenSoft/OvenPlayer/blob/master/docs/api.md#playerremove

alex-jhones commented 4 years ago

I reflected it as you told me, but it still seems that the stream continues to be delivered. However, I confirmed that it was stopped on the log. Can you tell me what the problem is?

image

I checked it at chrome: // webrtc-internals image

SangwonOh commented 4 years ago

Even if peer connection closed chrome remains tab panel a few seconds. To checking metrics graph is still running or stoped you can see stream status.

alex-jhones commented 4 years ago

Thank you. I confirmed that I stopped the stream. But why maintain the peer connection? If the stream is closed, shouldn't the connection be closed? I misunderstood that this is still taking the stream.

If you look at the picture below, you can see that the peer connection is still maintained.

image

SangwonOh commented 4 years ago

OvenPlayer close the peer connection. I think [chrome://webrtc-internals] maintains the peer connection even the peer connection is closed. So that gives chance to the developers to check event logs like ice candidate status.

In our case, [chrome://webrtc-internals] remains the tab when the peer connection is closed. And then after a while the tabs are closed automatically

SangwonOh commented 4 years ago

We close this issue because it has not had recent activity. If you have further issues, open the issue again. Thanks. Good luck.