Finished mediahandler placeholder, fixed most scheduler bugs with webrtc scheduling, started pushing iceServers w/ media object instead of clientmetadata.

This commit is contained in:
rainbow napkin 2026-07-11 03:54:23 -04:00
parent b68d55b7ef
commit 3517a1499a
7 changed files with 72 additions and 12 deletions

View file

@ -926,4 +926,60 @@ class hlsLiveStreamHandler extends hlsBase{
}
}
}
}
/**
* Wrapper handler for WebRTC Streams, calling back to webRTCHandler.js for heavy lifting
* @extends rawFileBase
*/
class WebRTCLivestreamHandler extends rawFileBase{
/**
/**
* Instantiates a new WebRTCMediaHandler
* @param {channel} client - Parent Client Management Object
* @param {player} player - Parent Canopy Player Object
* @param {Object} media - De-hydrated media object from server
*/
constructor(client, player, media){
//Call derived constructor
super(client, player, media, "webrtc");
/**
* Internet Connectivity Establishment configuration
*/
this.iceConfig = {iceServers: new Map(media.rawLink.combo).get('default')};
this.defineListeners();
}
defineListeners(){
//Run derived method
super.defineListeners();
//Disable right clicking
this.video.addEventListener('contextmenu', (e)=>{e.preventDefault()});
}
start(){
//call derived start function
super.start();
//Lock the player
this.setPlayerLock(true);
}
setVideoTitle(title){
//Add title as text content for security :P
this.player.title.innerText = `: ${utils.unescapeEntities(title)}`;
//Create glow span
const glowSpan = document.createElement('span');
//Fill glow span content
glowSpan.innerText = "🔴LIVE";
//Set glowspan class
glowSpan.classList.add('critical-danger-text');
//Inject glowspan into title in a way that allows it to be easily replaced
this.player.title.prepend(glowSpan);
}
}