HTTP Live Streaming (HLS)
Isto foi útil?
Isto foi útil?
<video id='hls-video'>
<source src='stream_hls.m3u8' type='application/x-mpegURL'/>
</video>
<script>
fluidPlayer(
'hls-video',
{
hls: {
overrideNative: true
}
}
);
</script><MediaFile id="1" delivery="streaming" type="application/vnd.apple.mpegurl" width="480" height="640">
<![CDATA[ https://example.com/stream_hls.m3u8 ]]>
</MediaFile>fluidPlayer('fluid-player', {
modules: {
configureHls: (options) => {
return {
maxMaxBufferLength: 30, // Comprimento máximo do vídeo em buffer, em segundos
startLevel: 4, // Nível de qualidade inicial - 4 é normalmente Full HD (1080p), mas isto pode mudar conforme a origem
...options,
}
},
onBeforeInitHls: (hls) => {
hls.startLevel = 4; // Definir programaticamente o nível de qualidade inicial
},
onAfterInitHls: (hls) => {
hls.nextLevel = 4 // Definir programaticamente o nível de qualidade para o próximo segmento
},
}
});