Skip to content

Commit b7cbc11

Browse files
committedDec 30, 2016
fixed alignments
1 parent 59ee9c7 commit b7cbc11

File tree

1 file changed

+28
-23
lines changed

1 file changed

+28
-23
lines changed
 

‎lib/controllers/media.js

+28-23
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ MediaController.prototype.seek = function(currentTime, callback) {
116116
this.sessionRequest(data, callback);
117117
};
118118

119+
//Load a queue of items to play (playlist)
119120
//See https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueLoadRequest
120121
MediaController.prototype.queueLoad = function(items, options, callback) {
121122

@@ -132,11 +133,11 @@ MediaController.prototype.queueLoad = function(items, options, callback) {
132133
? options.repeatMode
133134
: "REPEAT_OFF";
134135

135-
data.currentTime = (typeof options.currentTime !== 'undefined')
136+
data.currentTime = (typeof options.currentTime !== 'undefined')
136137
? options.currentTime
137138
: 0;
138139

139-
data.startIndex = (typeof options.startIndex !== 'undefined')
140+
data.startIndex = (typeof options.startIndex !== 'undefined')
140141
? options.startIndex
141142
: 0;
142143

@@ -161,12 +162,13 @@ MediaController.prototype.queueInsert = function(items, options, callback) {
161162
options = {};
162163
}
163164

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
170172
};
171173

172174
this.sessionRequest(data, callback);
@@ -178,10 +180,11 @@ MediaController.prototype.queueRemove = function(itemIds, options, callback) {
178180
options = {};
179181
}
180182

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
185188
};
186189

187190
this.sessionRequest(data, callback);
@@ -193,11 +196,12 @@ MediaController.prototype.queueReorder = function(itemIds, options, callback) {
193196
options = {};
194197
}
195198

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
201205
};
202206

203207
this.sessionRequest(data, callback);
@@ -209,12 +213,13 @@ MediaController.prototype.queueUpdate = function(items, options, callback) {
209213
options = {};
210214
}
211215

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
218223
};
219224

220225
this.sessionRequest(data, callback);

0 commit comments

Comments
 (0)
Please sign in to comment.