Fix jumping by playing round video

This commit is contained in:
morethanwords 2021-10-26 02:15:43 +03:00
parent 0518d57cc5
commit bbcb81749d
2 changed files with 4 additions and 2 deletions

View File

@ -1574,7 +1574,8 @@ export default class ChatBubbles {
// return rect.height;
let height = windowSize.windowH;
height -= this.chat.topbar.container.getBoundingClientRect().height;
// height -= this.chat.topbar.container.getBoundingClientRect().height;
height -= this.bubblesContainer.offsetTop;
height -= mediaSizes.isMobile || windowSize.windowH < 570 ? 58 : 78;
return height;

View File

@ -164,6 +164,8 @@ export function wrapVideo({doc, container, message, boxWidth, boxHeight, withTai
video.remove();
} */
let preloader: ProgressivePreloader; // it must be here, otherwise will get error before initialization in round onPlay
const video = document.createElement('video');
video.classList.add('media-video');
video.setAttribute('playsinline', 'true');
@ -384,7 +386,6 @@ export function wrapVideo({doc, container, message, boxWidth, boxHeight, withTai
const cacheContext = appDownloadManager.getCacheContext(doc);
const isUpload = !!(message?.media as any)?.preloader;
let preloader: ProgressivePreloader;
if(isUpload) { // means upload
preloader = (message.media as any).preloader as ProgressivePreloader;
preloader.attach(container, false);