Merge branch '2.2.x' of dev.sourcefabric.org:airtime into 2.2.x
This commit is contained in:
commit
df54a75d5d
6 changed files with 33 additions and 13 deletions
|
@ -278,6 +278,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
||||||
'element_artist' => isset($track['creator']) ? $track['creator'] : "",
|
'element_artist' => isset($track['creator']) ? $track['creator'] : "",
|
||||||
'element_position' => $position,
|
'element_position' => $position,
|
||||||
'element_id' => ++$position,
|
'element_id' => ++$position,
|
||||||
|
'mime' => isset($track['mime'])?$track['mime']:""
|
||||||
);
|
);
|
||||||
|
|
||||||
$elementMap['type'] = $track['type'];
|
$elementMap['type'] = $track['type'];
|
||||||
|
|
|
@ -16,12 +16,12 @@ class Application_Model_PlayoutHistory
|
||||||
private $opts;
|
private $opts;
|
||||||
|
|
||||||
private $mDataPropMap = array(
|
private $mDataPropMap = array(
|
||||||
"artist" => "file.artist_name",
|
"artist" => "artist_name",
|
||||||
"title" => "file.track_title",
|
"title" => "track_title",
|
||||||
"played" => "playout.played",
|
"played" => "played",
|
||||||
"length" => "file.length",
|
"length" => "length",
|
||||||
"composer" => "file.composer",
|
"composer" => "composer",
|
||||||
"copyright" => "file.copyright",
|
"copyright" => "copyright",
|
||||||
);
|
);
|
||||||
|
|
||||||
public function __construct($p_startDT, $p_endDT, $p_opts)
|
public function __construct($p_startDT, $p_endDT, $p_opts)
|
||||||
|
|
|
@ -677,7 +677,8 @@ FROM (
|
||||||
f.length AS length,
|
f.length AS length,
|
||||||
f.artist_name AS creator,
|
f.artist_name AS creator,
|
||||||
f.file_exists AS EXISTS,
|
f.file_exists AS EXISTS,
|
||||||
f.filepath AS filepath
|
f.filepath AS filepath,
|
||||||
|
f.mime AS mime
|
||||||
FROM cc_schedule AS s
|
FROM cc_schedule AS s
|
||||||
LEFT JOIN cc_files AS f ON f.id = s.file_id
|
LEFT JOIN cc_files AS f ON f.id = s.file_id
|
||||||
WHERE s.instance_id = :instance_id1
|
WHERE s.instance_id = :instance_id1
|
||||||
|
@ -693,7 +694,8 @@ FROM (
|
||||||
ws.length AS length,
|
ws.length AS length,
|
||||||
sub.login AS creator,
|
sub.login AS creator,
|
||||||
't'::boolean AS EXISTS,
|
't'::boolean AS EXISTS,
|
||||||
ws.url AS filepath
|
ws.url AS filepath,
|
||||||
|
ws.mime as mime
|
||||||
FROM cc_schedule AS s
|
FROM cc_schedule AS s
|
||||||
LEFT JOIN cc_webstream AS ws ON ws.id = s.stream_id
|
LEFT JOIN cc_webstream AS ws ON ws.id = s.stream_id
|
||||||
LEFT JOIN cc_subjs AS sub ON ws.creator_id = sub.id
|
LEFT JOIN cc_subjs AS sub ON ws.creator_id = sub.id
|
||||||
|
|
|
@ -123,6 +123,7 @@ function buildplaylist(p_url, p_playIndex) {
|
||||||
var media;
|
var media;
|
||||||
var index;
|
var index;
|
||||||
var total = 0;
|
var total = 0;
|
||||||
|
var skipped = 0;
|
||||||
for(index in data) {
|
for(index in data) {
|
||||||
if (data[index]['type'] == 0) {
|
if (data[index]['type'] == 0) {
|
||||||
if (data[index]['element_mp3'] != undefined){
|
if (data[index]['element_mp3'] != undefined){
|
||||||
|
@ -145,6 +146,11 @@ function buildplaylist(p_url, p_playIndex) {
|
||||||
artist: data[index]['element_artist'],
|
artist: data[index]['element_artist'],
|
||||||
wav:data[index]['uri']
|
wav:data[index]['uri']
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
// skip this track since it's not supported
|
||||||
|
console.log("continue");
|
||||||
|
skipped++;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
} else if (data[index]['type'] == 1) {
|
} else if (data[index]['type'] == 1) {
|
||||||
media = {title: data[index]['element_title'],
|
media = {title: data[index]['element_title'],
|
||||||
|
@ -152,15 +158,18 @@ function buildplaylist(p_url, p_playIndex) {
|
||||||
mp3:data[index]['uri']
|
mp3:data[index]['uri']
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
console.log(data[index]);
|
||||||
if (media && isAudioSupported(data[index]['mime'])) {
|
if (media && isAudioSupported(data[index]['mime'])) {
|
||||||
myPlaylist[index] = media;
|
// javascript doesn't support associative array with numeric key
|
||||||
|
// so we need to remove the gap if we skip any of tracks due to
|
||||||
|
// browser incompatibility.
|
||||||
|
myPlaylist[index-skipped] = media;
|
||||||
}
|
}
|
||||||
// we should create a map according to the new position in the
|
// we should create a map according to the new position in the
|
||||||
// player itself total is the index on the player
|
// player itself total is the index on the player
|
||||||
_idToPostionLookUp[data[index]['element_id']] = total;
|
_idToPostionLookUp[data[index]['element_id']] = total;
|
||||||
total++;
|
total++;
|
||||||
}
|
}
|
||||||
|
|
||||||
_playlist_jplayer.setPlaylist(myPlaylist);
|
_playlist_jplayer.setPlaylist(myPlaylist);
|
||||||
_playlist_jplayer.option("autoPlay", true);
|
_playlist_jplayer.option("autoPlay", true);
|
||||||
play(p_playIndex);
|
play(p_playIndex);
|
||||||
|
|
|
@ -366,7 +366,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
//and verify whether they can be previewed by the browser or not. If not
|
//and verify whether they can be previewed by the browser or not. If not
|
||||||
//then the playlist element is greyed out
|
//then the playlist element is greyed out
|
||||||
mod.validatePlaylistElements = function(){
|
mod.validatePlaylistElements = function(){
|
||||||
$.each($(".big_play ui-icon-play"), function(index, value){
|
$.each($("div .big_play"), function(index, value){
|
||||||
if ($(value).attr('blockId') === undefined) {
|
if ($(value).attr('blockId') === undefined) {
|
||||||
var mime = $(value).attr("data-mime-type");
|
var mime = $(value).attr("data-mime-type");
|
||||||
if (isAudioSupported(mime)) {
|
if (isAudioSupported(mime)) {
|
||||||
|
|
|
@ -399,7 +399,15 @@ class PypoPush(Thread):
|
||||||
|
|
||||||
|
|
||||||
def date_interval_to_seconds(self, interval):
|
def date_interval_to_seconds(self, interval):
|
||||||
return (interval.microseconds + (interval.seconds + interval.days * 24 * 3600) * 10 ** 6) / float(10 ** 6)
|
"""
|
||||||
|
Convert timedelta object into int representing the number of seconds. If
|
||||||
|
number of seconds is less than 0, then return 0.
|
||||||
|
"""
|
||||||
|
seconds = (interval.microseconds + \
|
||||||
|
(interval.seconds + interval.days * 24 * 3600) * 10 ** 6) / float(10 ** 6)
|
||||||
|
if seconds < 0: seconds = 0
|
||||||
|
|
||||||
|
return seconds
|
||||||
|
|
||||||
def push_to_liquidsoap(self, event_chain):
|
def push_to_liquidsoap(self, event_chain):
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue