Added improved settings panel.
This commit is contained in:
parent
306f22aa93
commit
132fdabb29
105 changed files with 3447 additions and 252 deletions
|
|
@ -135,19 +135,19 @@ class player{
|
|||
/**
|
||||
* Tolerance between timestamp from server and actual media before corrective seek for pre-recorded media
|
||||
*/
|
||||
this.syncTolerance = 0.4;
|
||||
this.syncTolerance = localStorage.getItem('syncTolerance');
|
||||
|
||||
/**
|
||||
* Tolerance in livestream delay before corrective seek to live.
|
||||
*
|
||||
* Might seem weird to keep this here instead of the HLS handler, but remember we may want to support other livestream services in the future...
|
||||
*/
|
||||
this.streamSyncTolerance = 2;
|
||||
this.streamSyncTolerance = localStorage.getItem('liveSyncTolerance');
|
||||
|
||||
/**
|
||||
* Forced time to wait between sync checks, heavily decreases chance of seek-banging without reducing syncornization accuracy
|
||||
*/
|
||||
this.syncDelta = 6;
|
||||
this.syncDelta = localStorage.getItem('syncDelta');
|
||||
|
||||
/**
|
||||
* Current Player Volume
|
||||
|
|
@ -220,6 +220,18 @@ class player{
|
|||
this.mediaHandler = new hlsDailymotionHandler(this.client, this, data.media);
|
||||
//Otherwise, if we have a raw-file compatible source
|
||||
}else if(data.media.type == 'ia' || data.media.type == 'raw' || data.media.type == 'yt' || data.media.type == 'dm'){
|
||||
//If we're running a source from IA
|
||||
if(data.media.type == 'ia'){
|
||||
//Replace specified CDN with generic URL, in-case of hard reload
|
||||
data.media.rawLink = data.media.rawLink.replace(/^https(.*)archive\.org(.*)items/g, "https://archive.org/download")
|
||||
|
||||
//If we have an IA source and a custom IA CDN Server set
|
||||
if(data.media.type == 'ia' && localStorage.getItem("IACDN") != ""){
|
||||
//Generate and set new link
|
||||
data.media.rawLink = data.media.rawLink.replace("https://archive.org/download", `https://${localStorage.getItem("IACDN")}.archive.org/0/items`);
|
||||
}
|
||||
}
|
||||
|
||||
//Create a new raw file handler for it
|
||||
this.mediaHandler = new rawFileHandler(client, this, data.media);
|
||||
//Sync to time stamp
|
||||
|
|
@ -272,6 +284,27 @@ class player{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys and Re-Creates media handler
|
||||
*/
|
||||
hardReload(){
|
||||
if(this.mediaHandler != null){
|
||||
//Re-create data we'd get from server
|
||||
const data = {
|
||||
media: this.mediaHandler.nowPlaying,
|
||||
timestamp: this.mediaHandler.getTimestamp()
|
||||
}
|
||||
|
||||
//End current media handler
|
||||
this.end();
|
||||
|
||||
console.log(data);
|
||||
|
||||
//Restart from last media handlers
|
||||
this.start(data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles End-Media Commands from the Server
|
||||
*/
|
||||
|
|
@ -474,7 +507,7 @@ class player{
|
|||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Sat Sep 06 2025 01:36:01 GMT-0400 (Eastern Daylight Time)
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Sat Sep 06 2025 10:33:49 GMT-0400 (Eastern Daylight Time)
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue