Support dynamic resolution with WebGL2 in Genshin

This commit is contained in:
redphx 2024-12-07 08:24:44 +07:00
parent 1ca2b771e7
commit cf4609d87b
4 changed files with 9 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -71,12 +71,14 @@ div[data-testid=media-container] {
align-self: center;
background: #000;
position: absolute;
left: 0;
right: 0;
}
canvas {
position: absolute;
align-self: center;
margin: auto;
position: absolute;
left: 0;
right: 0;
}

View File

@ -180,6 +180,8 @@ export class StreamPlayer {
$webGL2Canvas.style.width = targetWidth;
$webGL2Canvas.style.height = targetHeight;
$webGL2Canvas.style.objectFit = targetObjectFit;
$video.dispatchEvent(new Event('resize'));
}
// Update video dimensions