CC-5768 : jPlayer, make now playing and playlist preview buttons function
disable preview in playlist for items browser can't play.
This commit is contained in:
parent
b641f15b32
commit
3953cd8a7e
|
@ -2,7 +2,6 @@
|
||||||
$items = $this->contents;
|
$items = $this->contents;
|
||||||
if (count($items)) : ?>
|
if (count($items)) : ?>
|
||||||
<?php foreach($items as $item):
|
<?php foreach($items as $item):
|
||||||
|
|
||||||
$media = $item->getMediaItem();
|
$media = $item->getMediaItem();
|
||||||
$class = "Presentation_PlaylistItem" . $media->getType();
|
$class = "Presentation_PlaylistItem" . $media->getType();
|
||||||
$p = new $class($item);
|
$p = new $class($item);
|
||||||
|
@ -21,7 +20,6 @@ if (count($items)) : ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<div class="list-item-container">
|
<div class="list-item-container">
|
||||||
|
|
||||||
<?php if ($p->canPreview()):?>
|
<?php if ($p->canPreview()):?>
|
||||||
<div class="big_play">
|
<div class="big_play">
|
||||||
<span class="ui-icon ui-icon-play"></span>
|
<span class="ui-icon ui-icon-play"></span>
|
||||||
|
@ -31,24 +29,20 @@ if (count($items)) : ?>
|
||||||
<span class="ui-icon ui-icon-alert"></span>
|
<span class="ui-icon ui-icon-alert"></span>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="text-row top">
|
<div class="text-row top">
|
||||||
<span class="spl_playlength"><?php echo $p->getCliplength(); ?></span>
|
<span class="spl_playlength"><?php echo $p->getCliplength(); ?></span>
|
||||||
|
|
||||||
<?php if ($p->canEditCues()):?>
|
<?php if ($p->canEditCues()):?>
|
||||||
<span class="spl_cue ui-state-default"></span>
|
<span class="spl_cue ui-state-default"></span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($p->canEditFades()):?>
|
<?php if ($p->canEditFades()):?>
|
||||||
<span class="spl_fade spl_cue ui-state-default">fade</span>
|
<span class="spl_fade spl_cue ui-state-default">fade</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<span class="spl_title"><?php echo $p->getTitle(); ?></span>
|
<span class="spl_title"><?php echo $p->getTitle(); ?></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-row">
|
<div class="text-row">
|
||||||
<span class="spl_artist"><?php echo $p->getCreator(); ?></span>
|
<span class="spl_artist"><?php echo $p->getCreator(); ?></span>
|
||||||
<span class="spl_offset"><?php echo $p->getOffset(); ?></span>
|
<span class="spl_offset"><?php echo $p->getOffset(); ?></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="fade_0" class="spl_fade_control ui-state-default"></div>
|
<div id="fade_0" class="spl_fade_control ui-state-default"></div>
|
||||||
<span class="ui-icon ui-icon-closethick"></span>
|
<span class="ui-icon ui-icon-closethick"></span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -77,9 +71,8 @@ if (count($items)) : ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li class="spl_empty">
|
<li class="spl_empty">
|
||||||
<?php echo _("Empty playlist"); ?>
|
<?php echo _("Empty playlist"); ?>
|
||||||
</li>
|
</li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
|
@ -43,8 +43,6 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
bMime = mime;
|
bMime = mime;
|
||||||
}
|
}
|
||||||
|
|
||||||
var x = audio.canPlayType(bMime);
|
|
||||||
|
|
||||||
//return a true of the browser can play this file natively, or if the
|
//return a true of the browser can play this file natively, or if the
|
||||||
//file is an mp3 and flash is installed (jPlayer will fall back to flash to play mp3s).
|
//file is an mp3 and flash is installed (jPlayer will fall back to flash to play mp3s).
|
||||||
//Note that checking the navigator.mimeTypes value does not work for IE7, but the alternative
|
//Note that checking the navigator.mimeTypes value does not work for IE7, but the alternative
|
||||||
|
|
|
@ -487,25 +487,46 @@ var AIRTIME = (function(AIRTIME){
|
||||||
$(".input_date").datetimepicker();
|
$(".input_date").datetimepicker();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkPlayability($contents) {
|
||||||
|
|
||||||
|
$contents.each(function(index, element) {
|
||||||
|
var $el = $(element),
|
||||||
|
mime = $el.data("mimeType");
|
||||||
|
|
||||||
|
if (!AIRTIME.playerPreview.isAudioSupported(mime)) {
|
||||||
|
$el.find(".big_play").attr("class", "big_play_disabled dark_class");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
mod.redrawPlaylist = function redrawPlaylist(data) {
|
mod.redrawPlaylist = function redrawPlaylist(data) {
|
||||||
var $wrapper = $("div.wrapper"),
|
var $wrapper = $("div.wrapper"),
|
||||||
$playlist = $("#side_playlist");
|
$playlist = $("#side_playlist"),
|
||||||
|
$newContent = $(data.html),
|
||||||
|
$contents;
|
||||||
|
|
||||||
$playlist.detach();
|
$playlist.detach();
|
||||||
|
|
||||||
$playlist.find("#playlist_lastmod").val(data.modified);
|
$playlist.find("#playlist_lastmod").val(data.modified);
|
||||||
$playlist.find("#playlist_length").text(data.length);
|
$playlist.find("#playlist_length").text(data.length);
|
||||||
$playlist.find("#spl_sortable").html(data.html).sortable("refresh");
|
$playlist.find("#spl_sortable").html($newContent).sortable("refresh");
|
||||||
|
|
||||||
|
$contents = $playlist.find("#spl_sortable").find("li");
|
||||||
|
checkPlayability($contents);
|
||||||
|
|
||||||
$wrapper.append($playlist);
|
$wrapper.append($playlist);
|
||||||
};
|
};
|
||||||
|
|
||||||
mod.drawPlaylist = function drawPlaylist(data) {
|
mod.drawPlaylist = function drawPlaylist(data) {
|
||||||
var $playlist = $("#side_playlist");
|
var $playlist = $("#side_playlist"),
|
||||||
|
$newContent = $(data.html),
|
||||||
|
$contents = $newContent.find("#spl_sortable").find("li");
|
||||||
|
|
||||||
|
checkPlayability($contents);
|
||||||
|
|
||||||
$playlist
|
$playlist
|
||||||
.empty()
|
.empty()
|
||||||
.append(data.html);
|
.append($newContent);
|
||||||
|
|
||||||
makeSortable();
|
makeSortable();
|
||||||
};
|
};
|
||||||
|
@ -629,11 +650,12 @@ var AIRTIME = (function(AIRTIME){
|
||||||
|
|
||||||
mod.onReady = function() {
|
mod.onReady = function() {
|
||||||
|
|
||||||
var $playlist = $("#side_playlist");
|
var $playlist = $("#side_playlist"),
|
||||||
|
$contents = $("#spl_sortable").find("li");
|
||||||
|
|
||||||
setupCriteriaOptions();
|
setupCriteriaOptions();
|
||||||
|
|
||||||
addDatePickers();
|
addDatePickers();
|
||||||
|
checkPlayability($contents);
|
||||||
|
|
||||||
$playlist.on("click", "#spl_AND", function(e) {
|
$playlist.on("click", "#spl_AND", function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
Loading…
Reference in New Issue