|
|
@ -186,11 +186,11 @@ export function wrapVideo({doc, container, message, boxWidth, boxHeight, withTai |
|
|
|
let preloader: ProgressivePreloader; |
|
|
|
let preloader: ProgressivePreloader; |
|
|
|
if(message?.media?.preloader) { // means upload
|
|
|
|
if(message?.media?.preloader) { // means upload
|
|
|
|
preloader = message.media.preloader as ProgressivePreloader; |
|
|
|
preloader = message.media.preloader as ProgressivePreloader; |
|
|
|
preloader.attach(container, undefined, undefined, true); |
|
|
|
preloader.attach(container, undefined, undefined); |
|
|
|
} else if(!doc.downloaded && !doc.supportsStreaming) { |
|
|
|
} else if(!doc.downloaded && !doc.supportsStreaming) { |
|
|
|
const promise = appDocsManager.downloadDocNew(doc); |
|
|
|
const promise = appDocsManager.downloadDocNew(doc); |
|
|
|
preloader = new ProgressivePreloader(container, true); |
|
|
|
preloader = new ProgressivePreloader(null, true, false, 'prepend'); |
|
|
|
preloader.attach(container, true, promise, true); |
|
|
|
preloader.attach(container, true, promise); |
|
|
|
|
|
|
|
|
|
|
|
/* video.addEventListener('canplay', () => { |
|
|
|
/* video.addEventListener('canplay', () => { |
|
|
|
if(preloader) { |
|
|
|
if(preloader) { |
|
|
@ -200,7 +200,8 @@ export function wrapVideo({doc, container, message, boxWidth, boxHeight, withTai |
|
|
|
|
|
|
|
|
|
|
|
await promise; |
|
|
|
await promise; |
|
|
|
} else if(doc.supportsStreaming) { |
|
|
|
} else if(doc.supportsStreaming) { |
|
|
|
preloader = new ProgressivePreloader(container, false); |
|
|
|
preloader = new ProgressivePreloader(null, false, false, 'prepend'); |
|
|
|
|
|
|
|
preloader.attach(container, false, null); |
|
|
|
video.addEventListener('canplay', () => { |
|
|
|
video.addEventListener('canplay', () => { |
|
|
|
preloader.detach(); |
|
|
|
preloader.detach(); |
|
|
|
}, {once: true}); |
|
|
|
}, {once: true}); |
|
|
@ -478,7 +479,7 @@ export function wrapPhoto(photo: MyPhoto | MyDocument, message: any, container: |
|
|
|
if(message?.media?.preloader) { // means upload
|
|
|
|
if(message?.media?.preloader) { // means upload
|
|
|
|
message.media.preloader.attach(container); |
|
|
|
message.media.preloader.attach(container); |
|
|
|
} else if(!cacheContext.downloaded) { |
|
|
|
} else if(!cacheContext.downloaded) { |
|
|
|
preloader = new ProgressivePreloader(container, false); |
|
|
|
preloader = new ProgressivePreloader(container, false, false, photo._ == 'document' ? 'prepend' : 'append'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const load = () => { |
|
|
|
const load = () => { |
|
|
|