Open hezhanbang opened 4 years ago
跑不起来呢,有跑起来的同学吗
安装与使用
mkdir goldvideo
cd goldvideo
git clone https://github.com/goldvideo/demuxer.git
cd demuxer
npm install
npm run production
cd ..
cd h265player
npm install
npm install ../demuxer
以下命令根据需要四选一
npm run dev # 运行开发环境
npm run test # 运行测试环境
npm run build # 打包正式环境
rollup -c # 打包csj与esm版本
Nginx配置:
server {
listen 8000;
location / {
root
测试页面: http://localhost:8000/demo/demo.html
是哪一步出的问题?有报错信息吗?
打开页面,控制台报错
ThrowError.js?80b6:64 Error: [GOLDPLAY ERROR:default-1001]m3u8 file is not text.
at ThrowError.throws (ThrowError.js?80b6:61)
at M3U8Parser.parse (M3U8Parser.js?411e:208)
at new M3U8Parser (M3U8Parser.js?411e:70)
at HLSLoader.parsePlaylist (HLSLoader.js?816b:70)
at Worker.httpWorker.onmessage (HLSLoader.js?816b:64) "[message]:" "m3u8 file is not text." "[args]:" [Blob]0: Blob {size: 6817491, type: "video/mp4"}length: 1proto: Array(0)
throws @ ThrowError.js?80b6:64
parse @ M3U8Parser.js?411e:208
M3U8Parser @ M3U8Parser.js?411e:70
parsePlaylist @ HLSLoader.js?816b:70
httpWorker.onmessage @ HLSLoader.js?816b:64
ThrowError.js?80b6:64 Error: [GOLDPLAY ERROR:default-1001]0
at ThrowError.throws (ThrowError.js?80b6:61)
at HLSLoader.eval (Player.js?66d6:304)
at eval (Events.js?a0fd:81)
at Array.forEach (
看错误是解析m3u8出错了,m3u8返回内容是什么
goldvideo-player@1.0.2 dev C:\Users\m&m\Desktop\goldvideo\h265player webpack --config build/webpack.dev.conf.js --watch --display-error-details
'm\Desktop\goldvideo\h265player\node_modules.bin\' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 internal/modules/cjs/loader.js:638 throw err; ^
Error: Cannot find module 'C:\Users\webpack\bin\webpack.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! goldvideo-player@1.0.2 dev: webpack --config build/webpack.dev.conf.js --watch --display-error-details
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the goldvideo-player@1.0.2 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我下载了源码,要怎么运行才能看到效果呢。 我执行 npm run test和npm run dev都没看到效果。