# HG changeset patch # User veltr # Date 1351270460 -7200 # Node ID c9dc489913afd891c6f7f4bcf522ea856075eace # Parent bd904d592881ce261e60136296cfb232ab9748a1 Work on video loading - Commit before weekend diff -r bd904d592881 -r c9dc489913af integration/css/edition.css --- a/integration/css/edition.css Thu Oct 25 18:52:44 2012 +0200 +++ b/integration/css/edition.css Fri Oct 26 18:54:20 2012 +0200 @@ -118,6 +118,10 @@ font-style: italic; font-weight: normal; } +.empty-mode .tab-media-title, .pvw-mode .tab-media-title { + display: none; +} + .frise{ width: 458px; position: relative; @@ -209,9 +213,19 @@ color:#de2500; margin-bottom: 10px; } -.segmentation h2 span{ - color: #7628df; + +.time-tangle { + color: #7628df; cursor: w-resize; position: relative; +} +.time-tangle:hover, .time-tangle.active { + color: #FF00FC; border-bottom: 1px dashed #7628df; } +.time-tangle:hover:after, .time-tangle.active:after { + color: #7628DF; position: absolute; top: 18px; left: 50%; width: 160px; + margin-left: -80px; font-size: 12px; text-align: center; + content: "glisser pour modifier" +} + .segmentation form{ overflow: hidden; } @@ -478,10 +492,8 @@ } .item-video { margin-bottom: 1px; -} -.item-video{ + cursor: pointer; padding: 5px 10px 5px 10px; - position: relative; clear: both; width: auto; min-height: 62px; @@ -552,7 +564,6 @@ width: 460px; height: 300px; position: relative; - margin-bottom: 8px; background: #333333; } a.publier-button{ @@ -586,7 +597,7 @@ } .Ldt-Slider .ui-slider-handle { - border-radius: 8px; top: -2px; background: #fc00ff; border: 1px solid #ffffff; + border-radius: 8px; top: -2px; background: #ff00fc; border: 1px solid #ffffff; } .Ldt-Slider .ui-slider-range { @@ -739,4 +750,27 @@ .Ldt-Ctrl-Volume-Control:hover .ui-slider-handle { background: #F7268E; -} \ No newline at end of file +} + +/* Slice Widget */ + +.Ldt-Slice { + border-radius: 0; border: none; padding: 0; margin: 12px 0 12px; background: #B6B8B8; height: 8px; +} + +.Ldt-Slice .ui-slider-handle { + width: 7px; height: 20px; top: 0; border: none; margin: 0; padding: 0; + background: url(../img/slice-handles.png); border-radius: 0; cursor: pointer; +} + +.ui-slider-handle.Ldt-Slice-left-handle { + margin-left: -7px; +} + +.ui-slider-handle.Ldt-Slice-right-handle { + margin-left: 0; background-position: -7px 0; +} + +.Ldt-Slice .ui-slider-range { + background: url(../img/pinstripe-purple.png); +} diff -r bd904d592881 -r c9dc489913af integration/edition.html --- a/integration/edition.html Thu Oct 25 18:52:44 2012 +0200 +++ b/integration/edition.html Fri Oct 26 18:54:20 2012 +0200 @@ -136,7 +136,7 @@
- Segmenter La cuisine du Popcorn + Segmenter Prévisualiser
@@ -154,6 +154,7 @@
+
00:00
@@ -176,16 +177,23 @@
+
-
- -
+
-

Créer un nouveau segment de 02:27 à 02:27 (durée: 02:27)

+

+ Créer un nouveau segment + de + + à + + (durée: + ) +

