|
44
|
1 |
mosaic.prototype.playNextVideo = function() |
|
|
2 |
{ |
|
|
3 |
var videoId = this.centerId, nextId = (+videoId + 1); |
|
|
4 |
|
|
|
5 |
//Si on arrive à la fin de la mosaique on revient au début. |
|
|
6 |
if(videoId >= this.config['imagesToShow'] - 1) |
|
|
7 |
{ |
|
|
8 |
nextId = 0; |
|
|
9 |
} |
|
|
10 |
|
|
|
11 |
//Si la mosaique est filtrée, on passe directement à la prochaine vidéo non filtrée. |
|
|
12 |
if(this.isMosaicFiltered) |
|
|
13 |
{ |
|
|
14 |
while(this.opacities[nextId] == 0 && nextId < this.config['imagesToShow']) |
|
|
15 |
{ |
|
|
16 |
nextId++; |
|
|
17 |
} |
|
|
18 |
|
|
|
19 |
if(nextId == this.config['imagesToShow']) |
|
|
20 |
{ |
|
|
21 |
nextId = 0; |
|
|
22 |
// return; |
|
|
23 |
} |
|
|
24 |
} |
|
|
25 |
|
|
|
26 |
console.log('movetonext'); |
|
|
27 |
this.autoMove = true; |
|
|
28 |
console.log('dep : ' + this.centerId + ' next : ' + nextId); |
|
|
29 |
this.moveToNeighbour($('#snapshotDiv-' + nextId)); |
|
|
30 |
} |
|
|
31 |
|
|
|
32 |
mosaic.prototype.isTLSelected = function(entering, mainPointer) |
|
|
33 |
{ |
|
|
34 |
//Si les deux pointeurs ne sont pas là ou qu'on n'est pas en lecture d'une vidéo. |
|
|
35 |
if(this.isMainPointerDisplayed && this.isSecondPointerDisplayed || this.currentMode != 'VIDEO' && this.currentMode != 'SEARCH' && this.currentMode != 'TIMELINE' || !this.playerIsReady) |
|
|
36 |
{ |
|
|
37 |
// $('.a').remove(); |
|
|
38 |
return false; |
|
|
39 |
} |
|
|
40 |
|
|
|
41 |
var pointer = (mainPointer ? $('#mainPointer') : $('#secondPointer')); |
|
|
42 |
|
|
|
43 |
var TL = $('.Ldt-Timeline'); |
|
|
44 |
var TLwidth = TL.width(), TLheight = TL.height(); |
|
|
45 |
var TLtop = (+$('.LdtPlayer').position().top + $('.LdtPlayer').height() - TLheight), TLleft = $('.LdtPlayer').position().left; |
|
|
46 |
var Px = pointer.position().left + pointer.width() / 2, Py = pointer.position().top + pointer.height() / 2; |
|
|
47 |
|
|
|
48 |
var correctHorizontalPosition = (entering ? (Px > TLleft && Px < (+TLleft + TLwidth)) : (true)); |
|
|
49 |
|
|
|
50 |
//Seulement avec une main. |
|
|
51 |
// if(this.isMainPointerDisplayed && !this.isSecondPointerDisplayed && correctHorizontalPosition && Py > (TLtop - TLheight / 2) && Py < (+TLtop + TLheight)) |
|
|
52 |
|
|
|
53 |
if(correctHorizontalPosition && Py > (TLtop - TLheight / 2) && Py < (+TLtop + TLheight)) |
|
|
54 |
{ |
|
|
55 |
// if($('.a').length < 1) |
|
|
56 |
// $('body').append('<div class="a" style="position: absolute; background-color: #fff; top: ' + (TLtop - TLheight / 2) + 'px; left: ' + TLleft + 'px; height: ' + (TLheight * 3 / 2) +'px; width: ' + TLwidth + 'px"></div>'); |
|
|
57 |
return true; |
|
|
58 |
} |
|
|
59 |
|
|
|
60 |
// $(".a").remove(); |
|
|
61 |
return false; |
|
|
62 |
} |
|
|
63 |
|
|
|
64 |
mosaic.prototype.exitTimeline = function(typeOfInteraction) |
|
|
65 |
{ |
|
|
66 |
if(this.currentMode == 'TIMELINE' && this.playerIsReady) |
|
|
67 |
{ |
|
|
68 |
console.log('(5) QUIT'); |
|
|
69 |
// console.trace(); |
|
|
70 |
$('.notifications').remove(); |
|
|
71 |
|
|
|
72 |
this.isTLRequested = false; |
|
|
73 |
this.canSlideInTL = false; |
|
|
74 |
this.player.widgets[0].deselectTimeline(); |
|
|
75 |
|
|
|
76 |
if($('#spinner').length > 0) |
|
|
77 |
{ |
|
|
78 |
$('#spinner').remove(); |
|
|
79 |
} |
|
|
80 |
|
|
|
81 |
if(this.isTLSelectedByMainPointer) |
|
|
82 |
{ |
|
|
83 |
$('#mainPointer').css('background-image', 'url(./img/cursors/pointer.png)'); |
|
|
84 |
} |
|
|
85 |
if(this.isTLSelectedBySecondPointer) |
|
|
86 |
{ |
|
|
87 |
$('#secondPointer').css('background-image', 'url(./img/cursors/pointer2.png)'); |
|
|
88 |
} |
|
|
89 |
|
|
|
90 |
this.isTLSelectedByMainPointer = false; |
|
|
91 |
this.isTLSelectedBySecondPointer = false; |
|
|
92 |
|
|
|
93 |
if(typeOfInteraction == 'unzoom') |
|
|
94 |
{ |
|
|
95 |
if(this.isMosaicFiltered) |
|
|
96 |
{ |
|
|
97 |
this.currentMode = 'FILTER'; |
|
|
98 |
} |
|
|
99 |
else |
|
|
100 |
{ |
|
|
101 |
this.currentMode = 'MOSAIC'; |
|
|
102 |
} |
|
|
103 |
} |
|
|
104 |
else if(typeOfInteraction == 'move') |
|
|
105 |
{ |
|
|
106 |
this.currentMode = 'VIDEO'; |
|
|
107 |
} |
|
|
108 |
else |
|
|
109 |
{ |
|
|
110 |
if(this.isCurrentlyInASearchByGesture) |
|
|
111 |
{ |
|
|
112 |
this.currentMode = 'SEARCH'; |
|
|
113 |
|
|
|
114 |
this.searchGesture(this.currentSearchGesture, 'valid'); |
|
|
115 |
} |
|
|
116 |
else |
|
|
117 |
{ |
|
|
118 |
this.currentMode = 'VIDEO'; |
|
|
119 |
} |
|
|
120 |
} |
|
|
121 |
} |
|
|
122 |
} |