mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Improvements to embedded player
This commit is contained in:
@@ -96,7 +96,7 @@ window.addEventListener("DOMContentLoaded", function() {
|
||||
});
|
||||
color = "#" + hash[1];
|
||||
add = "https://zoff.me";
|
||||
if(window.location.hostname == "localhost") add = "localhost";
|
||||
//if(window.location.hostname == "localhost") add = "localhost";
|
||||
//add = "localhost";
|
||||
socket = io.connect(''+add+':8080', connection_options);
|
||||
|
||||
|
||||
@@ -94,6 +94,7 @@ var Player = {
|
||||
seekTo = (time - conf.startTime) + Player.np.start;
|
||||
Player.getTitle(song_title, viewers);
|
||||
if(((embed && autoplay) || !embed) && !was_stopped && !client) {
|
||||
console.log(embed, autoplay);
|
||||
Helper.log(["loadVideoById \nwas_stopped="+was_stopped+"\noffline="+offline])
|
||||
Player.loadVideoById(Player.np.id, duration, Player.np.start, Player.np.end);
|
||||
} else if(!client) {
|
||||
@@ -386,11 +387,14 @@ var Player = {
|
||||
Helper.css(document.getElementById("player_overlay"), "background", "none");
|
||||
Helper.addClass("#player_overlay_text", "hide");
|
||||
Helper.addClass(document.getElementById("player_overlay"), "hide");
|
||||
if(embed) {
|
||||
Helper.css("#player", "visibility", "visible");
|
||||
}
|
||||
try {
|
||||
if(Player.player.getVideoUrl().indexOf(id) > -1) {
|
||||
Player.player.seekTo(seekTo);
|
||||
} else {
|
||||
Player.player.loadVideoById({'videoId': id, 'startSeconds': s, 'endSeconds': e});
|
||||
Player.player.loadVideoById({'videoId': id, 'startSeconds': s + seekTo, 'endSeconds': e});
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
@@ -712,7 +716,7 @@ var Player = {
|
||||
if(!durationBegun) {
|
||||
Player.durationSetter();
|
||||
}
|
||||
if(embed){
|
||||
/*if(embed){
|
||||
//setTimeout(function(){
|
||||
//Player.player.seekTo(seekTo);
|
||||
if(!autoplay){
|
||||
@@ -723,7 +727,7 @@ var Player = {
|
||||
}
|
||||
//}, 1000);
|
||||
}else
|
||||
Player.seekTo(seekTo);
|
||||
Player.seekTo(seekTo);*/
|
||||
}
|
||||
Player.player.setVolume(Crypt.get_volume());
|
||||
Player.readyLooks();
|
||||
|
||||
@@ -194,6 +194,7 @@ var Search = {
|
||||
SC.get('/tracks', {
|
||||
q: keyword
|
||||
}).then(function(tracks) {
|
||||
console.log(tracks);
|
||||
var pre_result = document.createElement("div");
|
||||
pre_result.innerHTML = result_html.outerHTML;
|
||||
|
||||
|
||||
@@ -10,8 +10,10 @@ window.addEventListener("DOMContentLoaded", function(e) {
|
||||
ga('send', 'pageview');
|
||||
|
||||
if(!Helper.mobilecheck()) {
|
||||
if(document.querySelector("#iframe-container")) {
|
||||
document.getElementById("iframe-container").insertAdjacentHTML("beforeend", '<iframe id="iframe" src="https://zoff.me/_embed#celebrate&808080" width="600px" height="300px"></iframe>');
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementsByClassName("token-form")[0].addEventListener("submit", function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user