@ -20,6 +20,8 @@ const VIDEO_FRAMES_PER_SECOND = 30;
const PLAYBACK _RATES = [ 0.25 , 0.5 , 0.75 , 1 , 1.25 , 1.5 , 1.75 , 2 , 4 , 8 ] ;
const PLAYBACK _RATES = [ 0.25 , 0.5 , 0.75 , 1 , 1.25 , 1.5 , 1.75 , 2 , 4 , 8 ] ;
const CHAT _REFRESH _INTERVAL _MS = 10000 ;
function commonPageSetup ( ) {
function commonPageSetup ( ) {
if ( ! Hls . isSupported ( ) ) {
if ( ! Hls . isSupported ( ) ) {
addError (
addError (
@ -517,10 +519,15 @@ function triggerDownload(url, filename) {
function sendChatLogLoadData ( ) {
function sendChatLogLoadData ( ) {
let startTime = getStartTime ( ) ;
let startTime = getStartTime ( ) ;
let endTime = getEndTime ( ) ;
if ( startTime === null ) {
if ( ! startTime || ! endTime ) {
return ;
return ;
}
}
let endTime = getEndTime ( ) ;
let refresh = false ;
if ( endTime === null ) {
endTime = DateTime . now ( ) . setZone ( "utc" ) . plus ( { minutes : 1 } ) ;
refresh = true ;
}
startTime = wubloaderTimeFromDateTime ( startTime ) ;
startTime = wubloaderTimeFromDateTime ( startTime ) ;
endTime = wubloaderTimeFromDateTime ( endTime ) ;
endTime = wubloaderTimeFromDateTime ( endTime ) ;
const segmentMetadata = getSegmentTimes ( ) ;
const segmentMetadata = getSegmentTimes ( ) ;
@ -536,6 +543,10 @@ function sendChatLogLoadData() {
segmentMetadata : segmentMetadata ,
segmentMetadata : segmentMetadata ,
} ;
} ;
globalLoadChatWorker . postMessage ( message ) ;
globalLoadChatWorker . postMessage ( message ) ;
if ( refresh ) {
setTimeout ( sendChatLogLoadData , CHAT _REFRESH _INTERVAL _MS ) ;
}
}
}
function updateChatDataFromWorkerResponse ( chatData ) {
function updateChatDataFromWorkerResponse ( chatData ) {