mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Fixes video filter issues (#3792)
This commit is contained in:
@@ -108,15 +108,26 @@ export const SceneVideoFilterPanel: React.FC<ISceneVideoFilterPanelProps> = (
|
|||||||
aspectRatioRange.default
|
aspectRatioRange.default
|
||||||
);
|
);
|
||||||
|
|
||||||
function updateVideoStyle() {
|
// eslint-disable-next-line
|
||||||
const playerVideoContainer = document.getElementById(VIDEO_PLAYER_ID);
|
function getVideoElement(playerVideoContainer: any) {
|
||||||
const videoElements =
|
let videoElements = playerVideoContainer.getElementsByTagName("canvas");
|
||||||
playerVideoContainer?.getElementsByTagName("canvas") ??
|
|
||||||
playerVideoContainer?.getElementsByTagName("video") ??
|
|
||||||
[];
|
|
||||||
const playerVideoElement =
|
|
||||||
videoElements.length > 0 ? videoElements[0] : null;
|
|
||||||
|
|
||||||
|
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) {
|
if (playerVideoElement != null) {
|
||||||
let styleString = "filter:";
|
let styleString = "filter:";
|
||||||
let style = playerVideoElement.attributes.getNamedItem("style");
|
let style = playerVideoElement.attributes.getNamedItem("style");
|
||||||
@@ -188,6 +199,10 @@ export const SceneVideoFilterPanel: React.FC<ISceneVideoFilterPanelProps> = (
|
|||||||
styleString += ` scale(${xScale},${yScale})`;
|
styleString += ` scale(${xScale},${yScale})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (playerVideoElement.tagName == "CANVAS") {
|
||||||
|
styleString += "; width: 100%; height: 100%; position: absolute; top:0";
|
||||||
|
}
|
||||||
|
|
||||||
style.value = `${styleString};`;
|
style.value = `${styleString};`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user