@xibosignage/xibo-layout-renderer 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/xibo-layout-renderer.cjs.js +87 -44
- package/dist/xibo-layout-renderer.cjs.js.map +1 -1
- package/dist/xibo-layout-renderer.esm.js +87 -44
- package/dist/xibo-layout-renderer.esm.js.map +1 -1
- package/dist/xibo-layout-renderer.js +87 -44
- package/dist/xibo-layout-renderer.min.js +1 -1
- package/dist/xibo-layout-renderer.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -72645,7 +72645,7 @@ function VideoMedia(media, xlr) {
|
|
|
72645
72645
|
if (vjsPlayer !== undefined) {
|
|
72646
72646
|
var playerReportFault = /*#__PURE__*/function () {
|
|
72647
72647
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(msg) {
|
|
72648
|
-
var playerSW, hasSW;
|
|
72648
|
+
var playerSW, hasSW, endVideo;
|
|
72649
72649
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
72650
72650
|
while (1) switch (_context.prev = _context.next) {
|
|
72651
72651
|
case 0:
|
|
@@ -72655,6 +72655,11 @@ function VideoMedia(media, xlr) {
|
|
|
72655
72655
|
return playerSW.getSW();
|
|
72656
72656
|
case 3:
|
|
72657
72657
|
hasSW = _context.sent;
|
|
72658
|
+
endVideo = function endVideo() {
|
|
72659
|
+
// Expire the media and dispose the video
|
|
72660
|
+
vjsPlayer.dispose();
|
|
72661
|
+
media.emitter.emit('end', media);
|
|
72662
|
+
};
|
|
72658
72663
|
if (hasSW) {
|
|
72659
72664
|
playerSW.postMsg({
|
|
72660
72665
|
type: 'MEDIA_FAULT',
|
|
@@ -72667,12 +72672,12 @@ function VideoMedia(media, xlr) {
|
|
|
72667
72672
|
// Temporary setting
|
|
72668
72673
|
expires: format(new Date(setExpiry(1)), 'yyyy-MM-dd HH:mm:ss')
|
|
72669
72674
|
})["finally"](function () {
|
|
72670
|
-
|
|
72671
|
-
vjsPlayer.dispose();
|
|
72672
|
-
media.emitter.emit('end', media);
|
|
72675
|
+
endVideo();
|
|
72673
72676
|
});
|
|
72677
|
+
} else {
|
|
72678
|
+
endVideo();
|
|
72674
72679
|
}
|
|
72675
|
-
case
|
|
72680
|
+
case 6:
|
|
72676
72681
|
case "end":
|
|
72677
72682
|
return _context.stop();
|
|
72678
72683
|
}
|
|
@@ -72690,53 +72695,91 @@ function VideoMedia(media, xlr) {
|
|
|
72690
72695
|
});
|
|
72691
72696
|
vjsPlayer.on('ready', function () {
|
|
72692
72697
|
vjsPlayer.muted(true);
|
|
72693
|
-
|
|
72694
|
-
|
|
72695
|
-
|
|
72696
|
-
|
|
72697
|
-
|
|
72698
|
-
|
|
72699
|
-
|
|
72700
|
-
|
|
72701
|
-
|
|
72702
|
-
|
|
72703
|
-
|
|
72704
|
-
|
|
72705
|
-
|
|
72706
|
-
|
|
72707
|
-
|
|
72708
|
-
|
|
72709
|
-
|
|
72710
|
-
|
|
72711
|
-
|
|
72712
|
-
|
|
72713
|
-
|
|
72714
|
-
|
|
72715
|
-
|
|
72716
|
-
|
|
72717
|
-
|
|
72718
|
-
};
|
|
72719
|
-
}
|
|
72720
|
-
}
|
|
72698
|
+
// Race promise between a 0.5s play and a 5s skip
|
|
72699
|
+
Promise.race([new Promise(function (resolve, reject) {
|
|
72700
|
+
return setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
72701
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
72702
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
72703
|
+
case 0:
|
|
72704
|
+
console.debug("".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id, " : Trying to force play after 0.1 seconds"));
|
|
72705
|
+
// Try to force play here
|
|
72706
|
+
_context2.prev = 1;
|
|
72707
|
+
_context2.next = 4;
|
|
72708
|
+
return vjsPlayer.play();
|
|
72709
|
+
case 4:
|
|
72710
|
+
// Resolve if play works
|
|
72711
|
+
resolve(true);
|
|
72712
|
+
_context2.next = 10;
|
|
72713
|
+
break;
|
|
72714
|
+
case 7:
|
|
72715
|
+
_context2.prev = 7;
|
|
72716
|
+
_context2.t0 = _context2["catch"](1);
|
|
72717
|
+
// Reject race if play fails
|
|
72718
|
+
reject('Play failed');
|
|
72719
|
+
case 10:
|
|
72720
|
+
case "end":
|
|
72721
|
+
return _context2.stop();
|
|
72722
|
+
}
|
|
72723
|
+
}, _callee2, null, [[1, 7]]);
|
|
72724
|
+
})), 100);
|
|
72725
|
+
}), new Promise(function (_, reject) {
|
|
72726
|
+
return setTimeout(function () {
|
|
72727
|
+
return reject('Timeout');
|
|
72728
|
+
}, 5000);
|
|
72729
|
+
})]).then(function () {
|
|
72730
|
+
console.debug("".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id, " : Autoplay started"));
|
|
72731
|
+
})["catch"]( /*#__PURE__*/function () {
|
|
72732
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(error) {
|
|
72733
|
+
var _media$emitter;
|
|
72734
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
72735
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
72736
|
+
case 0:
|
|
72737
|
+
if (!(error === 'Timeout')) {
|
|
72738
|
+
_context3.next = 6;
|
|
72739
|
+
break;
|
|
72740
|
+
}
|
|
72741
|
+
console.debug("".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id, " : Promise not resolved within 5 seconds. Move to next media"));
|
|
72742
|
+
vjsPlayer.dispose();
|
|
72743
|
+
(_media$emitter = media.emitter) === null || _media$emitter === void 0 || _media$emitter.emit('end', media);
|
|
72744
|
+
_context3.next = 10;
|
|
72745
|
+
break;
|
|
72746
|
+
case 6:
|
|
72747
|
+
console.debug("".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id, " : Autoplay error: ").concat(error));
|
|
72748
|
+
if (!(xlr.config.platform === 'chromeOS')) {
|
|
72749
|
+
_context3.next = 10;
|
|
72750
|
+
break;
|
|
72751
|
+
}
|
|
72752
|
+
_context3.next = 10;
|
|
72753
|
+
return playerReportFault('Media autoplay error');
|
|
72754
|
+
case 10:
|
|
72755
|
+
case "end":
|
|
72756
|
+
return _context3.stop();
|
|
72757
|
+
}
|
|
72758
|
+
}, _callee3);
|
|
72759
|
+
}));
|
|
72760
|
+
return function (_x2) {
|
|
72761
|
+
return _ref3.apply(this, arguments);
|
|
72762
|
+
};
|
|
72763
|
+
}());
|
|
72721
72764
|
});
|
|
72722
72765
|
vjsPlayer.on('playing', function () {
|
|
72723
72766
|
console.debug("".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id, " is now playing . . ."));
|
|
72724
72767
|
vjsPlayer.muted(media.muted);
|
|
72725
72768
|
});
|
|
72726
72769
|
vjsPlayer.on('error', /*#__PURE__*/function () {
|
|
72727
|
-
var
|
|
72728
|
-
return _regeneratorRuntime().wrap(function
|
|
72729
|
-
while (1) switch (
|
|
72770
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(err) {
|
|
72771
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
72772
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
72730
72773
|
case 0:
|
|
72731
72774
|
console.debug("Media Error: ".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id));
|
|
72732
72775
|
if (!(xlr.config.platform === 'chromeOS')) {
|
|
72733
|
-
|
|
72776
|
+
_context4.next = 6;
|
|
72734
72777
|
break;
|
|
72735
72778
|
}
|
|
72736
|
-
|
|
72779
|
+
_context4.next = 4;
|
|
72737
72780
|
return playerReportFault('Video file source not supported');
|
|
72738
72781
|
case 4:
|
|
72739
|
-
|
|
72782
|
+
_context4.next = 7;
|
|
72740
72783
|
break;
|
|
72741
72784
|
case 6:
|
|
72742
72785
|
// End media after 5 seconds
|
|
@@ -72747,18 +72790,18 @@ function VideoMedia(media, xlr) {
|
|
|
72747
72790
|
}, 5000);
|
|
72748
72791
|
case 7:
|
|
72749
72792
|
case "end":
|
|
72750
|
-
return
|
|
72793
|
+
return _context4.stop();
|
|
72751
72794
|
}
|
|
72752
|
-
},
|
|
72795
|
+
}, _callee4);
|
|
72753
72796
|
}));
|
|
72754
72797
|
return function (_x3) {
|
|
72755
|
-
return
|
|
72798
|
+
return _ref4.apply(this, arguments);
|
|
72756
72799
|
};
|
|
72757
72800
|
}());
|
|
72758
72801
|
vjsPlayer.on('ended', function () {
|
|
72759
|
-
var _media$
|
|
72802
|
+
var _media$emitter2;
|
|
72760
72803
|
console.debug("VideoMedia: onended: ".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id, " has ended playing . . ."));
|
|
72761
|
-
(_media$
|
|
72804
|
+
(_media$emitter2 = media.emitter) === null || _media$emitter2 === void 0 || _media$emitter2.emit('end', media);
|
|
72762
72805
|
vjsPlayer.dispose();
|
|
72763
72806
|
});
|
|
72764
72807
|
vjsPlayer.on('durationchange', function () {
|