bilibili / flv.js

HTML5 FLV Player
Apache License 2.0
22.83k stars 3.38k forks source link

Websocket flv settings #96

Closed myhu closed 7 years ago

myhu commented 7 years ago

Hi,

When I'm trying to use this setting I've got an error: { // FLV over WebSocket "type": "flv", "isLive": true, "url": "ws://127.0.0.1:9090/live/livestream.flv" } Fetch API cannot load ws://127.0.0.1:9090/. URL scheme must be "http" or "https" for CORS request.

If I'm using http protocol, everything is working fine...only websocket is not working in Chrome

On the server side of course I set the proper CORS settings...

What gonna be what I forget to set, or ?

thx in advance, misi flv js ws error chrome

xqq commented 7 years ago

websocket url should be handled by WebSocketLoader. This works well in the master code. Did you modify any part of IOController ?

myhu commented 7 years ago

I did not changed anything, only build a new flv.js...I've tried again just in case, but the sam error came across...

"I do not understand, my response is not seeing, what i've already reported yesterday...So maybe right now, I'm gonna be luckier...argh"

myhu commented 7 years ago

In the meantime I've checked what you mentioned IOController.js file. It looks "this._isWebSocketURL = /wss?:\/\/(.+?)\//.test(dataSource.url);" this part is not working When I miss out this part and forced _selectLoader() to use WebsocketLoader, every errors in a question are eliminated...

xqq commented 7 years ago

It should be caused by the incorrect regexp fixed in https://github.com/Bilibili/flv.js/commit/537f7e8e89605c7762c5fcf97a8d65252e1dc6c6

zgy520 commented 7 years ago

@myhu hello, can you share you demo. i now do it, but can not implement it

hj009 commented 7 years ago

@myhu你好,你可以分享你演示吗 我现在做,但不能实现它+1