mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-17 02:16:54 +00:00
4.19.11
* Fixed: Add support for a player experiment that renames internal state, breaking certain FrankerFaceZ features that interact with the player.
This commit is contained in:
parent
13af2f3046
commit
b3266a2ef3
3 changed files with 16 additions and 13 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "frankerfacez",
|
"name": "frankerfacez",
|
||||||
"author": "Dan Salvato LLC",
|
"author": "Dan Salvato LLC",
|
||||||
"version": "4.19.10",
|
"version": "4.19.11",
|
||||||
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -220,7 +220,7 @@ export default class Metadata extends Module {
|
||||||
skippedFrames: temp.dropped_frames,
|
skippedFrames: temp.dropped_frames,
|
||||||
videoResolution: `${temp.vid_width}x${temp.vid_height}`
|
videoResolution: `${temp.vid_width}x${temp.vid_height}`
|
||||||
}
|
}
|
||||||
} else if ( player.stats ) {
|
} else if ( player.stats || player.core?.stats ) {
|
||||||
const videoHeight = maybe_call(player.getVideoHeight, player) || 0,
|
const videoHeight = maybe_call(player.getVideoHeight, player) || 0,
|
||||||
videoWidth = maybe_call(player.getVideoWidth, player) || 0,
|
videoWidth = maybe_call(player.getVideoWidth, player) || 0,
|
||||||
displayHeight = maybe_call(player.getDisplayHeight, player) || 0,
|
displayHeight = maybe_call(player.getDisplayHeight, player) || 0,
|
||||||
|
@ -237,8 +237,8 @@ export default class Metadata extends Module {
|
||||||
displayWidth,
|
displayWidth,
|
||||||
rate: maybe_call(player.getPlaybackRate, player),
|
rate: maybe_call(player.getPlaybackRate, player),
|
||||||
fps: Math.floor(maybe_call(player.getVideoFrameRate, player) || 0),
|
fps: Math.floor(maybe_call(player.getVideoFrameRate, player) || 0),
|
||||||
hlsLatencyBroadcaster: player.stats?.broadcasterLatency,
|
hlsLatencyBroadcaster: player.stats?.broadcasterLatency || player.core?.stats?.broadcasterLatency,
|
||||||
hlsLatencyEncoder: player.stats?.transcoderLatency,
|
hlsLatencyEncoder: player.stats?.transcoderLatency || player.core?.stats?.transcoderLatency,
|
||||||
playbackRate: Math.floor((maybe_call(player.getVideoBitRate, player) || 0) / 1000),
|
playbackRate: Math.floor((maybe_call(player.getVideoBitRate, player) || 0) / 1000),
|
||||||
skippedFrames: maybe_call(player.getDroppedFrames, player),
|
skippedFrames: maybe_call(player.getDroppedFrames, player),
|
||||||
}
|
}
|
||||||
|
|
|
@ -715,7 +715,7 @@ export default class Player extends Module {
|
||||||
|
|
||||||
const delta = event.wheelDelta || -(event.deltaY || event.detail || 0),
|
const delta = event.wheelDelta || -(event.deltaY || event.detail || 0),
|
||||||
player = this.props?.mediaPlayerInstance,
|
player = this.props?.mediaPlayerInstance,
|
||||||
video = player?.mediaSinkManager?.video;
|
video = player?.mediaSinkManager?.video || player?.core?.mediaSinkManager?.video;
|
||||||
|
|
||||||
if ( ! player?.getVolume )
|
if ( ! player?.getVolume )
|
||||||
return;
|
return;
|
||||||
|
@ -960,7 +960,7 @@ export default class Player extends Module {
|
||||||
|
|
||||||
addCompressorButton(inst, visible_only, tries = 0) {
|
addCompressorButton(inst, visible_only, tries = 0) {
|
||||||
const outer = inst.props.containerRef || this.fine.getChildNode(inst),
|
const outer = inst.props.containerRef || this.fine.getChildNode(inst),
|
||||||
video = inst.props.mediaPlayerInstance?.mediaSinkManager?.video,
|
video = inst.props.mediaPlayerInstance?.mediaSinkManager?.video || inst.props.mediaPlayerInstance?.core?.mediaSinkManager?.video,
|
||||||
container = outer && outer.querySelector('.player-controls__left-control-group'),
|
container = outer && outer.querySelector('.player-controls__left-control-group'),
|
||||||
has_comp = HAS_COMPRESSOR && video != null && this.settings.get('player.compressor.enable');
|
has_comp = HAS_COMPRESSOR && video != null && this.settings.get('player.compressor.enable');
|
||||||
|
|
||||||
|
@ -1032,7 +1032,8 @@ export default class Player extends Module {
|
||||||
}
|
}
|
||||||
|
|
||||||
compressPlayer(inst, e) {
|
compressPlayer(inst, e) {
|
||||||
const video = inst.props.mediaPlayerInstance?.mediaSinkManager?.video;
|
const video = inst.props.mediaPlayerInstance?.mediaSinkManager?.video ||
|
||||||
|
inst.props.mediaPlayerInstance?.core?.mediaSinkManager?.video;
|
||||||
if ( ! video || ! HAS_COMPRESSOR )
|
if ( ! video || ! HAS_COMPRESSOR )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1088,7 +1089,7 @@ export default class Player extends Module {
|
||||||
if ( player == null )
|
if ( player == null )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const video = player.mediaSinkManager?.video;
|
const video = player.mediaSinkManager?.video || player.core?.mediaSinkManager?.video;
|
||||||
if ( ! video )
|
if ( ! video )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1133,7 +1134,8 @@ export default class Player extends Module {
|
||||||
|
|
||||||
updateCompressor(inst, comp) {
|
updateCompressor(inst, comp) {
|
||||||
if ( comp == null ) {
|
if ( comp == null ) {
|
||||||
const video = inst.props.mediaPlayerInstance?.mediaSinkManager?.video;
|
const video = inst.props.mediaPlayerInstance?.mediaSinkManager?.video ||
|
||||||
|
inst.props.mediaPlayerInstance?.core?.mediaSinkManager?.video;
|
||||||
comp = video?._ffz_compressor;
|
comp = video?._ffz_compressor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1150,7 +1152,7 @@ export default class Player extends Module {
|
||||||
|
|
||||||
addPiPButton(inst, tries = 0) {
|
addPiPButton(inst, tries = 0) {
|
||||||
const outer = inst.props.containerRef || this.fine.getChildNode(inst),
|
const outer = inst.props.containerRef || this.fine.getChildNode(inst),
|
||||||
video = inst.props.mediaPlayerInstance?.mediaSinkManager?.video,
|
video = inst.props.mediaPlayerInstance?.mediaSinkManager?.video || inst.props.mediaPlayerInstance?.core?.mediaSinkManager?.video,
|
||||||
is_fs = video && document.fullscreenElement && document.fullscreenElement.contains(video),
|
is_fs = video && document.fullscreenElement && document.fullscreenElement.contains(video),
|
||||||
container = outer && outer.querySelector('.player-controls__right-control-group'),
|
container = outer && outer.querySelector('.player-controls__right-control-group'),
|
||||||
has_pip = document.pictureInPictureEnabled && this.settings.get('player.button.pip');
|
has_pip = document.pictureInPictureEnabled && this.settings.get('player.button.pip');
|
||||||
|
@ -1223,7 +1225,8 @@ export default class Player extends Module {
|
||||||
|
|
||||||
|
|
||||||
pipPlayer(inst, e) {
|
pipPlayer(inst, e) {
|
||||||
const video = inst.props.mediaPlayerInstance?.mediaSinkManager?.video;
|
const video = inst.props.mediaPlayerInstance?.mediaSinkManager?.video ||
|
||||||
|
inst.props.mediaPlayerInstance?.core?.mediaSinkManager?.video;
|
||||||
if ( ! video || ! document.pictureInPictureEnabled )
|
if ( ! video || ! document.pictureInPictureEnabled )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1382,7 +1385,7 @@ export default class Player extends Module {
|
||||||
|
|
||||||
|
|
||||||
resetPlayer(inst, e) {
|
resetPlayer(inst, e) {
|
||||||
const player = inst ? (inst.mediaSinkManager ? inst : inst?.props?.mediaPlayerInstance) : null;
|
const player = inst ? ((inst.mediaSinkManager || inst.core?.mediaSinkManager) ? inst : inst?.props?.mediaPlayerInstance) : null;
|
||||||
|
|
||||||
if ( e ) {
|
if ( e ) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -1404,7 +1407,7 @@ export default class Player extends Module {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const video = player.mediaSinkManager?.video;
|
const video = player.mediaSinkManager?.video || player.core?.mediaSinkManager?.video;
|
||||||
if ( video?._ffz_compressor && player.attachHTMLVideoElement ) {
|
if ( video?._ffz_compressor && player.attachHTMLVideoElement ) {
|
||||||
const new_vid = createElement('video'),
|
const new_vid = createElement('video'),
|
||||||
vol = player.getVolume(),
|
vol = player.getVolume(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue