@@ -116,6 +116,7 @@ MediaController.prototype.seek = function(currentTime, callback) {
116
116
this . sessionRequest ( data , callback ) ;
117
117
} ;
118
118
119
+ //Load a queue of items to play (playlist)
119
120
//See https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueLoadRequest
120
121
MediaController . prototype . queueLoad = function ( items , options , callback ) {
121
122
@@ -132,11 +133,11 @@ MediaController.prototype.queueLoad = function(items, options, callback) {
132
133
? options . repeatMode
133
134
: "REPEAT_OFF" ;
134
135
135
- data . currentTime = ( typeof options . currentTime !== 'undefined' )
136
+ data . currentTime = ( typeof options . currentTime !== 'undefined' )
136
137
? options . currentTime
137
138
: 0 ;
138
139
139
- data . startIndex = ( typeof options . startIndex !== 'undefined' )
140
+ data . startIndex = ( typeof options . startIndex !== 'undefined' )
140
141
? options . startIndex
141
142
: 0 ;
142
143
@@ -161,12 +162,13 @@ MediaController.prototype.queueInsert = function(items, options, callback) {
161
162
options = { } ;
162
163
}
163
164
164
- var data = { type : 'QUEUE_INSERT' ,
165
- currentItemId : options . currentItemId , //Item ID to play after this request or keep same item if undefined
166
- currentItemIndex : options . currentItemIndex , //Item Index to play after this request or keep same item if undefined
167
- currentTime : options . currentTime , //Seek in seconds
168
- insertBefore : options . insertBefore , //ID or append if undefined
169
- items : items
165
+ var data = {
166
+ type : 'QUEUE_INSERT' ,
167
+ currentItemId : options . currentItemId , //Item ID to play after this request or keep same item if undefined
168
+ currentItemIndex : options . currentItemIndex , //Item Index to play after this request or keep same item if undefined
169
+ currentTime : options . currentTime , //Seek in seconds for current stream
170
+ insertBefore : options . insertBefore , //ID or append if undefined
171
+ items : items
170
172
} ;
171
173
172
174
this . sessionRequest ( data , callback ) ;
@@ -178,10 +180,11 @@ MediaController.prototype.queueRemove = function(itemIds, options, callback) {
178
180
options = { } ;
179
181
}
180
182
181
- var data = { type : 'QUEUE_REMOVE' ,
182
- currentItemId : options . currentItemId ,
183
- currentTime : options . currentTime ,
184
- itemIds : itemIds
183
+ var data = {
184
+ type : 'QUEUE_REMOVE' ,
185
+ currentItemId : options . currentItemId ,
186
+ currentTime : options . currentTime ,
187
+ itemIds : itemIds
185
188
} ;
186
189
187
190
this . sessionRequest ( data , callback ) ;
@@ -193,11 +196,12 @@ MediaController.prototype.queueReorder = function(itemIds, options, callback) {
193
196
options = { } ;
194
197
}
195
198
196
- var data = { type : 'QUEUE_REORDER' ,
197
- currentItemId : options . currentItemId ,
198
- currentTime : options . currentTime ,
199
- insertBefore : options . insertBefore ,
200
- itemIds : itemIds
199
+ var data = {
200
+ type : 'QUEUE_REORDER' ,
201
+ currentItemId : options . currentItemId ,
202
+ currentTime : options . currentTime ,
203
+ insertBefore : options . insertBefore ,
204
+ itemIds : itemIds
201
205
} ;
202
206
203
207
this . sessionRequest ( data , callback ) ;
@@ -209,12 +213,13 @@ MediaController.prototype.queueUpdate = function(items, options, callback) {
209
213
options = { } ;
210
214
}
211
215
212
- var data = { type : 'QUEUE_UPDATE' ,
213
- currentItemId : options . currentItemId ,
214
- currentTime : options . currentTime ,
215
- jump : options . jump , //Skip or go back (if negative) number of items
216
- repeatMode : options . repeatMode ,
217
- items : items
216
+ var data = {
217
+ type : 'QUEUE_UPDATE' ,
218
+ currentItemId : options . currentItemId ,
219
+ currentTime : options . currentTime ,
220
+ jump : options . jump , //Skip or go back (if negative) number of items
221
+ repeatMode : options . repeatMode ,
222
+ items : items
218
223
} ;
219
224
220
225
this . sessionRequest ( data , callback ) ;
0 commit comments