Player update from https://github.com/wifiblog/playerHtml5-Libretime
This commit is contained in:
parent
546980249e
commit
83862cfb8e
3 changed files with 50 additions and 182 deletions
20
airtime_mvc/public/js/airtime/player/playerhtml5.js
Normal file
20
airtime_mvc/public/js/airtime/player/playerhtml5.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
function getRandomIdPlayer(max) {
|
||||
return "playerHtml5Libretime_"+Math.floor(Math.random() * Math.floor(max));
|
||||
}
|
||||
|
||||
function playerhtml5_insert(settings)
|
||||
{
|
||||
atp='';
|
||||
if(settings.autoplay==true) atp='autoplay';
|
||||
if(settings.forceHTTPS==true&&settings.url.indexOf('https')==-1) settings.url=settings.url.replace(/http/g, 'https');
|
||||
if(settings.replacePort!=''&&settings.replacePort!=false&&settings.replacePort!='false')
|
||||
{
|
||||
if(settings.replacePortTo!='') settings.replacePortTo=':'+settings.replacePortTo;
|
||||
settings.url=settings.url.replace(':'+settings.replacePort, settings.replacePortTo);
|
||||
}
|
||||
if(settings.codec=='mp3') settings.codec='mpeg';
|
||||
document.getElementById('html5player_skin').innerHTML += '<div id="div_'+settings.elementId+'" style="" ><audio loop controls id="'+settings.elementId+'" src="'+settings.url+'" '+atp+' type="audio/'+settings.codec+'" >'
|
||||
+'Ihr Browser unterstützt das Element <code>audio</code> nicht.'
|
||||
+'<\/audio><\/div>';
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue