videojs / videojs-contrib-hls

HLS library for video.js
http://videojs.github.io/videojs-contrib-hls/
Other
2.84k stars 792 forks source link

React + videojs-contrib-hls error in chrome and firefox, safari is ok #1356

Closed int618 closed 6 years ago

int618 commented 6 years ago

Description

React + videojs-contrib-hls error in chrome and firefox, safari is ok

Sources

import videojs from 'video.js'; import 'video.js/dist/video-js.css'; window.videojs = videojs; require('videojs-contrib-hls'); export default class VideoPlayer extends Component { componentDidMount() { this.player = videojs('vjsplayer'); } render() { return(\<video id='vjsplayer' className="video-js" controls> \<source src="http://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8 " type="application/x-mpegURL" /> \</video>) } }

Steps to reproduce

  1. this.player = videojs('vjsplayer'); error 2.application/x-mpegURL type not supported。load http://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8 failure。

Error output

Uncaught TypeError: Cannot convert undefined or null to object at Function.keys () at module.exports (index.js:10) at new MasterPlaylistController (master-playlist-controller.js:314) at HlsHandler.src (videojs-contrib-hls.js:335) at Object.handleSource (videojs-contrib-hls.js:623) at Html5.Tech.setSource (video.cjs.js:9000) at new Html5 (video.cjs.js:16506) at Player.loadTech (video.cjs.js:19219) at Player.src_ (video.cjs.js:20832) at video.cjs.js:20779 at setSourceHelper (video.cjs.js:9133) at setSourceHelper (video.cjs.js:9135) at Player. (video.cjs.js:9055) at bound (video.cjs.js:2282)

Additional Information

Please include any additional information necessary here. Including the following:

videojs-contrib-hls version

videojs-contrib-hls 5.12.2

videojs version

video.js 6.6.3

Browsers

chrome 64.0.3282.186 firefox 58.0.2

Platforms

OS X EI Capitan 10.11.6

int618 commented 6 years ago

see #600