3
|
1 |
var myDir = new IriSP.Model.Directory(), |
|
2 |
myProject = myDir.remoteSource({ |
|
3 |
url: "data/rigoletto.json", |
|
4 |
serializer: IriSP.serializers.ldt |
|
5 |
}); |
|
6 |
|
|
7 |
myProject.onLoad(function() { |
|
8 |
|
|
9 |
$(".project-title").text(myProject.title); |
|
10 |
|
|
11 |
var myMedia = myProject.getCurrentMedia(); |
|
12 |
|
|
13 |
IriSP.htmlPlayer( |
|
14 |
myMedia, |
|
15 |
$(".video-container"), |
|
16 |
{ |
|
17 |
width: 1000, |
|
18 |
height: 560, |
7
|
19 |
autostart: true, |
|
20 |
url_transform: function(src) { |
|
21 |
return [{ |
|
22 |
type: "video/mp4", |
|
23 |
src: src.replace(/\.[\d\w]+$/,'.mp4') |
|
24 |
}, { |
|
25 |
type: "video/webm", |
|
26 |
src: src.replace(/\.[\d\w]+$/,'.webm') |
|
27 |
}]; |
|
28 |
} |
3
|
29 |
} |
|
30 |
); |
|
31 |
|
|
32 |
myMedia.on("timeupdate", function(t) { |
|
33 |
var progress = $(".progress-indicator"), |
|
34 |
pos = ($(".chapters-bar").width() - 2 * progress.width()) * t / myMedia.duration; |
|
35 |
progress.css("left",pos); |
|
36 |
}); |
|
37 |
myMedia.on("play", function() { |
|
38 |
$(".play-button").addClass("pause"); |
|
39 |
}); |
|
40 |
myMedia.on("pause", function() { |
|
41 |
$(".play-button").removeClass("pause"); |
|
42 |
}); |
|
43 |
|
|
44 |
var tags = myProject.getTags().sortBy(function(t) { |
|
45 |
return - t.getRelated("annotation").length; |
|
46 |
}).slice(0,12), |
|
47 |
tagTemplate = _.template('<li data-tag-id="<%- id %>" class="tag"><%- title %></li>'), |
|
48 |
clickedTag = null, |
|
49 |
lastTag = null; |
|
50 |
|
|
51 |
$(".tags-list").html(tags.map(tagTemplate).join("")); |
|
52 |
|
8
|
53 |
$(".tags-title").mouseenter(function() { |
|
54 |
$(".tags-list").slideDown(); |
|
55 |
}); |
|
56 |
$(".tags").mouseleave(function() { |
|
57 |
$(".tags-list").slideUp(); |
|
58 |
}); |
|
59 |
|
3
|
60 |
$("body").click(function() { |
|
61 |
if (clickedTag) { |
6
|
62 |
$(".found").removeClass("found"); |
3
|
63 |
clickedTag = null; |
|
64 |
} |
8
|
65 |
return false; |
3
|
66 |
}); |
|
67 |
|
|
68 |
function showTag(tagId) { |
6
|
69 |
$(".found").removeClass("found"); |
3
|
70 |
var tag = myProject.getElement(tagId); |
|
71 |
if (tag) { |
|
72 |
tag.getRelated("annotation").forEach(function(a) { |
|
73 |
a.trigger("found-tags"); |
|
74 |
}); |
6
|
75 |
$(".tag[data-tag-id="+tagId+"]").addClass("found"); |
3
|
76 |
} |
|
77 |
lastTag = tagId; |
|
78 |
} |
|
79 |
|
|
80 |
$(".tag").hover(function() { |
|
81 |
showTag($(this).attr("data-tag-id")); |
|
82 |
}, function() { |
|
83 |
showTag(clickedTag); |
|
84 |
}).click(function() { |
|
85 |
clickedTag = lastTag; |
|
86 |
return false; |
|
87 |
}); |
|
88 |
|
|
89 |
|
|
90 |
var chapters = myProject.getAnnotationsByTypeTitle("chapitrage"), |
|
91 |
chapterTemplate = _.template( |
|
92 |
'<li class="chapter" style="left: <%- 100*begin/getMedia().duration %>%; width: <%- 100*getDuration()/getMedia().duration %>%;">' |
|
93 |
+ '<div class="chapter-block"></div><div class="chapter-title"><%- title %></div></li>' |
|
94 |
), |
|
95 |
chapterList = $(".chapters-list"), |
|
96 |
hoveredChapter = null, |
|
97 |
currentChapter = null, |
|
98 |
currentChapterI = 0; |
|
99 |
|
|
100 |
function highlightChapter() { |
|
101 |
$(".chapter").removeClass("active"); |
|
102 |
if (hoveredChapter || currentChapter) { |
|
103 |
(hoveredChapter || currentChapter).addClass("active"); |
|
104 |
} |
|
105 |
} |
|
106 |
|
|
107 |
chapters.forEach(function(chapter, i) { |
|
108 |
var element = $(chapterTemplate(chapter)); |
|
109 |
element.click(function() { |
|
110 |
myMedia.setCurrentTime(chapter.begin); |
8
|
111 |
return false; |
3
|
112 |
}).hover(function() { |
|
113 |
hoveredChapter = element; |
|
114 |
highlightChapter(); |
|
115 |
}, function() { |
|
116 |
hoveredChapter = null; |
|
117 |
highlightChapter(); |
|
118 |
}); |
|
119 |
chapter.on("enter", function() { |
|
120 |
currentChapter = element; |
|
121 |
currentChapterI = i; |
|
122 |
if (i) { |
|
123 |
$(".prev-chapter").removeClass("inactive"); |
|
124 |
} else { |
|
125 |
$(".prev-chapter").addClass("inactive"); |
|
126 |
} |
|
127 |
if (i < chapters.length - 1) { |
|
128 |
$(".next-chapter").removeClass("inactive"); |
|
129 |
} else { |
|
130 |
$(".next-chapter").addClass("inactive"); |
|
131 |
} |
|
132 |
highlightChapter(); |
|
133 |
}); |
|
134 |
chapter.on("leave", function() { |
|
135 |
currentChapter = null; |
|
136 |
highlightChapter(); |
|
137 |
}); |
|
138 |
chapter.on("found-tags", function() { |
6
|
139 |
element.addClass("found"); |
3
|
140 |
}); |
|
141 |
chapterList.append(element); |
|
142 |
}); |
|
143 |
|
|
144 |
$(".prev-chapter").click(function() { |
7
|
145 |
if (currentChapterI) { |
3
|
146 |
myMedia.setCurrentTime(chapters[currentChapterI - 1].begin); |
|
147 |
} |
6
|
148 |
return false; |
3
|
149 |
}); |
|
150 |
$(".next-chapter").click(function() { |
7
|
151 |
if (currentChapterI < chapters.length - 1) { |
3
|
152 |
myMedia.setCurrentTime(chapters[currentChapterI + 1].begin); |
|
153 |
} |
6
|
154 |
return false; |
3
|
155 |
}); |
|
156 |
|
|
157 |
$(".play-button").click(function() { |
|
158 |
if (myMedia.paused) { |
|
159 |
myMedia.play(); |
|
160 |
} else { |
|
161 |
myMedia.pause(); |
|
162 |
} |
6
|
163 |
return false; |
3
|
164 |
}); |
|
165 |
|
2
|
166 |
$(".progress-indicator").draggable({ |
|
167 |
axis: "x", |
3
|
168 |
containment: "parent", |
|
169 |
drag: function(e, ui) { |
|
170 |
var t = myMedia.duration * parseInt(ui.helper.css("left")) / ( $(".chapters-bar").width() - 2 * ui.helper.width() ); |
|
171 |
myMedia.setCurrentTime(t); |
|
172 |
} |
2
|
173 |
}); |
5
|
174 |
|
|
175 |
var pictoTemplate = _.template( |
|
176 |
'<li class="<%- type %>"><span class="picto"><a href="#"></a></span>' |
|
177 |
+ '<span class="picto-title"><%- annotation.title %></span></li>' |
|
178 |
); |
|
179 |
|
|
180 |
var chipTemplate = _.template( |
8
|
181 |
'<li class="chip <%- type %><%- left %>" style="left: <%- pos %>%"><div class="chip-circle">' |
|
182 |
+ '</div><div class="chip-pole"></div><div class="chip-title"><%- annotation.title %></div></li>' |
5
|
183 |
); |
|
184 |
|
8
|
185 |
var annotations = myProject.getAnnotationsByTypeTitle("annotations").sortBy(function(a) { |
|
186 |
return a.begin; |
|
187 |
}); |
5
|
188 |
|
6
|
189 |
var annotationinfos = annotations.map(function(annotation) { |
5
|
190 |
var annotationinfo = { |
|
191 |
annotation: annotation, |
|
192 |
open: false, |
|
193 |
pos: 100 * annotation.begin / annotation.getMedia().duration |
|
194 |
}; |
6
|
195 |
annotationinfo.left = (annotationinfo.pos > 80 ? " left": ""); |
5
|
196 |
switch(annotation.content.mimetype) { |
|
197 |
case "application/x-ldt-slideshow": |
|
198 |
annotationinfo.type = "slideshow"; |
|
199 |
break; |
6
|
200 |
case "application/x-ldt-video": |
|
201 |
annotationinfo.type = "video"; |
|
202 |
break; |
|
203 |
case "application/x-ldt-audio": |
|
204 |
annotationinfo.type = "audio"; |
|
205 |
break; |
|
206 |
case "application/x-ldt-links": |
|
207 |
annotationinfo.type = "link"; |
|
208 |
break; |
|
209 |
default: |
|
210 |
annotationinfo.type = "text"; |
2
|
211 |
} |
5
|
212 |
annotationinfo.picto = $(pictoTemplate(annotationinfo)).appendTo(".pictolist"); |
|
213 |
annotationinfo.chip = $(chipTemplate(annotationinfo)).appendTo(".chips-list"); |
|
214 |
annotationinfo.both = annotationinfo.picto.add(annotationinfo.chip); |
|
215 |
annotationinfo.both.click(function() { |
|
216 |
openAnnotation(annotationinfo); |
8
|
217 |
return false; |
5
|
218 |
}) |
|
219 |
.hover(function() { |
|
220 |
annotationinfo.both.addClass("hover"); |
|
221 |
}, function() { |
|
222 |
annotationinfo.both.removeClass("hover"); |
|
223 |
}); |
|
224 |
annotation.on("enter", function() { |
8
|
225 |
annotationinfo.picto.show().animate({ |
|
226 |
height: "38px", |
|
227 |
opacity: 1 |
9
|
228 |
}, 800); |
5
|
229 |
}); |
|
230 |
annotation.on("leave", function() { |
8
|
231 |
annotationinfo.picto.animate({ |
|
232 |
height: 0, |
|
233 |
opacity: 0 |
9
|
234 |
}, 800, function() { |
8
|
235 |
annotationinfo.picto.hide(); |
|
236 |
}); |
5
|
237 |
}); |
6
|
238 |
annotation.on("found-tags", function() { |
|
239 |
annotationinfo.both.addClass("found"); |
|
240 |
}); |
|
241 |
return annotationinfo; |
5
|
242 |
}); |
|
243 |
|
6
|
244 |
currentAnnotation = null; |
|
245 |
|
5
|
246 |
function openAnnotation(annotationinfo) { |
|
247 |
|
6
|
248 |
if (currentAnnotation === annotationinfo) { |
5
|
249 |
closeAnnotation(true); |
|
250 |
return; |
|
251 |
} |
|
252 |
|
|
253 |
if (myMedia.currentTime < annotationinfo.annotation.begin || myMedia.currentTime > annotationinfo.annotation.end) { |
|
254 |
myMedia.setCurrentTime(annotationinfo.annotation.begin); |
|
255 |
} |
|
256 |
|
|
257 |
myMedia.pause(); |
|
258 |
closeAnnotation(false); |
|
259 |
|
6
|
260 |
currentAnnotation = annotationinfo; |
|
261 |
|
5
|
262 |
annotationinfo.both.addClass("current"); |
|
263 |
|
|
264 |
$(".chapters-bar").addClass("annotation-onscreen"); |
|
265 |
|
6
|
266 |
var annotationDiv = $(".annotation-templates ." + annotationinfo.type + "-annotation").clone(); |
|
267 |
|
|
268 |
annotationDiv.appendTo($(".main-video")); |
|
269 |
annotationDiv.find(".close-annotation").click(closeAnnotation); |
|
270 |
annotationDiv.find(".annotation-title").text(annotationinfo.annotation.title); |
|
271 |
|
9
|
272 |
|
|
273 |
var positionDiv = function(anim) { |
|
274 |
var css = { |
|
275 |
top: Math.floor(($(".main-video").height() - annotationDiv.height())/2)+"px" |
|
276 |
}; |
|
277 |
if (anim) { |
|
278 |
annotationDiv.animate(css, 800); |
|
279 |
} else { |
|
280 |
annotationDiv.css(css); |
|
281 |
} |
|
282 |
} |
|
283 |
|
5
|
284 |
switch (annotationinfo.type) { |
6
|
285 |
|
5
|
286 |
case "slideshow": |
7
|
287 |
|
6
|
288 |
var currentslide = 0, |
|
289 |
slideInterval, |
|
290 |
playing = false, |
|
291 |
loaded = false, |
|
292 |
slides = annotationinfo.annotation.content.images; |
7
|
293 |
|
6
|
294 |
var resizeImage = function() { |
|
295 |
var imgel = annotationDiv.find(".slideshow-image"); |
|
296 |
imgel.css("margin-top",""); |
|
297 |
var w = imgel.width(), |
|
298 |
h = imgel.height(); |
8
|
299 |
annotationDiv.find(".annotation-main").css("height",""); |
6
|
300 |
annotationDiv.find(".slideshow-description").css("margin-left",w); |
8
|
301 |
var h2 = annotationDiv.find(".annotation-main").height(); |
6
|
302 |
if (h < h2) { |
|
303 |
imgel.css("margin-top",Math.floor((h2-h)/2)+"px"); |
|
304 |
} |
8
|
305 |
if (+imgel.css("opacity") !== 1) { |
|
306 |
imgel.fadeTo(400, 1); |
|
307 |
} |
6
|
308 |
} |
7
|
309 |
|
6
|
310 |
var showCurrentImage = function() { |
|
311 |
var slide = slides[currentslide]; |
|
312 |
annotationDiv.find(".slideshow-image").attr({ |
|
313 |
src: slide.image.src, |
|
314 |
title: slide.title, |
|
315 |
alt: slide.title |
|
316 |
}); |
|
317 |
annotationDiv.find(".slideshow-title").text(slide.title); |
|
318 |
annotationDiv.find(".slideshow-description").html( |
|
319 |
slide.description.split(/\n/gm).map(function(l) { |
|
320 |
return '<p>' + _.escape(l) + '</p>'; |
|
321 |
}).join("") |
|
322 |
); |
|
323 |
resizeImage(); |
|
324 |
} |
7
|
325 |
|
6
|
326 |
var nextImage = function() { |
|
327 |
currentslide = (currentslide + 1) % slides.length; |
8
|
328 |
annotationDiv.find(".slideshow-image").fadeTo(400, 0, showCurrentImage); |
|
329 |
return false; |
6
|
330 |
} |
7
|
331 |
|
6
|
332 |
var togglePlay = function() { |
|
333 |
playing = !playing; |
|
334 |
clearInterval(slideInterval); |
|
335 |
if (playing) { |
7
|
336 |
slideInterval = setInterval(nextImage,Math.max(1000,annotationinfo.annotation.content.slideduration || 0)); |
6
|
337 |
annotationDiv.find(".slideshow-play-pause").addClass("pause"); |
|
338 |
} else { |
|
339 |
annotationDiv.find(".slideshow-play-pause").removeClass("pause"); |
|
340 |
} |
8
|
341 |
return false; |
6
|
342 |
} |
7
|
343 |
|
6
|
344 |
var checkloaded = function() { |
|
345 |
if (loaded) { |
|
346 |
return; |
|
347 |
} |
|
348 |
loaded = slides.reduce(function(mem, slide) { |
|
349 |
return (mem && !!slide.image && !!slide.image.width); |
|
350 |
}, true); |
|
351 |
if (loaded) { |
|
352 |
showCurrentImage(); |
7
|
353 |
if (annotationinfo.annotation.autostart && slides.length > 1) { |
6
|
354 |
togglePlay(); |
|
355 |
} |
|
356 |
} |
|
357 |
} |
7
|
358 |
|
6
|
359 |
slides.forEach(function(slide) { |
|
360 |
slide.image = new Image(); |
|
361 |
slide.image.onload = checkloaded; |
|
362 |
slide.image.src = slide.url; |
|
363 |
}); |
7
|
364 |
|
6
|
365 |
checkloaded(); |
7
|
366 |
|
|
367 |
if (slides.length > 1) { |
|
368 |
annotationDiv.find(".slideshow-next").click(nextImage); |
|
369 |
annotationDiv.find(".slideshow-previous").click(function() { |
|
370 |
currentslide = (currentslide ? currentslide : slides.length) - 1; |
8
|
371 |
annotationDiv.find(".slideshow-image").fadeTo(400, 0, showCurrentImage); |
7
|
372 |
}); |
|
373 |
annotationDiv.find(".slideshow-play-pause").click(togglePlay); |
|
374 |
} else { |
|
375 |
annotationDiv.find(".slideshow-next, .slideshow-previous, .slideshow-play-pause").hide(); |
|
376 |
} |
6
|
377 |
|
|
378 |
break; |
|
379 |
|
7
|
380 |
case "audio": |
6
|
381 |
case "video": |
|
382 |
|
7
|
383 |
var src = annotationinfo.annotation.content.url; |
|
384 |
|
6
|
385 |
var youtubeTemplate = _.template( |
|
386 |
'<iframe width="<%- width %>" height="<%- height %>" src="http://www.youtube.com/embed/<%- ytid %>?rel=0&autoplay=<%- autoplay %>" frameborder="0"></iframe>' |
|
387 |
); |
|
388 |
|
7
|
389 |
var htmlTemplate = _.template( |
|
390 |
'<<%- type %> width="<%- width %>" controls="true" autoplay="<%- autoplay %>" src="<%- src %>"/>' |
6
|
391 |
); |
|
392 |
|
7
|
393 |
var mediaW = (annotationinfo.type === "audio" ? "100%" : "650"), |
|
394 |
mediaH = (annotationinfo.type === "audio" ? "60" : "420"); |
6
|
395 |
|
7
|
396 |
annotationDiv.find(".media-description").html( |
6
|
397 |
annotationinfo.annotation.description.split(/\n/gm).map(function(l) { |
|
398 |
return '<p>' + _.escape(l) + '</p>'; |
|
399 |
}).join("") |
|
400 |
); |
|
401 |
|
7
|
402 |
if (/^(https?:\/\/)?(www\.)?youtu\.?be/.test(src)) { |
|
403 |
var urlparts = src.split(/[?&]/g), |
6
|
404 |
ytid = "", |
|
405 |
vtest = /^v=/; |
|
406 |
urlparts.slice(1).forEach(function(p) { |
|
407 |
if (/^v=/.test(p)) { |
|
408 |
ytid = p.replace(vtest,""); |
|
409 |
} |
|
410 |
}); |
|
411 |
if (!ytid) { |
|
412 |
ytid = (urlparts[0].match(/[^\/]+$/) || [""])[0]; |
|
413 |
} |
7
|
414 |
annotationDiv.find(".media-frame").html(youtubeTemplate({ |
6
|
415 |
ytid: ytid, |
7
|
416 |
width: mediaW, |
|
417 |
height: mediaH, |
6
|
418 |
autoplay: +annotationinfo.annotation.content.autostart |
|
419 |
})); |
9
|
420 |
break; |
6
|
421 |
} |
|
422 |
|
7
|
423 |
if (/^(https?:\/\/)?(www\.)?vimeo/.test(src)) { |
|
424 |
$.ajax({ |
|
425 |
url: "http://vimeo.com/api/oembed.json", |
|
426 |
dataType: "jsonp", |
|
427 |
data: { |
|
428 |
width: mediaW, |
|
429 |
height: mediaH, |
|
430 |
url: src, |
8
|
431 |
autoplay: annotationinfo.annotation.content.autostart, |
|
432 |
color: "B8155F", |
7
|
433 |
portrait: false, |
|
434 |
title: false, |
|
435 |
byline: false |
|
436 |
}, |
|
437 |
success: function(data) { |
|
438 |
annotationDiv.find(".media-frame").html(data.html); |
9
|
439 |
positionDiv(true); |
7
|
440 |
} |
|
441 |
}); |
|
442 |
return; |
|
443 |
} |
6
|
444 |
|
7
|
445 |
if (/^(https?:\/\/)?(www\.)?dailymotion/.test(src)) { |
|
446 |
$.ajax({ |
|
447 |
url: "http://www.dailymotion.com/services/oembed", |
|
448 |
dataType: "jsonp", |
|
449 |
data: { |
|
450 |
format: "json", |
|
451 |
maxwidth: mediaW, |
|
452 |
maxheight: 487, |
|
453 |
url: src |
|
454 |
}, |
|
455 |
success: function(data) { |
|
456 |
annotationDiv.find(".media-frame").html(data.html); |
9
|
457 |
positionDiv(true); |
7
|
458 |
} |
|
459 |
}); |
|
460 |
return; |
|
461 |
} |
6
|
462 |
|
7
|
463 |
if (/^(https?:\/\/)?(www\.)?soundcloud\.com/.test(src)) { |
6
|
464 |
$.ajax({ |
|
465 |
url: "http://soundcloud.com/oembed", |
|
466 |
dataType: "jsonp", |
|
467 |
data: { |
|
468 |
format: "js", |
|
469 |
show_comments: false, |
|
470 |
auto_play: annotationinfo.annotation.content.autostart, |
|
471 |
show_artwork: false, |
7
|
472 |
url: src, |
8
|
473 |
color: "B8155F" |
6
|
474 |
}, |
|
475 |
success: function(data) { |
7
|
476 |
annotationDiv.find(".media-frame").html(data.html); |
9
|
477 |
positionDiv(true); |
6
|
478 |
} |
7
|
479 |
}); |
6
|
480 |
return; |
|
481 |
} |
7
|
482 |
|
|
483 |
var extension = (src.match(/\.([\d\w]+)$/) || ["",""])[1], |
|
484 |
mimetype = annotationinfo.type + "/" + extension, |
|
485 |
fallbacks = { "video/webm": "mp4", "video/mp4": "webm" }, |
|
486 |
canPlay = document.createElement("video").canPlayType(mimetype); |
|
487 |
|
|
488 |
if (!canPlay) { |
|
489 |
src = src.replace(/\.[\d\w]+$/,"." + fallbacks[mimetype]); |
|
490 |
} |
|
491 |
|
9
|
492 |
var media = $(htmlTemplate({ |
7
|
493 |
type: annotationinfo.type, |
|
494 |
src: src, |
|
495 |
width: mediaW, |
|
496 |
height: mediaH, |
|
497 |
autoplay: "" + annotationinfo.annotation.content.autostart |
6
|
498 |
})); |
|
499 |
|
9
|
500 |
media.on("loadedmetadata", function() { |
|
501 |
positionDiv(true); |
|
502 |
}); |
|
503 |
|
|
504 |
annotationDiv.find(".media-frame").html(media); |
|
505 |
return; |
|
506 |
|
6
|
507 |
break; |
|
508 |
|
|
509 |
case "text": |
|
510 |
|
|
511 |
var text = annotationinfo.annotation.content.text || annotationinfo.annotation.description; |
|
512 |
|
|
513 |
switch (annotationinfo.annotation.content.markup) { |
|
514 |
case "html": |
|
515 |
annotationDiv.find(".text-contents").html(text); |
|
516 |
break; |
|
517 |
default: |
|
518 |
annotationDiv.find(".text-contents").html( |
|
519 |
text.split(/\n/gm).map(function(l) { |
|
520 |
return '<p>' + _.escape(l) + '</p>'; |
|
521 |
}).join("") |
|
522 |
); |
|
523 |
break; |
|
524 |
} |
|
525 |
annotationDiv.find(".text-contents a").attr("target","_blank"); |
|
526 |
|
|
527 |
break; |
|
528 |
|
|
529 |
case "link": |
|
530 |
|
|
531 |
var linkTemplate = _.template('<p><a href="<%- url %>" target="_blank"><%- title %></a></p>'); |
|
532 |
|
|
533 |
annotationDiv.find(".link-contents").html( |
|
534 |
annotationinfo.annotation.content.links.map(linkTemplate).join("") |
|
535 |
); |
|
536 |
|
5
|
537 |
break; |
|
538 |
} |
9
|
539 |
|
|
540 |
positionDiv(true); |
|
541 |
|
5
|
542 |
} |
7
|
543 |
|
|
544 |
$(".video-container").click(function() { |
|
545 |
if (currentAnnotation) { |
|
546 |
closeAnnotation(true); |
|
547 |
} |
|
548 |
return false; |
|
549 |
}); |
3
|
550 |
|
5
|
551 |
function closeAnnotation(e) { |
6
|
552 |
currentAnnotation = null; |
|
553 |
$(".chip, .pictolist li").removeClass("current"); |
5
|
554 |
$(".chapters-bar").removeClass("annotation-onscreen"); |
9
|
555 |
$(".annotation audio, .annotation video").each(function() { |
|
556 |
try { |
|
557 |
this.pause(); |
|
558 |
} catch(e) { } |
|
559 |
}); |
7
|
560 |
$(".main-video .annotation").hide().remove(); |
5
|
561 |
if (!!e) { |
|
562 |
myMedia.play(); |
|
563 |
} |
7
|
564 |
return false; |
5
|
565 |
} |
3
|
566 |
|
2
|
567 |
}); |