Browse Source

Fix round video playback on iOS

Restrict reporting service messages
master
Eduard Kuzmenko 3 years ago
parent
commit
6b29cd426a
  1. 2
      src/components/chat/contextMenu.ts
  2. 9
      src/components/wrappers.ts
  3. 6
      src/scss/style.scss

2
src/components/chat/contextMenu.ts

@ -329,7 +329,7 @@ export default class ChatContextMenu {
onClick: () => { onClick: () => {
new PopupReportMessages(this.peerId, [this.mid]); new PopupReportMessages(this.peerId, [this.mid]);
}, },
verify: () => !this.message.pFlags.out && !this.message.pFlags.is_outgoing && this.appPeersManager.isChannel(this.peerId), verify: () => !this.message.pFlags.out && this.message._ === 'message' && !this.message.pFlags.is_outgoing && this.appPeersManager.isChannel(this.peerId),
notDirect: () => true, notDirect: () => true,
withSelection: true withSelection: true
}, { }, {

9
src/components/wrappers.ts

@ -251,6 +251,10 @@ export function wrapVideo({doc, container, message, boxWidth, boxHeight, withTai
video.currentTime = 0; video.currentTime = 0;
spanTime.innerText = ('' + globalVideo.duration).toHHMMSS(false); spanTime.innerText = ('' + globalVideo.duration).toHHMMSS(false);
if(globalVideo.currentTime) {
globalVideo.currentTime = 0;
}
}; };
globalVideo.addEventListener('play', onPlay); globalVideo.addEventListener('play', onPlay);
@ -266,9 +270,10 @@ export function wrapVideo({doc, container, message, boxWidth, boxHeight, withTai
preloader.onClick(); preloader.onClick();
} }
if(globalVideo.readyState < 2) { // ! can't use it here. on Safari iOS video won't start.
/* if(globalVideo.readyState < 2) {
return; return;
} } */
if(globalVideo.paused) { if(globalVideo.paused) {
globalVideo.play(); globalVideo.play();

6
src/scss/style.scss

@ -1152,7 +1152,11 @@ middle-ellipsis-element {
fill: rgba(0, 0, 0, .08); fill: rgba(0, 0, 0, .08);
} }
.media-photo, .media-video, .media-sticker, .media-round, .media-poster { .media-photo,
.media-video,
.media-sticker,
.media-round,
.media-poster {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;

Loading…
Cancel
Save