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

How to play hls video #611

Open
vanminhquangtri opened this issue Sep 16, 2023 · 4 comments
Open

How to play hls video #611

vanminhquangtri opened this issue Sep 16, 2023 · 4 comments

Comments

@vanminhquangtri
Copy link

vanminhquangtri commented Sep 16, 2023

Hello,
I have read the docs but the no guidance for play hls video, such is file m3u8. My website provide line channel stream as well as movies. My video url is same format with:
https://some.domain/index.m3u8

Can you please give me an example how to run this?
Thank you.

@vanminhquangtri
Copy link
Author

I see this website use video-youtube for hls vod. But don't know how they do
https://pops.vn/video/cam-y-chi-ha-tap-1-61721faa70b7b600556dfb4e

@mister-ben
Copy link

The videojs-youtbe tech is not used for HLS. The default build of Video.js includes HLS support. Just load a source specifying the type,

<source src="video/test.m3u8" type="application/x-mpegURL">

or

player.src({
  src: 'https://example.com/video.m3u8',
  type: 'applicaiton/x-mpegURL'
});

@vanminhquangtri
Copy link
Author

@mister-ben thank you for your email. Yes I know with Videojs we can run hls.
My main purpose is to make my hls video auto play without unmuted. Like the below webite do.
https://pops.vn/video/cam-y-chi-ha-tap-1-61721faa70b7b600556dfb4e

As you can see, they use library videojs-youtube. They auto play video unmuted. I am trying to do this but not success.

@mister-ben
Copy link

I can't see what's happening on that website die to its geo restrictions, but there is no trickery in videojs-youtube to workaround autoplay restrictions, and having the videojs-youtube tech present when a non-Youtube source is used will do nothing. On Chrome, autoplay with sound is allowed if the user's Media Engagement Index for the website is above a threshold, so your experience might not be the same as others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants