Finished up with player UI-Bar functionality, including 'reload' and 'sync' controls.
This commit is contained in:
parent
6dc9ad7b34
commit
f38eae170d
7 changed files with 222 additions and 50 deletions
|
|
@ -39,10 +39,10 @@ module.exports = class{
|
|||
const mediaObj = queuedMedia.fromMedia(inputMedia, new Date().getTime());
|
||||
|
||||
//Start playback
|
||||
this.play(mediaObj);
|
||||
this.start(mediaObj);
|
||||
}
|
||||
|
||||
play(mediaObj){
|
||||
start(mediaObj){
|
||||
//Silently end the media
|
||||
this.end(true);
|
||||
|
||||
|
|
@ -109,11 +109,11 @@ module.exports = class{
|
|||
//If a socket is specified
|
||||
if(socket != null){
|
||||
//Send data out to specified socket
|
||||
socket.emit("play", data);
|
||||
socket.emit("start", data);
|
||||
//Otherwise
|
||||
}else{
|
||||
//Send that shit out to the entire channel
|
||||
this.server.io.in(this.channel.name).emit("play", data);
|
||||
this.server.io.in(this.channel.name).emit("start", data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ module.exports = class{
|
|||
//Pull media list
|
||||
const mediaList = await this.yankMedia(data.url);
|
||||
//Get active channel from server/socket
|
||||
const chan = this.server.activeChannels.get(socket.chan)
|
||||
const chan = this.server.activeChannels.get(socket.chan);
|
||||
//Queue the first media object given
|
||||
chan.queue.queueMedia(mediaList[0]);
|
||||
}catch(err){
|
||||
|
|
@ -54,11 +54,11 @@ module.exports = class{
|
|||
}
|
||||
|
||||
async yankMedia(url){
|
||||
const pullType = await this.getMediaType(url)
|
||||
const pullType = await this.getMediaType(url);
|
||||
|
||||
if(pullType == 'ia'){
|
||||
//Create empty list to hold media objects
|
||||
const mediaList = []
|
||||
const mediaList = [];
|
||||
//Pull metadata from IA
|
||||
const mediaInfo = await iaUtil.fetchMetadata(url);
|
||||
|
||||
|
|
@ -69,17 +69,17 @@ module.exports = class{
|
|||
//pull filename from path
|
||||
const name = path[path.length - 1];
|
||||
//Construct link from pulled info
|
||||
const link = `https://archive.org/download/${mediaInfo.metadata.identifier}/${file.name}`
|
||||
const link = `https://archive.org/download/${mediaInfo.metadata.identifier}/${file.name}`;
|
||||
|
||||
//Create new media object from file info
|
||||
mediaList.push(new media(name, name, link, 'ia', Number(file.length)));
|
||||
}
|
||||
|
||||
//return media object list
|
||||
return mediaList
|
||||
return mediaList;
|
||||
}else{
|
||||
//return null to signify a bad url
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ module.exports = class{
|
|||
//Check if we have a valid url
|
||||
if(!validator.isURL(url)){
|
||||
//If not toss the fucker out
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
//If we have link to a resource from archive.org
|
||||
|
|
|
|||
|
|
@ -16,16 +16,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
|
|||
|
||||
<div class="media-panel" id="media-panel-div">
|
||||
<div class="media-panel panel-head-div" id="media-panel-head-div">
|
||||
<i class="media-panel panel-head-element bi-caret-down-fill" id="media-panel-div-toggle-icon"></i>
|
||||
<p class="media-panel panel-head-element" id="media-panel-title-paragraph">Currently Playing: <span id="media-panel-title-span">NULL</span></p>
|
||||
<i title="Hide Player" class="media-panel panel-head-element bi-caret-down-fill" id="media-panel-div-toggle-icon"></i>
|
||||
<p class="media-panel panel-head-element" id="media-panel-title-paragraph"> - </p>
|
||||
<span class="media-panel panel-head-spacer-span" id="media-panel-head-spacer-span"></span>
|
||||
<i class="media-panel panel-head-element bi-arrow-repeat" id="media-panel-sync-icon"></i>
|
||||
<i class="media-panel panel-head-element bi-aspect-ratio-fill" id="media-panel-aspect-lock-icon"></i>
|
||||
<i class="media-panel panel-head-element bi-film" id="media-panel-cinema-mode-icon"></i>
|
||||
<i class="media-panel panel-head-element bi-arrows-vertical" id="media-panel-flip-vertical-icon"></i>
|
||||
<i class="media-panel panel-head-element bi-arrows" id="media-panel-flip-horizontal-icon"></i>
|
||||
<i class="media-panel panel-head-element bi-arrow-clockwise" id="media-panel-reload-icon"></i>
|
||||
<i class="media-panel panel-head-element bi-chat-right-dots-fill" id="media-panel-show-chat-icon"></i>
|
||||
<i title="Synchronize" class="media-panel panel-head-element bi-arrow-repeat" id="media-panel-sync-icon"></i>
|
||||
<i title="Lock Chat Size to Video Aspect Ratio" class="media-panel panel-head-element bi-aspect-ratio-fill" id="media-panel-aspect-lock-icon"></i>
|
||||
<i title="Cinema Mode" class="media-panel panel-head-element bi-film" id="media-panel-cinema-mode-icon"></i>
|
||||
<i title="Horizontal Flip" class="media-panel panel-head-element bi-arrows-vertical" id="media-panel-flip-vertical-icon"></i>
|
||||
<i title="Vertical Flip" class="media-panel panel-head-element bi-arrows" id="media-panel-flip-horizontal-icon"></i>
|
||||
<i title="Reload Media" class="media-panel panel-head-element bi-arrow-clockwise" id="media-panel-reload-icon"></i>
|
||||
<i title="Show Chat" class="media-panel panel-head-element bi-chat-right-dots-fill" id="media-panel-show-chat-icon"></i>
|
||||
</div>
|
||||
<div id="media-panel-video-container">
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue