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.
12 lines
437 B
12 lines
437 B
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}); |
|
}); |
|
}
|
|
|