Html #3
@@ -60,6 +60,14 @@ body {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
#audioplayerdivstop {
|
||||
margin-bottom: 160px;
|
||||
}
|
||||
|
||||
#playicon {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
#ws:link {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
|
||||
+73
-18
@@ -4,7 +4,6 @@ $(document).ready((function(){$("[data-bss-hover-animate]").mouseenter((function
|
||||
/*! js-cookie v3.0.1 | MIT */
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}return function t(n,o){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+c}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var i=t[r].split("="),c=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(o[u]=n.read(c,u),e===u)break}catch(e){}}return e?o[e]:o}},remove:function(t,n){r(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}));
|
||||
|
||||
|
||||
jQuery(function($) {
|
||||
$("#rss-feeds").rss("https://anchor.fm/s/af11b98/podcast/rss", {
|
||||
limit: 1000,
|
||||
@@ -49,12 +48,31 @@ jQuery(function($) {
|
||||
'top': $("#playerwindow").data('origionalTop')
|
||||
});
|
||||
topFunction();
|
||||
document.getElementById("player").pause();
|
||||
});
|
||||
|
||||
$(".closewin").click(function() {
|
||||
$("#playerwindow").css({
|
||||
'left': $("#playerwindow").data('originalLeft'),
|
||||
'top': $("#playerwindow").data('origionalTop')
|
||||
});
|
||||
topFunction();
|
||||
document.getElementById("sbody").innerHTML= "";
|
||||
document.getElementById("player").pause();
|
||||
keeplastepcache();
|
||||
document.getElementById("player").setAttribute('src', "");
|
||||
document.getElementById("lienep").href = "";
|
||||
document.getElementById("nomep").innerHTML = "<a id='lienep' target='_blank'>Pas d'épisode en cours</a>";
|
||||
document.getElementById("epstab").innerHTML = "épisodes";
|
||||
clearcache();
|
||||
});
|
||||
|
||||
var audio = document.getElementById('player');
|
||||
console.log(audio.src);
|
||||
|
||||
// check if ep is in cache
|
||||
|
||||
checkepcache();
|
||||
|
||||
// cookie last playback
|
||||
if (Cookies.get("lastep-title")) {
|
||||
console.log("playback function")
|
||||
@@ -66,13 +84,54 @@ jQuery(function($) {
|
||||
}
|
||||
|
||||
audio.addEventListener('timeupdate',function(){
|
||||
var currentTime = audio.currentTime;
|
||||
Cookies.set("lastep-time", currentTime);
|
||||
var currentTime = audio.currentTime;
|
||||
Cookies.set("lastep-time", currentTime);
|
||||
Cookies.set("lastep-time", currentTime, { expires: 365 });
|
||||
},false);
|
||||
});
|
||||
|
||||
function checkepcache(){
|
||||
if (Cookies.get("lastep-src")){
|
||||
console.log("yahh");
|
||||
const epstab = document.getElementById("epstab");
|
||||
playicon();
|
||||
};
|
||||
}
|
||||
|
||||
function keeplastepcache(){
|
||||
Cookies.set("lastep_b4close-title", document.getElementById("lienep").innerHTML, { expires: 365 });
|
||||
Cookies.set("lastep_b4close-time", document.getElementById("player").currentTime, { expires: 365 });
|
||||
}
|
||||
|
||||
function clearcache(){
|
||||
Cookies.remove("lastep-title");
|
||||
Cookies.remove("lastep-body");
|
||||
Cookies.remove("lastep-src");
|
||||
Cookies.remove("lastep-time");
|
||||
}
|
||||
|
||||
// player things
|
||||
|
||||
function playicon(){
|
||||
const epstab = document.getElementById("epstab");
|
||||
if (document.getElementById("lienep").src = "")
|
||||
{
|
||||
epstab.innerHTML = "épisodes";
|
||||
}
|
||||
else {
|
||||
console.log("ayyyy");
|
||||
epstab.innerHTML = "<img id='playicon' src='assets/img/spek.icon.svg' width='20px'></img>" + " épisodes";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function stopplayer(){
|
||||
document.getElementById("lienep").innerHTML= title;
|
||||
document.getElementById("sbody").innerHTML= body + "....";
|
||||
document.getElementById("lienep").href= linkdec;
|
||||
}
|
||||
|
||||
function play(src, title, date, body) {
|
||||
var audio = document.getElementById('player');
|
||||
console.log(src);
|
||||
@@ -83,18 +142,18 @@ jQuery(function($) {
|
||||
document.getElementById("lienep").innerHTML= title;
|
||||
document.getElementById("sbody").innerHTML= body + "....";
|
||||
document.getElementById("lienep").href= linkdec;
|
||||
document.getElementById("player").pause();
|
||||
document.getElementById("player").setAttribute('src', linkdec);
|
||||
document.getElementById("player").load();
|
||||
document.getElementById("player").play();
|
||||
Cookies.set("lastep-title", title)
|
||||
Cookies.set("lastep-src", audio.src);
|
||||
Cookies.set("lastep-body", body)
|
||||
audio.pause();
|
||||
audio.setAttribute('src', linkdec);
|
||||
if (title == Cookies.get("lastep_b4close-title")){
|
||||
audio.currentTime = Cookies.get("lastep_b4close-time");
|
||||
}
|
||||
audio.load();
|
||||
audio.play();
|
||||
Cookies.set("lastep-title", title, { expires: 365 });
|
||||
Cookies.set("lastep-src", audio.src, { expires: 365 });
|
||||
Cookies.set("lastep-body", body, { expires: 365 });
|
||||
checkepcache();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function switchTab() {
|
||||
$('[href="#ep"]').tab('show');
|
||||
@@ -126,7 +185,3 @@ jQuery(function($) {
|
||||
var imagenumber = currentdate.getDay();
|
||||
document.getElementById("meme").src = imlocation + image[imagenumber];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user