Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
radiopanik
panikweb
Commits
9296e2c6
Commit
9296e2c6
authored
Aug 21, 2013
by
Simon Daron
Browse files
Rewritin onair player with JSON
parent
a236551c
Changes
1
Hide whitespace changes
Inline
Side-by-side
panikweb_templates/templates/player/detail.html
View file @
9296e2c6
...
...
@@ -5,8 +5,7 @@
<span
class=
"control icon-volume-up resymbol huge"
></span>
<span
class=
"label"
>
en direct
</span>
</button>
<div
id=
"WhatsOnAir"
>
{% include "whatsonair.html" %}
</div>
<div
id=
"WhatsOnAir"
></div>
<audio
id=
"DirectStreamPanik"
class=
"hidden"
tabindex=
"0"
src=
"http://streaming.domainepublic.net:8000/radiopanik.ogg"
controls=
"controls"
>
</audio>
<ul
class=
"inline metas small"
>
...
...
@@ -24,9 +23,16 @@
var
timer
=
null
,
interval
=
5000
;
$
(
'
#WhatsOnAir
'
).
on
(
'
load
'
,
function
(){
$
(
this
).
fadeOut
().
load
(
'
what
'
).
fadeIn
();
/*$(this).load('test'});*/
});
var
self
=
$
(
this
);
self
.
fadeOut
();
$
.
getJSON
(
'
onair.json
'
,
function
(
data
)
{
if
(
data
.
episode
||
data
.
emission
){
self
.
html
(
'
<strong>
'
+
data
.
emission
.
title
+
'
<strong>
'
+
'
<span>
'
+
data
.
emission
.
title
+
'
<span>
'
);
}
else
{
self
.
html
(
'
<strong>Probably Non-Stop<strong>
'
);}
self
.
fadeIn
();
});
}).
trigger
(
'
load
'
);
$
(
'
#RefreshWhatsOnAir
'
).
on
(
'
activate
'
,
function
(
e
){
$
(
this
).
addClass
(
'
spinning
'
);
$
(
'
#WhatsOnAir
'
).
trigger
(
'
load
'
);
...
...
@@ -43,8 +49,6 @@
});
$
(
"
[data-audio-id]
"
).
click
(
function
(
e
)
{
e
.
preventDefault
();
// This next line will get the audio element
// that is adjacent to the link that was clicked.
var
song
=
$
(
'
#
'
+
$
(
this
).
attr
(
'
data-audio-id
'
)).
get
(
0
);
if
(
song
.
paused
){
song
.
play
();
$
(
'
#RefreshWhatsOnAir
'
).
trigger
(
'
activate
'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment