goldvideo / h265player

一套完整的Web版H.265播放器解决方案,非常适合学习交流和实际应用。基于JS码流解封装、WebAssembly(FFmpeg)视频解码,利用Canvas画布投影、AudioContext播放音频。
https://goldvideo.github.io/h265player/
1.55k stars 301 forks source link

怎么运行 #3

Open hezhanbang opened 4 years ago

hezhanbang commented 4 years ago

我下载了源码,要怎么运行才能看到效果呢。 我执行 npm run test和npm run dev都没看到效果。

snxly commented 4 years ago

请参考“安装与使用”一节 https://github.com/goldvideo/h265player#%E5%AE%89%E8%A3%85%E4%B8%8E%E4%BD%BF%E7%94%A8 测试页面是 http://localhost:8000/demo/demo.html

kongqueyu commented 4 years ago

跑不起来呢,有跑起来的同学吗

snxly commented 4 years ago

安装与使用

Nginx配置: server { listen 8000; location / { root /h265player; index index.html index.htm; autoindex on; } }

测试页面: http://localhost:8000/demo/demo.html

是哪一步出的问题?有报错信息吗?

spiderT commented 4 years ago

打开页面,控制台报错 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 () at Events.emit (Events.js?a0fd:80) at HLSLoader.parsePlaylist (HLSLoader.js?816b:75) at Worker.httpWorker.onmessage (HLSLoader.js?816b:64) "[message]:" "0" "[args]:" (3) ["Parse playlist error.", "data:", M3U8Parser]0: "Parse playlist error."1: "data:"2: M3U8Parser {source: Blob, segments: Array(0), _currentSegment: null, discontinuous: null, tags: {…}, …}length: 3proto: Array(0) throws @ ThrowError.js?80b6:64 eval @ Player.js?66d6:304 eval @ Events.js?a0fd:81 emit @ Events.js?a0fd:80 parsePlaylist @ HLSLoader.js?816b:75 httpWorker.onmessage @ HLSLoader.js?816b:64

yiwen03 commented 4 years ago

看错误是解析m3u8出错了,m3u8返回内容是什么

lccx-shall commented 4 years ago

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.

Tobee4Lin commented 3 years ago

解决方案