diff -r bd904d592881 -r c9dc489913af integration/img/pinstripe-purple.png Binary file integration/img/pinstripe-purple.png has changed diff -r bd904d592881 -r c9dc489913af integration/img/slice-handles.png Binary file integration/img/slice-handles.png has changed diff -r bd904d592881 -r c9dc489913af integration/js/editor.js --- a/integration/js/editor.js Thu Oct 25 18:52:44 2012 +0200 +++ b/integration/js/editor.js Fri Oct 26 18:54:20 2012 +0200 @@ -49,15 +49,18 @@ /* Slider */ - var timeSlider = $(".Ldt-Slider"); + var timeSlider = $(".Ldt-Slider"), + slidersRange = 920; timeSlider.slider({ range: "min", value: 0, min: 0, - max: 920, + max: slidersRange, slide: function(event, ui) { - console.log(ui.value); - //TODO: Slide to correct Timecode + if (currentMedia) { + var t = currentMedia.duration * ui.value / slidersRange; + currentMedia.setCurrentTime(t); + } } }); @@ -106,7 +109,9 @@ .mouseout(timeSliderMouseOut) .mousemove(function(_e) { var _x = _e.pageX - timeSlider.offset().left, - _t = new IriSP.Model.Time(); // _this.media.duration * _x / _this.width + _t = new IriSP.Model.Time( + currentMedia ? currentMedia.duration * _x / timeSlider.width() : 0 + ); timeTooltip.text(_t.toString()).css("left",_x); }); @@ -146,7 +151,7 @@ var volBlock = $(".Ldt-Ctrl-Volume-Control"); $('.Ldt-Ctrl-Sound') - .click(function(){}) //TODO: Add Mute Handler + .click(function(){}) //TODO: Add Mute and Volume Handlers .mouseover(function() { volBlock.show(); }) @@ -170,19 +175,224 @@ } }); + $(".Ldt-Ctrl-Play").click(function() { + if (currentMedia) { + if (currentMedia.getPaused()) { + currentMedia.play(); + } else { + currentMedia.pause(); + } + } + }); + + /* Slice Widget */ + var sliceSlider = $(".Ldt-Slice"), + sliceStartTime; + + function setTangles(sliderValues) { + //TODO: Move to Annotation.on("changebounds") + if (currentMedia) { + startTime = new IriSP.Model.Time(currentMedia.duration * sliderValues[0] / slidersRange), + endTime = new IriSP.Model.Time(currentMedia.duration * sliderValues[1] / slidersRange), + duration = new IriSP.Model.Time(endTime - startTime); + $(".tangle-start").text(startTime.toString()).attr("data-milliseconds",startTime.milliseconds); + $(".tangle-end").text(endTime.toString()).attr("data-milliseconds",endTime.milliseconds); + $(".tangle-duration").text(duration.toString()).attr("data-milliseconds",duration.milliseconds); + } + } + + sliceSlider.slider({ + range: true, + values: [0, slidersRange], + min: 0, + max: slidersRange, + change: function(event, ui) { + setTangles(ui.values); // Not the right place to put it + }, + start: function() { + if (currentMedia) { + if (!currentMedia.getPaused()) { + currentMedia.pause(); + } +// sliceStartTime = currentMedia.getCurrentTime(); + } + }, + slide: function(event, ui) { + if (currentMedia) { + var t = currentMedia.duration * ui.value / slidersRange; + currentMedia.setCurrentTime(t); + } + setTangles(ui.values); + }, + stop: function() { + if (currentMedia && sliceStartTime) { +// currentMedia.setCurrentTime(sliceStartTime); + } + } + }); + + sliceSlider.find(".ui-slider-handle:first").addClass("Ldt-Slice-left-handle"); + sliceSlider.find(".ui-slider-handle:last").addClass("Ldt-Slice-right-handle"); + + /* UI Events */ + + function onCurrentMediaPlay() { + $(".Ldt-Ctrl-Play") + .attr("title", "Pause") + .removeClass("Ldt-Ctrl-Play-PlayState") + .addClass("Ldt-Ctrl-Play-PauseState") + } + + function onCurrentMediaPause() { + $(".Ldt-Ctrl-Play") + .attr("title", "Lecture") + .removeClass("Ldt-Ctrl-Play-PauseState") + .addClass("Ldt-Ctrl-Play-PlayState") + } + + function onCurrentMediaTimeupdate(_time) { + $(".Ldt-Ctrl-Time-Elapsed").text(_time.toString()); + timeSlider.slider("value",slidersRange * _time / currentMedia.duration); + } + /* Set current Media */ var currentMedia; function setMedia(mediaid) { + $(".col-left .item-video").removeClass("active"); + $(".tutorial").hide(); + $("video").hide(); + if (currentMedia) { + currentMedia.pause(); + } currentMedia = project.getElement(mediaid); if (currentMedia.elementType == "media") { - $("video").hide(); - var currentvideo = $('video[data-media-id="' + mediaid + '"]'); - console.log(currentvideo); + $(".col-left .item-video[data-media-id='" + mediaid + "']").addClass("active"); + showSegmentation(); + var currentvideo = $('#video_' + mediaid); + if (!currentvideo.length) { + addMediaPlayer(currentMedia); + currentvideo = $('#video_' + mediaid); + } + $(".tab-media-title").text(currentMedia.title); + sliceSlider.slider("values",[0, slidersRange]); } + currentvideo.show(); + $(".Ldt-Ctrl-Time-Total").text(currentMedia.duration.toString()); + onCurrentMediaTimeupdate(currentMedia.getCurrentTime()); + onCurrentMediaPause(); } function addMediaPlayer(media) { + var videoid = "video_" + media.id, + videoEl = $('

- Bibliothèque centre Pompidou + Bibliothèque centre Pompidou
@@ -25,7 +23,9 @@

Mashup75

mash@cinecast.fr

12 Hashcuts - +

+ +

@@ -33,7 +33,7 @@

Créer un compte :

- +

@@ -51,7 +51,7 @@

- +

@@ -62,7 +62,7 @@

Connexion :

-
+

@@ -72,10 +72,10 @@

- +

- +

@@ -112,9 +112,8 @@
- - - - + + +