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