Improve mobile ux with videojs-mobile-ui

This commit is contained in:
syeopite 2021-04-10 20:22:30 -07:00
parent 8bc91ced4f
commit 53cdb04be7
No known key found for this signature in database
GPG key ID: 6FA616E5A5294A82
4 changed files with 22 additions and 0 deletions

View file

@ -73,6 +73,12 @@ if (location.pathname.startsWith('/embed/')) {
});
}
// Detect mobile users and initalize mobileUi for better UX
// Detection code taken from https://stackoverflow.com/a/24600597
if (/Mobi|Android/i.test(navigator.userAgent)) {
player.mobileUi();
}
player.on('error', function (event) {
if (player.error().code === 2 || player.error().code === 4) {
setTimeout(function (event) {