You need to provide a livestream URL in MediaDataSource and indicates isLive: true.
Sample HTTP FLV source:
{
// HTTP FLV
"type": "flv",
"isLive": true,
"url": "http://127.0.0.1:8080/live/livestream.flv"
}Or a WebSocket source:
{
// FLV over WebSocket
"type": "flv",
"isLive": true,
"url": "ws://127.0.0.1:9090/live/livestream.flv"
}You must configure Access-Control-Allow-Origin header correctly on your stream server.
See cors.md for details.
Due to IO restrictions, flv.js can support HTTP FLV live stream on Chrome 43+ and FireFox 42+ for now.
HTTP FLV live stream relies on stream IO, which has been introduced in fetch and stream spec. but FetchStreamLoader only works well on a few browsers for now:
- Chrome:
FetchStreamLoaderworks well on Chrome 43+ - FireFox: FireFox has
fetchsupport butstreamis missing,moz-chunked-arraybufferxhr extension is used - Edge:
fetch + streamis broken on Microsoft Edge, see Fetch API with ReadableStream has bug with data pumping - Safari:
fetchhas not been supported on current version 10, but available in Safari Technology Preview