Jump to content
  • 0

Configure video player to behave like normal video player


Alex O
 Share

Question

Hi there,

After having issues getting accurate HLS viewer numbers using a 3rd party video player, I've switched to using the video player provided by AMS, which works better. What I want to do is configure it so that it works like a normal video player.

I want to remove the "Stream will start playing automatically when it is live" message, replace it with a poster image and have the usual 'play' button available, so that users can start the video themselves (basically a normal video player).

Thanks,
Alex
Link to comment
Share on other sites

  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0

Yes that i doable by modifying a couple lines. Could you check this line? https://github.com/ant-media/StreamApp/blob/master/src/main/webapp/play.html#L30

This is where you want to change. You can put some image or something you want here and bind it to mouseclick which should trigger playing.
Also you can remove autoplay tag from the video's 
Check here please:https://github.com/ant-media/StreamApp/blob/master/src/main/webapp/play.html#L49
You can remove autoplay tags to remove autoplaying feature.
Best Regards.
Enes.

 

Link to comment
Share on other sites

  • 0
Hi Enes,
Thanks for your reply. Unfortunately I do not know how to bind an image to a mouseclick, but this is something I can look at. I tried replacing the "Stream will start playing automatically when it is live" with an image, but when the video loads, the image appears then disappears and the same message then appears. The text must be configured somewhere else too in the code.

As for the autoplay, I tried removing 'autoplay' from the line of code you suggested, but nothing changed. Please note that the line you suggested is located in the <!-- WebRTC Player --> section, which I do not use. I use the HLS player which looks to be configured above this code.

I tried removing 'preload="auto"' from the HLS video code, but again nothing changed. When the stream is live, the video auto plays.

Is there anything else I can try to prevent the video from automatically loading?

Thanks,
Alex


Link to comment
Share on other sites

  • 0

You won't an image to a mouseclick, you will bind a function to mouseclick as usual. Nothing unusual here.

You may need to change other lines with the Stream will start playing automatically inclucion.
One is in the hlsNoStreamCallback, other one is vodNoStreamCallback. You also need to change these lines in these functions
autoPlay=false should make stop auto playing.

Best Regards,
Enes Kuluk.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...