mirror of
https://github.com/stashapp/stash.git
synced 2025-12-10 10:22:18 +01:00
Fixes video filter issues (#3792)
This commit is contained in:
parent
94450da8b5
commit
c8a796e125
1 changed files with 23 additions and 8 deletions
|
|
@ -108,15 +108,26 @@ export const SceneVideoFilterPanel: React.FC<ISceneVideoFilterPanelProps> = (
|
|||
aspectRatioRange.default
|
||||
);
|
||||
|
||||
function updateVideoStyle() {
|
||||
const playerVideoContainer = document.getElementById(VIDEO_PLAYER_ID);
|
||||
const videoElements =
|
||||
playerVideoContainer?.getElementsByTagName("canvas") ??
|
||||
playerVideoContainer?.getElementsByTagName("video") ??
|
||||
[];
|
||||
const playerVideoElement =
|
||||
videoElements.length > 0 ? videoElements[0] : null;
|
||||
// eslint-disable-next-line
|
||||
function getVideoElement(playerVideoContainer: any) {
|
||||
let videoElements = playerVideoContainer.getElementsByTagName("canvas");
|
||||
|
||||
if (videoElements.length == 0) {
|
||||
videoElements = playerVideoContainer.getElementsByTagName("video");
|
||||
}
|
||||
|
||||
if (videoElements.length > 0) {
|
||||
return videoElements[0];
|
||||
}
|
||||
}
|
||||
|
||||
function updateVideoStyle() {
|
||||
const playerVideoContainer = document.getElementById(VIDEO_PLAYER_ID)!;
|
||||
if (!playerVideoContainer) {
|
||||
return;
|
||||
}
|
||||
|
||||
const playerVideoElement = getVideoElement(playerVideoContainer);
|
||||
if (playerVideoElement != null) {
|
||||
let styleString = "filter:";
|
||||
let style = playerVideoElement.attributes.getNamedItem("style");
|
||||
|
|
@ -188,6 +199,10 @@ export const SceneVideoFilterPanel: React.FC<ISceneVideoFilterPanelProps> = (
|
|||
styleString += ` scale(${xScale},${yScale})`;
|
||||
}
|
||||
|
||||
if (playerVideoElement.tagName == "CANVAS") {
|
||||
styleString += "; width: 100%; height: 100%; position: absolute; top:0";
|
||||
}
|
||||
|
||||
style.value = `${styleString};`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue