CC-2301 : only showing waveform buttons if the browser supports the audio api.

This commit is contained in:
Naomi 2013-05-03 14:42:42 -04:00
parent 3fc6a0fbae
commit 75e4e0c9b6
3 changed files with 17 additions and 2 deletions

View File

@ -367,6 +367,7 @@ SQL;
$row->setDbFadeout(Application_Common_DateHelper::secondsToPlaylistTime($info["fadeout"]));
if ($info["ftype"] == "audioclip") {
$row->setDbFileId($info["id"]);
$row->setDbTrackOffset($info["crossfadeDuration"]);
$type = 0;
} elseif ($info["ftype"] == "stream") {
$row->setDbStreamId($info["id"]);

View File

@ -1,5 +1,7 @@
<div data-uri="<?php echo $this->uri; ?>"><input type="button" class="pl-waveform-cues-btn" value="Show Waveform"></input></div>
<dl id="spl_cue_editor" class="inline-list">
<dd data-uri="<?php echo $this->uri; ?>">
<input type="button" class="pl-waveform-cues-btn" value="Show Waveform"></input>
</dd>
<dt><? echo _("Cue In: "); ?><span class='spl_cue_hint'><? echo _("(hh:mm:ss.t)")?></span></dt>
<dd id="spl_cue_in_<?php echo $this->id; ?>" class="spl_cue_in" data-cue-in="<?php echo $this->cueIn; ?>">
<span contenteditable="true" class="spl_text_input"><?php echo $this->cueIn; ?></span>

View File

@ -370,6 +370,8 @@ var AIRTIME = (function(AIRTIME){
}
function setPlaylistContent(json) {
var $html = $(json.html);
$('#spl_name > a')
.empty()
.append(json.name);
@ -383,7 +385,7 @@ var AIRTIME = (function(AIRTIME){
$('#spl_sortable').off('focusout keydown');
$('#spl_sortable')
.empty()
.append(json.html);
.append($html);
setCueEvents();
setFadeEvents();
setModified(json.modified);
@ -593,6 +595,11 @@ var AIRTIME = (function(AIRTIME){
temp.on("focusout", ".spl_cue_out span", changeCueOut);
temp.on("keydown", ".spl_cue_out span", submitOnEnter);
//remove show waveform buttons since web audio api is not supported.
if (!(window.AudioContext || window.webkitAudioContext)) {
temp.find('.pl-waveform-cues-btn').parent().remove();
}
}
//sets events dynamically for the fade editor.
@ -603,6 +610,11 @@ var AIRTIME = (function(AIRTIME){
temp.on("focusout", ".spl_fade_out span", changeFadeOut);
temp.on("keydown", ".spl_fade_out span", submitOnEnter);
//remove show waveform buttons since web audio api is not supported.
if (!(window.AudioContext || window.webkitAudioContext)) {
temp.find('.pl-waveform-fades-btn').parent().remove();
}
}
function initialEvents() {