From 3080e8df4193b89f4863afc232a97d83c3f8ca64 Mon Sep 17 00:00:00 2001 From: dwithana Date: Thu, 9 May 2024 11:46:37 -0400 Subject: [PATCH] Remove CSS classes for captions, fix blank canvas CSS for multi-line messages --- .../MediaPlayer/VideoJS/VideoJSPlayer.js | 44 ++----------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/src/components/MediaPlayer/VideoJS/VideoJSPlayer.js b/src/components/MediaPlayer/VideoJS/VideoJSPlayer.js index bc23c492..5a81f3e8 100644 --- a/src/components/MediaPlayer/VideoJS/VideoJSPlayer.js +++ b/src/components/MediaPlayer/VideoJS/VideoJSPlayer.js @@ -142,20 +142,6 @@ function VideoJSPlayer({ let structuresRef = React.useRef(); structuresRef.current = structures; - // Classes for setting caption size based on device - let videoClass = ''; - if (IS_ANDROID) { - videoClass = "video-js vjs-big-play-centered android"; - // Not all Android tablets return 'Android' in the useragent so assume non-android, - // non-iOS touch devices are tablets. - } else if (IS_TOUCH_ONLY && !IS_IOS) { - videoClass = "video-js vjs-big-play-centered tablet"; - } else if (IS_IPAD) { - videoClass = "video-js vjs-big-play-centered tablet"; - } else { - videoClass = "video-js vjs-big-play-centered"; - }; - // Dispose Video.js instance when VideoJSPlayer component is removed React.useEffect(() => { return () => { @@ -829,30 +815,6 @@ function VideoJSPlayer({ return null; }; - let textPosterStyles = { - position: 'absolute', - top: 0, - left: 0, - right: 0, - bottom: 0, - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - fontSize: 'medium', - color: '#fff', - backgroundColor: 'black', - zIndex: 101, - }; - - if (canvasIsEmptyRef.current && !playerRef.current) { - textPosterStyles = { - ...textPosterStyles, - height: '88%', - width: '100%', - position: 'relative' - }; - } - return (
@@ -873,14 +835,16 @@ function VideoJSPlayer({ backgroundColor: 'black', zIndex: 101, aspectRatio: !playerRef.current ? '16/9' : '', - }} dangerouslySetInnerHTML={{ __html: placeholderText }}> + textAlign: 'center', + }}> +

)}