dont run image preview on mobile (#1527)

This commit is contained in:
mayeaux 2022-05-18 22:50:30 +02:00 committed by GitHub
parent 746d321dfe
commit bb065eb408
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,6 +106,7 @@ type Props = {
}; };
const IS_IOS = platform.isIOS(); const IS_IOS = platform.isIOS();
const IS_MOBILE = platform.isMobile();
const PLUGIN_MAP = { const PLUGIN_MAP = {
eventTracking: eventTracking, eventTracking: eventTracking,
@ -397,10 +398,13 @@ export default React.memo<Props>(function VideoJs(props: Props) {
const trimmedPath = response.url.substring(0, response.url.lastIndexOf('/')); const trimmedPath = response.url.substring(0, response.url.lastIndexOf('/'));
const thumbnailPath = trimmedPath + '/stream_sprite.vtt'; const thumbnailPath = trimmedPath + '/stream_sprite.vtt';
vjsPlayer.vttThumbnails({ // disable thumbnails on mobile for now
src: thumbnailPath, if (!IS_MOBILE) {
showTimestamp: true, vjsPlayer.vttThumbnails({
}); src: thumbnailPath,
showTimestamp: true,
});
}
} else { } else {
vjsPlayer.src(vjsPlayer.claimSrcOriginal); vjsPlayer.src(vjsPlayer.claimSrcOriginal);
} }