AirenSoft / OvenPlayer

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

Cache all video sources #359

Closed ArturLinnik closed 1 year ago

ArturLinnik commented 1 year ago

Hi!

In the product I'm developing there are several simultaneous streams (which show videos sent by some cameras) and the interesting part is that the user can change in real time the source of these streams to see what they are interested in at that moment.

To show these streams we use OvenPlayer.

All of these streams are recorded and the user is able to change the source of the video he's watching by selecting it in the OvenPlayer. The problem is that this change is only immediate when the source to which the user wants to change is cached. So, if there are 3 sources, the first time I change the source will have a loading time (1-3 seconds, depending on the internet) and once those videos are cached then the change becomes immediate, which is what we are looking for.

My idea to achieve this is to cache all of the 3 sources simultaneously, even if the user hasn't selected that source.

I can modify OvenPlayer's code myself but my question is, is there an easy way to modify OvenPlayer to achieve this or would it be too difficult with several major changes?

Thanks a lot, you're doing an incredible job!

SangwonOh commented 1 year ago

@ArturLinnik Hi. OvenPlayer is not thinking about caching at all. So it will be a tough job to fix a lot of things. Right now we are not planning on caching streams simultaneously. Thanks!

ArturLinnik commented 1 year ago

Okay. Thanks for answering!

SangwonOh commented 1 year ago

@ArturLinnik Also you can use this solution! https://github.com/AirenSoft/OvenPlayer/issues/351#issuecomment-1524086952 Using three player instance and hide/show mute/unmute what you want to show. You need to make external source selection UI.