Skip to content

Commit

Permalink
[Test] Try Load Video
Browse files Browse the repository at this point in the history
  • Loading branch information
jaruba committed May 30, 2024
1 parent a6343de commit 270e1fe
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/WebOsVideo/WebOsVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ function WebOsVideo(options) {
if (subscribed) return;
subscribed = true;
var answered = false;
setTimeout(function() {
loadVideo();
}, 0);
luna({
method: 'subscribe',
parameters: {
Expand Down Expand Up @@ -338,6 +341,26 @@ function WebOsVideo(options) {
});
};

var loadVideo = function () {
if (!subscribed) return;
subscribed = false;
luna({
method: 'load',
parameters: {
'mediaId': mediaId()
}
}, function (result) {
// eslint-disable-next-line no-console
console.log('luna load result', JSON.stringify(result || {}));
}, function (err) {
// eslint-disable-next-line no-console
console.log('luna load error', JSON.stringify(err || {}));
});
if (cb) {
cb();
}
};

var unsubscribe = function (cb) {
if (!subscribed) return;
subscribed = false;
Expand Down

0 comments on commit 270e1fe

Please sign in to comment.