Telegram Web K with changes to work inside I2P
https://web.telegram.i2p/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
437 B
13 lines
437 B
![]()
2 years ago
|
import { IS_APPLE_MOBILE } from "../environment/userAgent";
|
||
|
|
||
|
export default function onMediaLoad(media: HTMLMediaElement, readyState = media.HAVE_METADATA, useCanplayOnIos?: boolean) {
|
||
|
return new Promise<void>((resolve) => {
|
||
|
if(media.readyState >= readyState) {
|
||
|
resolve();
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
media.addEventListener(IS_APPLE_MOBILE && !useCanplayOnIos ? 'loadeddata' : 'canplay', () => resolve(), {once: true});
|
||
|
});
|
||
|
}
|