'
+ '
'
@@ -79,7 +89,8 @@
var vizdata = {
left: k * t,
width: k * _s.duration,
- color: _s.getMedia().color
+ color: _s.getMedia().color,
+ segmentid: _s.annotation.id
}
vizhtml += viztemplate(vizdata);
t += _s.duration.milliseconds;
@@ -182,7 +193,6 @@
timeSlider.mousemove(function(_e) {
var _x = _e.pageX - timeSlider.offset().left,
_t = new IriSP.Model.Time(
- currentMedia ? currentMedia.duration * _x / timeSlider.width() : 0
);
timeTooltip.text(_t.toString()).css("left",_x);
});
@@ -366,9 +376,15 @@
mashupSegmentEnd,
mashupTimecode = 0,
mashupSeeking = false,
- mashupSeekdiv,
+ seekdiv = $(".video-wait"),
mashupTimedelta;
-
+
+ function showSeek() {
+ if (mashupSeeking) {
+ seekdiv.show();
+ }
+ }
+
function changeCurrentAnnotation() {
if (mashupTimecode >= mashup.duration) {
if (!mashup.paused) {
@@ -409,7 +425,7 @@
if (!mashup.paused) {
mashupCurrentMedia.play();
mashupSeeking = true;
-//TODO: _seekdiv.show();
+ setTimeout(showSeek,200);
}
mashup.trigger("timeupdate", new IriSP.Model.Time(mashupTimecode));
@@ -445,17 +461,16 @@
var addMode;
function setMedia(media) {
- $(".col-left .item-video").removeClass("active");
- $(".tutorial").hide();
- //TODO: Show Tutorial when Hashcut is empty
if (currentMedia) {
currentMedia.pause();
}
currentMedia = media;
if (currentMedia.elementType == "media") {
$("video").hide();
- $(".col-left .item-video[data-media-id='" + currentMedia.id + "']").addClass("active");
showSegmentation();
+ if (!currentMedia.loaded) {
+ seekdiv.show();
+ }
var currentvideo = $('#video_' + currentMedia.id);
if (!currentvideo.length) {
addMediaPlayer(currentMedia);
@@ -491,6 +506,7 @@
$(".annotation-media-title").text(this.getMedia().title);
$(".annotation-description").text(this.description);
setPointerToCurrentAnnotation();
+ highlightCurrentSegment();
}
});
}
@@ -655,6 +671,9 @@
// Binding UI Events and Mashup Playing to Media
media.on("loadedmetadata", function() {
+ if (media === currentMedia) {
+ seekdiv.hide();
+ }
mashup.checkLoaded();
});
@@ -701,7 +720,7 @@
media.seeking = false;
if (mashup === currentMedia && media === mashupCurrentMedia && mashupSeeking) {
mashupSeeking = false;
-//TODO: _seekdiv.hide();
+ seekdiv.hide();
}
});
@@ -821,6 +840,11 @@
$(".col-middle").removeClass("empty-mode segment-mode").addClass("pvw-mode");
return false;
}
+ function showEmpty() {
+ $("video").hide();
+ $(".col-middle").removeClass("pvw-mode segment-mode").addClass("empty-mode");
+ return false;
+ }
$(".tab-pvw").click(function() {
if (mashup.segments.length) {
@@ -836,17 +860,42 @@
}
function highlightCurrentSegment() {
- $(".organize-segments .item-video").removeClass("active");
+ $(".organize-segments .item-video, .col-left .item-video, .frise-segment").removeClass("active");
+ var segmentid = undefined;
if (currentMedia && currentSegment) {
- $(".item-video[data-segment-id='" + currentSegment.id + "']").addClass("active");
+ segmentid = currentSegment.id;
+ }
+ if (currentMedia === mashup && mashupCurrentAnnotation) {
+ segmentid = mashupCurrentAnnotation.annotation.id;
}
+ $(".item-video[data-segment-id='" + segmentid + "']").addClass("active");
+ var mediaid = undefined;
+ if (currentMedia) {
+ mediaid = currentMedia.id;
+ }
+ if (currentMedia === mashup && mashupCurrentMedia) {
+ mediaid = mashupCurrentMedia.id
+ }
+ $(".col-left .item-video[data-media-id='" + mediaid + "']").addClass("active");
}
- $(".organize-segments").sortable({
+ function hoverSegment() {
+ var segmentid = $(this).attr("data-segment-id");
+ $(".organize-segments .item-video, .frise-segment").removeClass("active");
+ $(".item-video[data-segment-id='" + segmentid + "'], .frise-segment[data-segment-id='" + segmentid + "']").addClass("active");
+ }
+
+ $(".frise")
+ .on("mouseover", ".frise-segment", hoverSegment)
+ .on("mouseout", ".frise-segment", highlightCurrentSegment)
+
+ $(".organize-segments")
+ .sortable({
stop : reorganizeMashup
- });
-
- $(".organize-segments").on("click", ".item-video", function(e) {
+ })
+ .on("mouseover", ".item-video", hoverSegment)
+ .on("mouseout", ".item-video", highlightCurrentSegment)
+ .on("click", ".item-video", function(e) {
var el = $(this),
segment = mashup.getAnnotationById(el.attr("data-segment-id"));
setMedia(mashup);
@@ -854,34 +903,33 @@
mashup.setCurrentTime(segment.begin);
}
return false;
- });
-
- $(".organize-segments").on("click", ".edit", function(e) {
+ })
+ .on("click", ".edit", function(e) {
var currentItem = $(this).parents(".item-video"),
media = project.getElement(currentItem.attr("data-media-id")),
segment = project.getElement(currentItem.attr("data-segment-id"));
currentSegment = segment;
setMedia(media);
return false;
- });
-
- $(".organize-segments").on("click", ".top", function(e){
+ })
+ .on("click", ".top", function(e){
var currentItem = $(this).parents(".item-video");
currentItem.insertBefore(currentItem.prev());
reorganizeMashup();
return false;
- });
-
- $(".organize-segments").on("click", ".bottom", function(e){
+ })
+ .on("click", ".bottom", function(e){
var currentItem = $(this).parents(".item-video");
currentItem.insertAfter(currentItem.next());
reorganizeMashup();
return false;
- });
-
- $(".organize-segments").on("click", ".delete", function(e){
+ })
+ .on("click", ".delete", function(e){
var id = $(this).parents(".item-video").attr("data-segment-id");
mashup.removeAnnotationById(id);
+ if (!mashup.segments.length) {
+ showEmpty();
+ }
return false;
});
@@ -972,4 +1020,11 @@
return false;
});
+ /* Changing Hashcut Title and description */
+
+ $("#hashcut-title").on("keyup change input paste", function() {
+ mashup.title = $(this).val();
+ $(".title-video-wrap a").text(mashup.title);
+ });
+
}