A js SDK that generates html5 or flash player based on the browser environment, supports playback of hls/mp4, and supports playback of custom encryption ts.
On browsers that support MediaSourceExtensions, sdk will become an html5 player; on browsers such as IE6 to IE11, sdk will become a flash player; at the same time, sdk provides a parameter preferFlash. When this parameter is set to 1, sdk will ignore the browser environment to generate a flash player.
This project code mainly refers to (copy) hls.js https://github.com/video-dev/hls.js/tree/master
I did the following small work:
1) Support playback of custom encrypted ts
2) Optimize audio and video processing (demux-remux) logic to be compatible with more abnormal videos
3) Access flash (https://github.com/yangq1990/avplayer-flash/tree/master) as fallback, it provides a web player solution such as PC browser, mobile browser, etc.
4) Optimize the code structure to facilitate collaborative development
How to use:
git clone https://github.com/yangq1990/avplayer.js.git
cd avplayer.js
npm install #install project dependency npm run build #generate avplayer.js
npm run release #Generate compressed version of avplayer.min.js
npm run serve #run server
npm run open #Open index.html in demo directory