mirror of
https://github.com/CompeyDev/fxtwitter-docker.git
synced 2025-04-03 17:40:56 +01:00
Workaround for video issues on iOS (fix #859)
This commit is contained in:
parent
88943830db
commit
b09e5909a2
2 changed files with 12 additions and 1 deletions
|
@ -4,7 +4,8 @@ export enum Experiment {
|
|||
TWEET_DETAIL_API = 'TWEET_DETAIL_API',
|
||||
DISCORD_NATIVE_MULTI_IMAGE = 'DISCORD_NATIVE_MULTI_IMAGE',
|
||||
TRANSCODE_GIFS = 'TRANSCODE_GIFS',
|
||||
IV_FORCE_THREAD_UNROLL = 'IV_FORCE_THREAD_UNROLL'
|
||||
IV_FORCE_THREAD_UNROLL = 'IV_FORCE_THREAD_UNROLL',
|
||||
DISCORD_VIDEO_REDIRECT_WORKAROUND = 'DISCORD_VIDEO_REDIRECT_WORKAROUND'
|
||||
}
|
||||
|
||||
type ExperimentConfig = {
|
||||
|
@ -43,6 +44,11 @@ const Experiments: { [key in Experiment]: ExperimentConfig } = {
|
|||
name: 'IV force thread unroll',
|
||||
description: 'Force thread unroll for Telegram Instant View',
|
||||
percentage: 1
|
||||
},
|
||||
[Experiment.DISCORD_VIDEO_REDIRECT_WORKAROUND]: {
|
||||
name: 'Video redirect workaround',
|
||||
description: 'Workaround for video playback issues on Discord',
|
||||
percentage: 1
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -62,6 +62,11 @@ export const renderVideo = (
|
|||
`https://${Constants.GIF_TRANSCODE_DOMAIN}`
|
||||
);
|
||||
console.log('We passed checks for transcoding GIFs, feeding embed url', url);
|
||||
} else if (
|
||||
userAgent?.includes('Discord') &&
|
||||
experimentCheck(Experiment.DISCORD_VIDEO_REDIRECT_WORKAROUND, !!Constants.API_HOST_LIST)
|
||||
) {
|
||||
url = `https://${Constants.API_HOST_LIST[0]}/2/hit?url=${encodeURIComponent(url)}`;
|
||||
}
|
||||
|
||||
/* Push the raw video-related headers */
|
||||
|
|
Loading…
Add table
Reference in a new issue