romo-av 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- data.tar.gz: f3f6ea009716a42cfdc4f31ae7406796fe54403e
4
- metadata.gz: e616ef64cfed9fa16f7f46aefb663e6b9a19d0cb
5
2
  SHA512:
6
- data.tar.gz: 3b1e586a6e7df6f7cf0faf2e3d6853ff74484f527c4b01a82ffc4c3f58c2cdd80f49726c19ebdd8c438563438c0424638d54bd54d76fd4a9648e5d1b14bbd4a5
7
- metadata.gz: 8ceb6efdb3ede3ef37d945827c30d62d1305393a5a64140faff5401c91244f2e71a3c31fc4f3b15454f8e4f2fcbdaaacb4d016f7877103f095eb5df3b0518f82
3
+ metadata.gz: 629e49294753636e90d9baaccef37bc678cda50ec3479ccd5a6cdf205ed4a4501e1ec0cda0bdc5f99b1802b5a645085f4672acb1597e39566ddd798425ea8e92
4
+ data.tar.gz: ffa3f1e19542e8365c4b0cadfe31252f1c2dc6d568fb07227f5efb4671e9fe626eeb4c5aeea9d89740e8549d58e5e907a9a0fd1f6a645130fb2395e471708444
5
+ SHA1:
6
+ metadata.gz: 3fe4aff5d6e234c20b5332b0a9fa0d17ad8d268a
7
+ data.tar.gz: ebcc868d01020a500c3dc6e8915d747e42d1ba05
@@ -1,303 +1,281 @@
1
- $.fn.romoDropdownVideo = function() {
2
- return $.map(this, function(element) {
3
- return new RomoDropdownVideo(element);
4
- });
5
- }
1
+ var RomoDropdownVideo = RomoComponent(function(elem) {
2
+ this.elem = elem;
6
3
 
7
- var RomoDropdownVideo = function(element) {
8
- this.elem = $(element);
4
+ this.doInit();
5
+ this._bindElem();
9
6
 
10
- this.dropdown = this.elem.romoDropdown()[0];
11
- this.doBindDropdown();
7
+ Romo.trigger(this.elem, 'romoDropdownVideo:ready', [this]);
8
+ });
12
9
 
13
- this.video = undefined;
14
- this.doBindVideo();
15
- this.elem.on('dropdown:loadBodySuccess', $.proxy(function(e, data, dropdown) {
16
- this.doBindVideo();
17
- }, this));
10
+ // private
18
11
 
19
- this.doInit();
20
- this.elem.trigger('dropdownVideo:ready', [this]);
21
- }
12
+ RomoDropdownVideo.prototype._bindElem = function() {
13
+ this._bindDropdown();
14
+ this._bindVideo();
22
15
 
23
- RomoDropdownVideo.prototype.doInit = function() {
24
- // override as needed
16
+ Romo.on(this.elem, 'romoDropdown:loadBodySuccess', Romo.proxy(function(e, data, romoDropdown) {
17
+ this._bindVideo();
18
+ }, this));
25
19
  }
26
20
 
27
- RomoDropdownVideo.prototype.doBindDropdown = function() {
28
- if (this.elem.data('romo-dropdown-clear-content') === undefined) {
29
- this.elem.attr('data-romo-dropdown-clear-content', 'true');
21
+ RomoDropdownVideo.prototype._bindDropdown = function() {
22
+ if (Romo.data(this.elem, 'romo-dropdown-clear-content') === undefined) {
23
+ Romo.setData(this.elem, 'romo-dropdown-clear-content', 'true');
30
24
  }
31
25
 
32
- // dropdown/video interactions
26
+ this.romoDropdown = new RomoDropdown(this.elem);
33
27
 
34
- this.elem.on('dropdownVideo:video:loadedmetadata', $.proxy(function(e, videoObj, video, dropdownVideo) {
35
- this.dropdown.doPlacePopupElem();
36
- }, this));
28
+ // dropdown/video interactions
37
29
 
38
- this.elem.on('dropdownVideo:video:enterFullscreen', $.proxy(function(e, videoObj, video, dropdownVideo) {
39
- // wait 1 sec then turn off dropdown body elem events - since we are in fullscreen
40
- // mode, we don't care about them
41
- setTimeout($.proxy(function() {
42
- this.dropdown.doUnBindWindowBodyClick();
43
- this.dropdown.doUnBindWindowBodyKeyUp();
44
- this.dropdown.doUnBindElemKeyUp();
45
- }, this), 1000);
46
- }, this));
47
- this.elem.on('dropdownVideo:video:exitFullscreen', $.proxy(function(e, videoObj, video, dropdownVideo) {
48
- // wait 1 sec then turn on dropdown body elem events - since we are no longer
49
- // in fullscreen mode, we need to care about them again
50
- setTimeout($.proxy(function() {
51
- this.dropdown.doBindWindowBodyClick();
52
- this.dropdown.doBindWindowBodyKeyUp();
53
- this.dropdown.doBindElemKeyUp();
54
- }, this), 1000);
30
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:loadedmetadata', Romo.proxy(function(e, videoObj, romoVideo, romoDropdownVideo) {
31
+ this.romoDropdown.doPlacePopupElem();
55
32
  }, this));
56
33
 
57
34
  // event proxies
58
35
 
59
- this.elem.on('dropdown:ready', $.proxy(function(e, dropdown) {
60
- this.elem.trigger('dropdownVideo:dropdown:ready', [dropdown, this]);
36
+ Romo.on(this.elem, 'romoDropdown:ready', Romo.proxy(function(e, romoDropdown) {
37
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoDropdown:ready', [romoDropdown, this]);
61
38
  }, this));
62
- this.elem.on('dropdown:toggle', $.proxy(function(e, dropdown) {
63
- this.elem.trigger('dropdownVideo:dropdown:toggle', [dropdown, this]);
39
+ Romo.on(this.elem, 'romoDropdown:toggle', Romo.proxy(function(e, romoDropdown) {
40
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoDropdown:toggle', [romoDropdown, this]);
64
41
  }, this));
65
- this.elem.on('dropdown:popupOpen', $.proxy(function(e, dropdown) {
66
- this.elem.trigger('dropdownVideo:dropdown:popupOpen', [dropdown, this]);
42
+ Romo.on(this.elem, 'romoDropdown:popupOpen', Romo.proxy(function(e, romoDropdown) {
43
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoDropdown:popupOpen', [romoDropdown, this]);
67
44
  }, this));
68
- this.elem.on('dropdown:popupClose', $.proxy(function(e, dropdown) {
69
- this.elem.trigger('dropdownVideo:dropdown:popupClose', [dropdown, this]);
45
+ Romo.on(this.elem, 'romoDropdown:popupClose', Romo.proxy(function(e, romoDropdown) {
46
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoDropdown:popupClose', [romoDropdown, this]);
70
47
  }, this));
71
- this.elem.on('dropdown:loadBodyStart', $.proxy(function(e, dropdown) {
72
- this.elem.trigger('dropdownVideo:dropdown:loadBodyStart', [dropdown, this]);
48
+ Romo.on(this.elem, 'romoDropdown:loadBodyStart', Romo.proxy(function(e, romoDropdown) {
49
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoDropdown:loadBodyStart', [romoDropdown, this]);
73
50
  }, this));
74
- this.elem.on('dropdown:loadBodySuccess', $.proxy(function(e, data, dropdown) {
75
- this.elem.trigger('dropdownVideo:dropdown:loadBodySuccess', [data, dropdown, this]);
51
+ Romo.on(this.elem, 'romoDropdown:loadBodySuccess', Romo.proxy(function(e, data, romoDropdown) {
52
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoDropdown:loadBodySuccess', [data, romoDropdown, this]);
76
53
  }, this));
77
- this.elem.on('dropdown:loadBodyError', $.proxy(function(e, xhr, dropdown) {
78
- this.elem.trigger('dropdownVideo:dropdown:loadBodyError', [xhr, dropdown, this]);
54
+ Romo.on(this.elem, 'romoDropdown:loadBodyError', Romo.proxy(function(e, xhr, romoDropdown) {
55
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoDropdown:loadBodyError', [xhr, romoDropdown, this]);
79
56
  }, this));
80
- this.elem.on('dropdown:dismiss', $.proxy(function(e, dropdown) {
81
- this.elem.trigger('dropdownVideo:dropdown:dismiss', [dropdown, this]);
57
+ Romo.on(this.elem, 'romoDropdown:dismiss', Romo.proxy(function(e, romoDropdown) {
58
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoDropdown:dismiss', [romoDropdown, this]);
82
59
  }, this));
83
60
  }
84
61
 
85
- RomoDropdownVideo.prototype.doBindVideo = function() {
86
- var videoElem = this.dropdown.popupElem.find('[data-romo-video-auto="dropdownVideo"]');
62
+ RomoDropdownVideo.prototype._bindVideo = function() {
63
+ this.romoVideo = undefined;
87
64
 
88
- this._bindVideoElemEvents(videoElem);
89
- this._bindDropdownVideoTriggerEvents();
65
+ var videoElem = Romo.find(this.romoDropdown.popupElem, '[data-romo-video-auto="dropdownVideo"]')[0];
66
+ if (videoElem !== undefined) {
67
+ this._bindVideoElemEvents(videoElem);
68
+ this._bindDropdownVideoTriggerEvents();
90
69
 
91
- this.video = videoElem.romoVideo()[0];
70
+ this.romoVideo = new RomoVideo(videoElem);
71
+ }
92
72
  }
93
73
 
94
- // private
95
-
96
74
  RomoDropdownVideo.prototype._bindVideoElemEvents = function(videoElem) {
97
75
  // playback events
98
76
 
99
- videoElem.on('video:play', $.proxy(function(e, videoObj, video) {
100
- this.elem.trigger('dropdownVideo:video:play', [videoObj, video, this]);
77
+ Romo.on(videoElem, 'romoVideo:play', Romo.proxy(function(e, videoObj, romoVideo) {
78
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:play', [videoObj, romoVideo, this]);
101
79
  }, this));
102
- videoElem.on('video:pause', $.proxy(function(e, videoObj, video) {
103
- this.elem.trigger('dropdownVideo:video:pause', [videoObj, video, this]);
80
+ Romo.on(videoElem, 'romoVideo:pause', Romo.proxy(function(e, videoObj, romoVideo) {
81
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:pause', [videoObj, romoVideo, this]);
104
82
  }, this));
105
83
 
106
84
  // state events
107
85
 
108
- videoElem.on('video:playing', $.proxy(function(e, videoObj, video) {
109
- this.elem.trigger('dropdownVideo:video:playing', [videoObj, video, this]);
86
+ Romo.on(videoElem, 'romoVideo:playing', Romo.proxy(function(e, videoObj, romoVideo) {
87
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:playing', [videoObj, romoVideo, this]);
110
88
  }, this));
111
- videoElem.on('video:waiting', $.proxy(function(e, videoObj, video) {
112
- this.elem.trigger('dropdownVideo:video:waiting', [videoObj, video, this]);
89
+ Romo.on(videoElem, 'romoVideo:waiting', Romo.proxy(function(e, videoObj, romoVideo) {
90
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:waiting', [videoObj, romoVideo, this]);
113
91
  }, this));
114
- videoElem.on('video:ended', $.proxy(function(e, videoObj, video) {
115
- this.elem.trigger('dropdownVideo:video:ended', [videoObj, video, this]);
92
+ Romo.on(videoElem, 'romoVideo:ended', Romo.proxy(function(e, videoObj, romoVideo) {
93
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:ended', [videoObj, romoVideo, this]);
116
94
  }, this));
117
- videoElem.on('video:emptied', $.proxy(function(e, videoObj, video) {
118
- this.elem.trigger('dropdownVideo:video:emptied', [videoObj, video, this]);
95
+ Romo.on(videoElem, 'romoVideo:emptied', Romo.proxy(function(e, videoObj, romoVideo) {
96
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:emptied', [videoObj, romoVideo, this]);
119
97
  }, this));
120
- videoElem.on('video:error', $.proxy(function(e, videoObj, video) {
121
- this.elem.trigger('dropdownVideo:video:error', [videoObj, video, this]);
98
+ Romo.on(videoElem, 'romoVideo:error', Romo.proxy(function(e, videoObj, romoVideo) {
99
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:error', [videoObj, romoVideo, this]);
122
100
  }, this));
123
- videoElem.on('video:stalled', $.proxy(function(e, videoObj, video) {
124
- this.elem.trigger('dropdownVideo:video:stalled', [videoObj, video, this]);
101
+ Romo.on(videoElem, 'romoVideo:stalled', Romo.proxy(function(e, videoObj, romoVideo) {
102
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:stalled', [videoObj, romoVideo, this]);
125
103
  }, this));
126
- videoElem.on('video:suspend', $.proxy(function(e, videoObj, video) {
127
- this.elem.trigger('dropdownVideo:video:suspend', [videoObj, video, this]);
104
+ Romo.on(videoElem, 'romoVideo:suspend', Romo.proxy(function(e, videoObj, romoVideo) {
105
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:suspend', [videoObj, romoVideo, this]);
128
106
  }, this));
129
107
 
130
108
  // status events
131
109
 
132
- videoElem.on('video:progress', $.proxy(function(e, videoObj, video) {
133
- this.elem.trigger('dropdownVideo:video:progress', [videoObj, video, this]);
110
+ Romo.on(videoElem, 'romoVideo:progress', Romo.proxy(function(e, videoObj, romoVideo) {
111
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:progress', [videoObj, romoVideo, this]);
134
112
  }, this));
135
- videoElem.on('video:timeupdate', $.proxy(function(e, videoObj, video) {
136
- this.elem.trigger('dropdownVideo:video:timeupdate', [videoObj, video, this]);
113
+ Romo.on(videoElem, 'romoVideo:timeupdate', Romo.proxy(function(e, videoObj, romoVideo) {
114
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:timeupdate', [videoObj, romoVideo, this]);
137
115
  }, this));
138
116
 
139
117
  // settings events
140
118
 
141
- videoElem.on('video:volumechange', $.proxy(function(e, videoObj, video) {
142
- this.elem.trigger('dropdownVideo:video:volumechange', [videoObj, video, this]);
119
+ Romo.on(videoElem, 'romoVideo:volumechange', Romo.proxy(function(e, videoObj, romoVideo) {
120
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:volumechange', [videoObj, romoVideo, this]);
143
121
  }, this));
144
- videoElem.on('video:durationchange', $.proxy(function(e, videoObj, video) {
145
- this.elem.trigger('dropdownVideo:video:durationchange', [videoObj, video, this]);
122
+ Romo.on(videoElem, 'romoVideo:durationchange', Romo.proxy(function(e, videoObj, romoVideo) {
123
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:durationchange', [videoObj, romoVideo, this]);
146
124
  }, this));
147
- videoElem.on('video:ratechange', $.proxy(function(e, videoObj, video) {
148
- this.elem.trigger('dropdownVideo:video:ratechange', [videoObj, video, this]);
125
+ Romo.on(videoElem, 'romoVideo:ratechange', Romo.proxy(function(e, videoObj, romoVideo) {
126
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:ratechange', [videoObj, romoVideo, this]);
149
127
  }, this));
150
128
 
151
129
  // fullscreen events
152
130
 
153
- videoElem.on('video:enterFullscreen', $.proxy(function(e, videoObj, video) {
154
- this.elem.trigger('dropdownVideo:video:enterFullscreen', [videoObj, video, this]);
131
+ Romo.on(videoElem, 'romoVideo:enterFullscreen', Romo.proxy(function(e, videoObj, romoVideo) {
132
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:enterFullscreen', [videoObj, romoVideo, this]);
155
133
  }, this));
156
- videoElem.on('video:exitFullscreen', $.proxy(function(e, videoObj, video) {
157
- this.elem.trigger('dropdownVideo:video:exitFullscreen', [videoObj, video, this]);
134
+ Romo.on(videoElem, 'romoVideo:exitFullscreen', Romo.proxy(function(e, videoObj, romoVideo) {
135
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:exitFullscreen', [videoObj, romoVideo, this]);
158
136
  }, this));
159
- videoElem.on('video:fullscreenChange', $.proxy(function(e, videoObj, video) {
160
- this.elem.trigger('dropdownVideo:video:fullscreenChange', [videoObj, video, this]);
137
+ Romo.on(videoElem, 'romoVideo:fullscreenChange', Romo.proxy(function(e, videoObj, romoVideo) {
138
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:fullscreenChange', [videoObj, romoVideo, this]);
161
139
  }, this));
162
140
 
163
141
  // load events
164
142
 
165
- videoElem.on('video:loadstart', $.proxy(function(e, videoObj, video) {
166
- this.elem.trigger('dropdownVideo:video:loadstart', [videoObj, video, this]);
143
+ Romo.on(videoElem, 'romoVideo:loadstart', Romo.proxy(function(e, videoObj, romoVideo) {
144
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:loadstart', [videoObj, romoVideo, this]);
167
145
  }, this));
168
- videoElem.on('video:loadedmetadata', $.proxy(function(e, videoObj, video) {
169
- this.elem.trigger('dropdownVideo:video:loadedmetadata', [videoObj, video, this]);
146
+ Romo.on(videoElem, 'romoVideo:loadedmetadata', Romo.proxy(function(e, videoObj, romoVideo) {
147
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:loadedmetadata', [videoObj, romoVideo, this]);
170
148
  }, this));
171
- videoElem.on('video:loadeddata', $.proxy(function(e, videoObj, video) {
172
- this.elem.trigger('dropdownVideo:video:loadeddata', [videoObj, video, this]);
149
+ Romo.on(videoElem, 'romoVideo:loadeddata', Romo.proxy(function(e, videoObj, romoVideo) {
150
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:loadeddata', [videoObj, romoVideo, this]);
173
151
  }, this));
174
- videoElem.on('video:canplay', $.proxy(function(e, videoObj, video) {
175
- this.elem.trigger('dropdownVideo:video:canplay', [videoObj, video, this]);
152
+ Romo.on(videoElem, 'romoVideo:canplay', Romo.proxy(function(e, videoObj, romoVideo) {
153
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:canplay', [videoObj, romoVideo, this]);
176
154
  }, this));
177
- videoElem.on('video:canplaythrough', $.proxy(function(e, videoObj, video) {
178
- this.elem.trigger('dropdownVideo:video:canplaythrough', [videoObj, video, this]);
155
+ Romo.on(videoElem, 'romoVideo:canplaythrough', Romo.proxy(function(e, videoObj, romoVideo) {
156
+ Romo.trigger(this.elem, 'romoDropdownVideo:romoVideo:canplaythrough', [videoObj, romoVideo, this]);
179
157
  }, this));
180
158
  }
181
159
 
182
160
  RomoDropdownVideo.prototype._bindDropdownVideoTriggerEvents = function() {
183
161
  // playback triggers
184
162
 
185
- this.elem.on('dropdownVideo:video:triggerPlay', $.proxy(function(e) {
186
- if (this.video != undefined) {
187
- this.video.elem.trigger('video:triggerPlay', []);
163
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerPlay', Romo.proxy(function(e) {
164
+ if (this.romoVideo != undefined) {
165
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerPlay', []);
188
166
  }
189
167
  }, this));
190
- this.elem.on('dropdownVideo:video:triggerPause', $.proxy(function(e) {
191
- if (this.video != undefined) {
192
- this.video.elem.trigger('video:triggerPause', []);
168
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerPause', Romo.proxy(function(e) {
169
+ if (this.romoVideo != undefined) {
170
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerPause', []);
193
171
  }
194
172
  }, this));
195
- this.elem.on('dropdownVideo:video:triggerTogglePlay', $.proxy(function(e) {
196
- if (this.video != undefined) {
197
- this.video.elem.trigger('video:triggerTogglePlay', []);
173
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerTogglePlay', Romo.proxy(function(e) {
174
+ if (this.romoVideo != undefined) {
175
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerTogglePlay', []);
198
176
  }
199
177
  }, this));
200
- this.elem.on('dropdownVideo:video:triggerSetPlaybackToTime', $.proxy(function(e, secondNum) {
201
- if (this.video != undefined) {
202
- this.video.elem.trigger('video:triggerSetPlaybackToTime', [secondNum]);
178
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerSetPlaybackToTime', Romo.proxy(function(e, secondNum) {
179
+ if (this.romoVideo != undefined) {
180
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerSetPlaybackToTime', [secondNum]);
203
181
  }
204
182
  }, this));
205
- this.elem.on('dropdownVideo:video:triggerSetPlaybackToFrame', $.proxy(function(e, frameNum) {
206
- if (this.video != undefined) {
207
- this.video.elem.trigger('video:triggerSetPlaybackToFrame', [frameNum]);
183
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerSetPlaybackToFrame', Romo.proxy(function(e, frameNum) {
184
+ if (this.romoVideo != undefined) {
185
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerSetPlaybackToFrame', [frameNum]);
208
186
  }
209
187
  }, this));
210
- this.elem.on('dropdownVideo:video:triggerSetPlaybackToPercent', $.proxy(function(e, percent) {
211
- if (this.video != undefined) {
212
- this.video.elem.trigger('video:triggerSetPlaybackToPercent', [percent]);
188
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerSetPlaybackToPercent', Romo.proxy(function(e, percent) {
189
+ if (this.romoVideo != undefined) {
190
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerSetPlaybackToPercent', [percent]);
213
191
  }
214
192
  }, this));
215
- this.elem.on('dropdownVideo:video:triggerModPlaybackByTime', $.proxy(function(e, secondsCount) {
216
- if (this.video != undefined) {
217
- this.video.elem.trigger('video:triggerModPlaybackByTime', [secondsCount]);
193
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerModPlaybackByTime', Romo.proxy(function(e, secondsCount) {
194
+ if (this.romoVideo != undefined) {
195
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerModPlaybackByTime', [secondsCount]);
218
196
  }
219
197
  }, this));
220
- this.elem.on('dropdownVideo:video:triggerModPlaybackByFrames', $.proxy(function(e, frameCount) {
221
- if (this.video != undefined) {
222
- this.video.elem.trigger('video:triggerModPlaybackByFrames', [frameCount]);
198
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerModPlaybackByFrames', Romo.proxy(function(e, frameCount) {
199
+ if (this.romoVideo != undefined) {
200
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerModPlaybackByFrames', [frameCount]);
223
201
  }
224
202
  }, this));
225
- this.elem.on('dropdownVideo:video:triggerModPlaybackByPercent', $.proxy(function(e, percent) {
226
- if (this.video != undefined) {
227
- this.video.elem.trigger('video:triggerModPlaybackByPercent', [percent]);
203
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerModPlaybackByPercent', Romo.proxy(function(e, percent) {
204
+ if (this.romoVideo != undefined) {
205
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerModPlaybackByPercent', [percent]);
228
206
  }
229
207
  }, this));
230
208
 
231
209
  // settings triggers
232
210
 
233
- this.elem.on('dropdownVideo:video:triggerMute', $.proxy(function(e) {
234
- if (this.video != undefined) {
235
- this.video.elem.trigger('video:triggerMute', []);
211
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerMute', Romo.proxy(function(e) {
212
+ if (this.romoVideo != undefined) {
213
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerMute', []);
236
214
  }
237
215
  }, this));
238
- this.elem.on('dropdownVideo:video:triggerUnmute', $.proxy(function(e) {
239
- if (this.video != undefined) {
240
- this.video.elem.trigger('video:triggerUnmute', []);
216
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerUnmute', Romo.proxy(function(e) {
217
+ if (this.romoVideo != undefined) {
218
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerUnmute', []);
241
219
  }
242
220
  }, this));
243
- this.elem.on('dropdownVideo:video:triggerToggleMute', $.proxy(function(e) {
244
- if (this.video != undefined) {
245
- this.video.elem.trigger('video:triggerToggleMute', []);
221
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerToggleMute', Romo.proxy(function(e) {
222
+ if (this.romoVideo != undefined) {
223
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerToggleMute', []);
246
224
  }
247
225
  }, this));
248
- this.elem.on('dropdownVideo:video:triggerSetVolumeToPercent', $.proxy(function(e, percent) {
249
- if (this.video != undefined) {
250
- this.video.elem.trigger('video:triggerSetVolumeToPercent', [percent]);
226
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerSetVolumeToPercent', Romo.proxy(function(e, percent) {
227
+ if (this.romoVideo != undefined) {
228
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerSetVolumeToPercent', [percent]);
251
229
  }
252
230
  }, this));
253
- this.elem.on('dropdownVideo:video:triggerModVolumeByPercent', $.proxy(function(e, percent) {
254
- if (this.video != undefined) {
255
- this.video.elem.trigger('video:triggerModVolumeByPercent', [percent]);
231
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerModVolumeByPercent', Romo.proxy(function(e, percent) {
232
+ if (this.romoVideo != undefined) {
233
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerModVolumeByPercent', [percent]);
256
234
  }
257
235
  }, this));
258
- this.elem.on('dropdownVideo:video:triggerSetPlaybackRate', $.proxy(function(e, rate) {
259
- if (this.video != undefined) {
260
- this.video.elem.trigger('video:triggerSetPlaybackRate', [rate]);
236
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerSetPlaybackRate', Romo.proxy(function(e, rate) {
237
+ if (this.romoVideo != undefined) {
238
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerSetPlaybackRate', [rate]);
261
239
  }
262
240
  }, this));
263
- this.elem.on('dropdownVideo:video:triggerModPlaybackRate', $.proxy(function(e, rate) {
264
- if (this.video != undefined) {
265
- this.video.elem.trigger('video:triggerModPlaybackRate', [rate]);
241
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerModPlaybackRate', Romo.proxy(function(e, rate) {
242
+ if (this.romoVideo != undefined) {
243
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerModPlaybackRate', [rate]);
266
244
  }
267
245
  }, this));
268
246
 
269
247
  // fullscreen triggers
270
248
 
271
- this.elem.on('dropdownVideo:video:triggerEnterFullscreen', $.proxy(function(e) {
272
- if (this.video != undefined) {
273
- this.video.elem.trigger('video:triggerEnterFullscreen', []);
249
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerEnterFullscreen', Romo.proxy(function(e) {
250
+ if (this.romoVideo != undefined) {
251
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerEnterFullscreen', []);
274
252
  }
275
253
  }, this));
276
- this.elem.on('dropdownVideo:video:triggerExitFullscreen', $.proxy(function(e) {
277
- if (this.video != undefined) {
278
- this.video.elem.trigger('video:triggerExitFullscreen', []);
254
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerExitFullscreen', Romo.proxy(function(e) {
255
+ if (this.romoVideo != undefined) {
256
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerExitFullscreen', []);
279
257
  }
280
258
  }, this));
281
- this.elem.on('dropdownVideo:video:triggerToggleFullscreen', $.proxy(function(e) {
282
- if (this.video != undefined) {
283
- this.video.elem.trigger('video:triggerToggleFullscreen', []);
259
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerToggleFullscreen', Romo.proxy(function(e) {
260
+ if (this.romoVideo != undefined) {
261
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerToggleFullscreen', []);
284
262
  }
285
263
  }, this));
286
264
 
287
265
  // load triggers
288
266
 
289
- this.elem.on('dropdownVideo:video:triggerLoad', $.proxy(function(e) {
290
- if (this.video != undefined) {
291
- this.video.elem.trigger('video:triggerLoad', []);
267
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerLoad', Romo.proxy(function(e) {
268
+ if (this.romoVideo != undefined) {
269
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerLoad', []);
292
270
  }
293
271
  }, this));
294
- this.elem.on('dropdownVideo:video:triggerModSource', $.proxy(function(e, source) {
295
- if (this.video != undefined) {
296
- this.video.elem.trigger('video:triggerModSource', [source]);
272
+ Romo.on(this.elem, 'romoDropdownVideo:romoVideo:triggerModSource', Romo.proxy(function(e, source) {
273
+ if (this.romoVideo != undefined) {
274
+ Romo.trigger(this.romoVideo.elem, 'romoVideo:triggerModSource', [source]);
297
275
  }
298
276
  }, this));
299
277
  }
300
278
 
301
- Romo.onInitUI(function(e) {
302
- Romo.initUIElems(e, '[data-romo-dropdownVideo-auto="true"]').romoDropdownVideo();
303
- });
279
+ // init
280
+
281
+ Romo.addElemsInitSelector('[data-romo-dropdownVideo-auto="true"]', RomoDropdownVideo);