[go: nahoru, domu]

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

hls format doesnt work on IOS #7

Closed
magicknight opened this issue Dec 17, 2018 · 2 comments
Closed

hls format doesnt work on IOS #7

magicknight opened this issue Dec 17, 2018 · 2 comments

Comments

@magicknight
Copy link

Expected behaviour

在 iphone X 上用 safari 来播放m3u8格式,也引入了hls.js,但并不能播放,桌面端可以。
手机段 console 没有任何出错信息。
如果通过whitelist允许用复杂界面,出现 “vt.on is not a function" 这个错误

Actual behaviour

Steps to reproduce

Environment

  • Browser:
    safari
  • Version:
  • Operating System:
    IOS
  • Version:
    12

Console errors (if any)

vt.on is not a function

Link to where the bug is happening

@zhw2590582
Copy link
Owner

hls.js 上面有一个兼容性的说明:https://github.com/video-dev/hls.js/#compatibility
同时也说了iOS Safari上虽然不支持hls.js,但能直接支持m3u8作为地址,所以你可能要做下兼容处理

https://artplayer.org/issues/7.html
https://artplayer.org/issues/7.html?whitelist=iPhone

var art = new Artplayer({
    container: '.artplayer-app',
    url: 'https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8',
    customType: {
        m3u8: function(video, url) {
            var hls = new Hls();
            hls.loadSource(url);
            hls.attachMedia(video);
            if (!video.src) {
                video.src = url;
            }
        },
    },
});

@magicknight
Copy link
Author

Got it, thanks.

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