show all layers
This commit is contained in:
parent
d6a4d9c0ee
commit
4399242fe9
|
@ -81,25 +81,13 @@ function setupPadmaLink(videoObj, data) {
|
|||
var currentLayers = videoObj.getLayersAtTimecode(npt2ms(linkData.tcIn));
|
||||
|
||||
var transcripts = filterLayersByTracks(currentLayers, ['transcript']);
|
||||
// console.log(transcripts);
|
||||
if (transcripts.length > 0) {
|
||||
var annotHtml = transcripts[0].value_html;
|
||||
} else {
|
||||
var annotHtml = '';
|
||||
}
|
||||
$('.annotationText').html(annotHtml);
|
||||
/*
|
||||
var closeBtn = $('<div />')
|
||||
.addClass("close")
|
||||
.click(function() {
|
||||
sidebarAnimateOut();
|
||||
})
|
||||
.text("x")
|
||||
.appendTo('.padmaViewer');
|
||||
*/
|
||||
var videoElem = $('video');
|
||||
// var videoObj = video;
|
||||
|
||||
videoElem.bind("play", function() {
|
||||
var that = this
|
||||
videoObj.interval = setInterval(function() {
|
||||
|
@ -109,10 +97,9 @@ function setupPadmaLink(videoObj, data) {
|
|||
if (videoObj.currentLayers == allLayers) {
|
||||
return;
|
||||
}
|
||||
// GLOBAL_FOO = allLayers;
|
||||
var transcript = filterLayersByTracks(allLayers, ['transcript'])[0].value_html;
|
||||
if (transcript != $('.annotationText').html()) {
|
||||
$('.annotationText').html(transcript);
|
||||
var html = getLayersHtml(time_ms, ['transcript']);
|
||||
if (html != $('.annotationText').html()) {
|
||||
$('.annotationText').html(html);
|
||||
}
|
||||
}, 150);
|
||||
});
|
||||
|
@ -152,6 +139,30 @@ function setupPadmaLink(videoObj, data) {
|
|||
*/
|
||||
}
|
||||
|
||||
|
||||
function getLayersHtml(tc, tracks) {
|
||||
//FIXME: This code is retarded, but we do want a way to group transcripts, descriptions, etc.
|
||||
var currentLayers = videoObj.getLayersAtTimecode(tc);
|
||||
var annotLayers = [];
|
||||
var annotHtml = '';
|
||||
for (var t=0; t < tracks.length; t++) {
|
||||
var thisTrack = tracks[t];
|
||||
var thisTrackLayers = filterLayersByTracks(currentLayers, [thisTrack]);
|
||||
if (thisTrackLayers.length > 0) {
|
||||
annotHtml += thisTrack + "s<br />";
|
||||
}
|
||||
for (var i=0; i < thisTrackLayers.length; i++) {
|
||||
var thisTrack = thisTrackLayers[i];
|
||||
var thisHtml = '';
|
||||
thisHtml += "<span class='padmaContributor'>" + thisTrack.creator + ":</span>";
|
||||
thisHtml += " <span class='padmaAnnotation'>" + thisTrack.value_html + "</span>";
|
||||
thisHtml += "<br /><br />";
|
||||
annotHtml += thisHtml;
|
||||
}
|
||||
}
|
||||
return annotHtml;
|
||||
}
|
||||
|
||||
function isSidebarVisible() {
|
||||
if (padmaContainer.width() > 0) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user