Fixed video player

This commit is contained in:
Hadi Charara 2022-07-05 19:58:02 -04:00
parent 186ef937a5
commit 8488f48f99
5 changed files with 17 additions and 11 deletions

View File

@ -146,10 +146,6 @@
display: -webkit-flex; display: -webkit-flex;
align-items: center; align-items: center;
-webkit-box-align: center; -webkit-box-align: center;
[dir="rtl"] & {
flex-direction: row-reverse;
}
} }
.volumeButtons { .volumeButtons {

View File

@ -64,8 +64,7 @@
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
flex-shrink: 0; flex-shrink: 0;
margin-left: 5em; margin-inline: 5em 0.5em;
margin-right: 0.5em;
} }
.actionSheetScroller { .actionSheetScroller {

View File

@ -5,8 +5,7 @@ import keyboardnavigation from '../../scripts/keyboardNavigation';
import './emby-slider.scss'; import './emby-slider.scss';
import 'webcomponents.js/webcomponents-lite'; import 'webcomponents.js/webcomponents-lite';
import '../emby-input/emby-input'; import '../emby-input/emby-input';
import { getCurrentDateTimeLocale, getIsRTL } from '../../scripts/globalize'; import globalize from '../../scripts/globalize';
import datetime from '../../scripts/datetime';
/* eslint-disable indent */ /* eslint-disable indent */
@ -33,7 +32,7 @@ import datetime from '../../scripts/datetime';
const rect = range.sliderBubbleTrack.getBoundingClientRect(); const rect = range.sliderBubbleTrack.getBoundingClientRect();
let fraction = (clientX - rect.left) / rect.width; let fraction = (clientX - rect.left) / rect.width;
if (getIsRTL()) if (globalize.getElementIsRTL(range))
fraction = (rect.right - clientX) / rect.width; fraction = (rect.right - clientX) / rect.width;
// Snap to step // Snap to step
@ -115,7 +114,7 @@ import datetime from '../../scripts/datetime';
const bubbleRect = bubble.getBoundingClientRect(); const bubbleRect = bubble.getBoundingClientRect();
let bubblePos = bubbleTrackRect.width * value / 100; let bubblePos = bubbleTrackRect.width * value / 100;
if (getIsRTL()) { if (globalize.getElementIsRTL(range)) {
bubblePos = bubbleTrackRect.width - bubblePos; bubblePos = bubbleTrackRect.width - bubblePos;
} }
bubblePos = Math.min(Math.max(bubblePos, bubbleRect.width / 2), bubbleTrackRect.width - bubbleRect.width / 2); bubblePos = Math.min(Math.max(bubblePos, bubbleRect.width / 2), bubbleTrackRect.width - bubbleRect.width / 2);

View File

@ -43,6 +43,16 @@ import { currentSettings as userSettings } from './settings/userSettings';
return isRTL; return isRTL;
} }
export function getElementIsRTL(element) {
let elementIsRTL = false;
if (window.getComputedStyle) { // all browsers
elementIsRTL = window.getComputedStyle(element, null).getPropertyValue('direction') == 'rtl';
} else {
elementIsRTL = element.currentStyle.direction == 'rtl'; // IE5-8
}
return elementIsRTL;
}
export function updateCurrentCulture() { export function updateCurrentCulture() {
let culture; let culture;
try { try {
@ -271,7 +281,8 @@ export default {
getCurrentDateTimeLocale, getCurrentDateTimeLocale,
register, register,
updateCurrentCulture, updateCurrentCulture,
getIsRTL getIsRTL,
getElementIsRTL
}; };
/* eslint-enable indent */ /* eslint-enable indent */

View File

@ -12,6 +12,7 @@
.shopping_cart, .shopping_cart,
.vpn_key, .vpn_key,
.volume_up, .volume_up,
.volume_off,
.message { .message {
[dir='rtl'] & { [dir='rtl'] & {
transform: scale(-1, 1); transform: scale(-1, 1);