Browse Source

Fix jumping by playing round video

master
morethanwords 3 years ago
parent
commit
bbcb81749d
  1. 3
      src/components/chat/bubbles.ts
  2. 3
      src/components/wrappers.ts

3
src/components/chat/bubbles.ts

@ -1574,7 +1574,8 @@ export default class ChatBubbles { @@ -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;

3
src/components/wrappers.ts

@ -164,6 +164,8 @@ export function wrapVideo({doc, container, message, boxWidth, boxHeight, withTai @@ -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 @@ -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);

Loading…
Cancel
Save