|
79
|
1 |
/* |
|
|
2 |
* This file is part of the TraKERS\Front IDILL package. |
|
|
3 |
* |
|
|
4 |
* (c) IRI <http://www.iri.centrepompidou.fr/> |
|
|
5 |
* |
|
|
6 |
* For the full copyright and license information, please view the LICENSE |
|
|
7 |
* file that was distributed with this source code. |
|
|
8 |
*/ |
|
|
9 |
|
|
|
10 |
/* |
|
|
11 |
* Projet : TraKERS |
|
|
12 |
* Module : Front IDILL |
|
|
13 |
* Fichier : TabletPlayButton.js |
|
|
14 |
* |
|
|
15 |
* Auteur : alexandre.bastien@iri.centrepompidou.fr |
|
|
16 |
* |
|
|
17 |
* Fonctionnalités : Widget du bouton de lecture du player incorporé dans le Front pour le mode d'interaction pour tablettes. |
|
|
18 |
*/ |
|
|
19 |
|
|
|
20 |
/* |
|
|
21 |
Ce Widget se superpose à la vidéo. |
|
|
22 |
* Est appelé dans les fichiers créant les widgets du metadataplayer. |
|
|
23 |
*/ |
|
|
24 |
IriSP.Widgets.TabletPlayButton = function(player, config) |
|
|
25 |
{ |
|
|
26 |
IriSP.Widgets.Widget.call(this, player, config); |
|
|
27 |
// this.bindPopcorn("loadedmetadata","ready"); |
|
|
28 |
this.paused = true; |
|
|
29 |
this.player = player; |
|
|
30 |
this.buttonWidth = 85; |
|
|
31 |
this.buttonHeight = 69; |
|
|
32 |
}; |
|
|
33 |
|
|
|
34 |
/* |
|
|
35 |
* Constructeur du Widget. |
|
|
36 |
*/ |
|
|
37 |
IriSP.Widgets.TabletPlayButton.prototype = new IriSP.Widgets.Widget(); |
|
|
38 |
|
|
|
39 |
/* |
|
|
40 |
* Fonction appelée pour dessiner le bouton. |
|
|
41 |
*/ |
|
|
42 |
IriSP.Widgets.TabletPlayButton.prototype.draw = function() |
|
|
43 |
{ |
|
|
44 |
this.$playButton = IriSP.jQuery('<div>').attr("id", "tabletPlayButton"); |
|
|
45 |
|
|
|
46 |
//On l'ajoute au widget. |
|
|
47 |
this.$.append(this.$playButton); |
|
|
48 |
this.$playButton.css( |
|
|
49 |
{ |
|
|
50 |
position: 'absolute', |
|
|
51 |
width: this.player.config.gui.width, |
|
|
52 |
height: this.player.config.gui.height, |
|
|
53 |
'margin-top': -this.player.config.gui.height, |
|
|
54 |
'background-position': ((this.player.config.gui.width - this.buttonWidth)/2) + 'px ' + ((this.player.config.gui.height - this.buttonHeight)/2) + 'px' |
|
|
55 |
}); |
|
|
56 |
}; |
|
|
57 |
|
|
|
58 |
/* |
|
|
59 |
* Fonction appelée pour dessiner le bouton. |
|
|
60 |
*/ |
|
|
61 |
IriSP.Widgets.TabletPlayButton.prototype.onPlayButtonTouchStart = function() |
|
|
62 |
{ |
|
|
63 |
if(this.paused) |
|
|
64 |
{ |
|
|
65 |
this.paused = false; |
|
|
66 |
|
|
|
67 |
this.$playButton.css('opacity', '0'); |
|
|
68 |
this.player.popcorn.play(); |
|
|
69 |
} |
|
|
70 |
} |