DPlayer icon indicating copy to clipboard operation
DPlayer copied to clipboard

本地调试时,遇到了个跨域的问题,作为前端小白不知道如何去解决

Open jamesyao233 opened this issue 3 years ago • 3 comments

这个是写的初始化播放的代码 let video = new DPlayer({ container: document.getElementById("videoPlayer"), video: { url: 'https://oss-test.kemiketang.com/meu8/teachResource/1/4.5.身体的“联络员”.m3u8', type: 'customHls', customType: { customHls: function (video: HTMLMediaElement, player: any) { const hls = new Hls(); hls.loadSource(video.src); hls.attachMedia(video); },} }})

jamesyao233 avatar Jul 22 '22 06:07 jamesyao233

你的视频地址是无法播放的,先保证视频地址在浏览器上能正常播放。

tangwanqi1991 avatar Jul 28 '22 01:07 tangwanqi1991

这个是m3u8的,直接播放肯定不行的吧,支持流播放的工具都是可以播放的 @tangwanqi1991

jamesyao233 avatar Jul 28 '22 02:07 jamesyao233

那你写一个流的方法就可以了

tangwanqi1991 avatar Jul 28 '22 02:07 tangwanqi1991