Skip to content

Commit 57edc94

Browse files
author
Jeremy White
committed
Send command response immediately upon seeking, fixes #1
1 parent 0b180ca commit 57edc94

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

dist/connect_bridge.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ var connectsdk = (function () {
409409
if (playState == null)
410410
return;
411411

412-
// TODO: add to id here
413412
this.broadcastMessage({
414413
contentType: 'connectsdk.mediaEvent',
415414
mediaEvent: {
@@ -441,13 +440,25 @@ var connectsdk = (function () {
441440
},
442441

443442
handleSeek: function (msgData) {
444-
var position = msgData.message.mediaCommand.position;
443+
var from = msgData.from;
444+
var mediaCommand = msgData.message.mediaCommand;
445+
var commandType = mediaCommand.type;
446+
var requestId = mediaCommand.requestId;
447+
var position = mediaCommand.position;
448+
445449
if (position) {
446-
var requestId = msgData.message.mediaCommand.requestId;
447450
var mediaElement = this.mediaElement;
448451
mediaElement && (mediaElement.currentTime = position);
449-
this.handleMediaStatusUpdate(requestId);
452+
this.handleMediaStatusUpdate(-1);
450453
}
454+
455+
this.sendMessage(from, {
456+
contentType: 'connectsdk.mediaCommandResponse',
457+
mediaCommandResponse: {
458+
type: commandType,
459+
requestId: requestId
460+
}
461+
});
451462
}
452463
};
453464

0 commit comments

Comments
 (0)