@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
|
@@ -72641,7 +72641,7 @@ function VideoMedia(media, xlr) {
|
|
|
72641
72641
|
if (vjsPlayer !== undefined) {
|
|
72642
72642
|
var playerReportFault = /*#__PURE__*/function () {
|
|
72643
72643
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(msg) {
|
|
72644
|
-
var playerSW, hasSW;
|
|
72644
|
+
var playerSW, hasSW, endVideo;
|
|
72645
72645
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
72646
72646
|
while (1) switch (_context.prev = _context.next) {
|
|
72647
72647
|
case 0:
|
|
@@ -72651,6 +72651,11 @@ function VideoMedia(media, xlr) {
|
|
|
72651
72651
|
return playerSW.getSW();
|
|
72652
72652
|
case 3:
|
|
72653
72653
|
hasSW = _context.sent;
|
|
72654
|
+
endVideo = function endVideo() {
|
|
72655
|
+
// Expire the media and dispose the video
|
|
72656
|
+
vjsPlayer.dispose();
|
|
72657
|
+
media.emitter.emit('end', media);
|
|
72658
|
+
};
|
|
72654
72659
|
if (hasSW) {
|
|
72655
72660
|
playerSW.postMsg({
|
|
72656
72661
|
type: 'MEDIA_FAULT',
|
|
@@ -72663,12 +72668,12 @@ function VideoMedia(media, xlr) {
|
|
|
72663
72668
|
// Temporary setting
|
|
72664
72669
|
expires: format(new Date(setExpiry(1)), 'yyyy-MM-dd HH:mm:ss')
|
|
72665
72670
|
})["finally"](function () {
|
|
72666
|
-
|
|
72667
|
-
vjsPlayer.dispose();
|
|
72668
|
-
media.emitter.emit('end', media);
|
|
72671
|
+
endVideo();
|
|
72669
72672
|
});
|
|
72673
|
+
} else {
|
|
72674
|
+
endVideo();
|
|
72670
72675
|
}
|
|
72671
|
-
case
|
|
72676
|
+
case 6:
|
|
72672
72677
|
case "end":
|
|
72673
72678
|
return _context.stop();
|
|
72674
72679
|
}
|
|
@@ -72686,53 +72691,91 @@ function VideoMedia(media, xlr) {
|
|
|
72686
72691
|
});
|
|
72687
72692
|
vjsPlayer.on('ready', function () {
|
|
72688
72693
|
vjsPlayer.muted(true);
|
|
72689
|
-
|
|
72690
|
-
|
|
72691
|
-
|
|
72692
|
-
|
|
72693
|
-
|
|
72694
|
-
|
|
72695
|
-
|
|
72696
|
-
|
|
72697
|
-
|
|
72698
|
-
|
|
72699
|
-
|
|
72700
|
-
|
|
72701
|
-
|
|
72702
|
-
|
|
72703
|
-
|
|
72704
|
-
|
|
72705
|
-
|
|
72706
|
-
|
|
72707
|
-
|
|
72708
|
-
|
|
72709
|
-
|
|
72710
|
-
|
|
72711
|
-
|
|
72712
|
-
|
|
72713
|
-
|
|
72714
|
-
};
|
|
72715
|
-
}
|
|
72716
|
-
}
|
|
72694
|
+
// Race promise between a 0.5s play and a 5s skip
|
|
72695
|
+
Promise.race([new Promise(function (resolve, reject) {
|
|
72696
|
+
return setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
72697
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
72698
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
72699
|
+
case 0:
|
|
72700
|
+
console.debug("".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id, " : Trying to force play after 0.1 seconds"));
|
|
72701
|
+
// Try to force play here
|
|
72702
|
+
_context2.prev = 1;
|
|
72703
|
+
_context2.next = 4;
|
|
72704
|
+
return vjsPlayer.play();
|
|
72705
|
+
case 4:
|
|
72706
|
+
// Resolve if play works
|
|
72707
|
+
resolve(true);
|
|
72708
|
+
_context2.next = 10;
|
|
72709
|
+
break;
|
|
72710
|
+
case 7:
|
|
72711
|
+
_context2.prev = 7;
|
|
72712
|
+
_context2.t0 = _context2["catch"](1);
|
|
72713
|
+
// Reject race if play fails
|
|
72714
|
+
reject('Play failed');
|
|
72715
|
+
case 10:
|
|
72716
|
+
case "end":
|
|
72717
|
+
return _context2.stop();
|
|
72718
|
+
}
|
|
72719
|
+
}, _callee2, null, [[1, 7]]);
|
|
72720
|
+
})), 100);
|
|
72721
|
+
}), new Promise(function (_, reject) {
|
|
72722
|
+
return setTimeout(function () {
|
|
72723
|
+
return reject('Timeout');
|
|
72724
|
+
}, 5000);
|
|
72725
|
+
})]).then(function () {
|
|
72726
|
+
console.debug("".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id, " : Autoplay started"));
|
|
72727
|
+
})["catch"]( /*#__PURE__*/function () {
|
|
72728
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(error) {
|
|
72729
|
+
var _media$emitter;
|
|
72730
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
72731
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
72732
|
+
case 0:
|
|
72733
|
+
if (!(error === 'Timeout')) {
|
|
72734
|
+
_context3.next = 6;
|
|
72735
|
+
break;
|
|
72736
|
+
}
|
|
72737
|
+
console.debug("".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id, " : Promise not resolved within 5 seconds. Move to next media"));
|
|
72738
|
+
vjsPlayer.dispose();
|
|
72739
|
+
(_media$emitter = media.emitter) === null || _media$emitter === void 0 || _media$emitter.emit('end', media);
|
|
72740
|
+
_context3.next = 10;
|
|
72741
|
+
break;
|
|
72742
|
+
case 6:
|
|
72743
|
+
console.debug("".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id, " : Autoplay error: ").concat(error));
|
|
72744
|
+
if (!(xlr.config.platform === 'chromeOS')) {
|
|
72745
|
+
_context3.next = 10;
|
|
72746
|
+
break;
|
|
72747
|
+
}
|
|
72748
|
+
_context3.next = 10;
|
|
72749
|
+
return playerReportFault('Media autoplay error');
|
|
72750
|
+
case 10:
|
|
72751
|
+
case "end":
|
|
72752
|
+
return _context3.stop();
|
|
72753
|
+
}
|
|
72754
|
+
}, _callee3);
|
|
72755
|
+
}));
|
|
72756
|
+
return function (_x2) {
|
|
72757
|
+
return _ref3.apply(this, arguments);
|
|
72758
|
+
};
|
|
72759
|
+
}());
|
|
72717
72760
|
});
|
|
72718
72761
|
vjsPlayer.on('playing', function () {
|
|
72719
72762
|
console.debug("".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id, " is now playing . . ."));
|
|
72720
72763
|
vjsPlayer.muted(media.muted);
|
|
72721
72764
|
});
|
|
72722
72765
|
vjsPlayer.on('error', /*#__PURE__*/function () {
|
|
72723
|
-
var
|
|
72724
|
-
return _regeneratorRuntime().wrap(function
|
|
72725
|
-
while (1) switch (
|
|
72766
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(err) {
|
|
72767
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
72768
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
72726
72769
|
case 0:
|
|
72727
72770
|
console.debug("Media Error: ".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id));
|
|
72728
72771
|
if (!(xlr.config.platform === 'chromeOS')) {
|
|
72729
|
-
|
|
72772
|
+
_context4.next = 6;
|
|
72730
72773
|
break;
|
|
72731
72774
|
}
|
|
72732
|
-
|
|
72775
|
+
_context4.next = 4;
|
|
72733
72776
|
return playerReportFault('Video file source not supported');
|
|
72734
72777
|
case 4:
|
|
72735
|
-
|
|
72778
|
+
_context4.next = 7;
|
|
72736
72779
|
break;
|
|
72737
72780
|
case 6:
|
|
72738
72781
|
// End media after 5 seconds
|
|
@@ -72743,18 +72786,18 @@ function VideoMedia(media, xlr) {
|
|
|
72743
72786
|
}, 5000);
|
|
72744
72787
|
case 7:
|
|
72745
72788
|
case "end":
|
|
72746
|
-
return
|
|
72789
|
+
return _context4.stop();
|
|
72747
72790
|
}
|
|
72748
|
-
},
|
|
72791
|
+
}, _callee4);
|
|
72749
72792
|
}));
|
|
72750
72793
|
return function (_x3) {
|
|
72751
|
-
return
|
|
72794
|
+
return _ref4.apply(this, arguments);
|
|
72752
72795
|
};
|
|
72753
72796
|
}());
|
|
72754
72797
|
vjsPlayer.on('ended', function () {
|
|
72755
|
-
var _media$
|
|
72798
|
+
var _media$emitter2;
|
|
72756
72799
|
console.debug("VideoMedia: onended: ".concat(capitalizeStr(media.mediaType), " for media > ").concat(media.id, " has ended playing . . ."));
|
|
72757
|
-
(_media$
|
|
72800
|
+
(_media$emitter2 = media.emitter) === null || _media$emitter2 === void 0 || _media$emitter2.emit('end', media);
|
|
72758
72801
|
vjsPlayer.dispose();
|
|
72759
72802
|
});
|
|
72760
72803
|
vjsPlayer.on('durationchange', function () {
|