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. 11
      src/components/wrappers.ts
  3. 6
      src/scss/style.scss

2
src/components/chat/contextMenu.ts

@ -329,7 +329,7 @@ export default class ChatContextMenu { @@ -329,7 +329,7 @@ export default class ChatContextMenu {
onClick: () => {
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,
withSelection: true
}, {

11
src/components/wrappers.ts

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

6
src/scss/style.scss

@ -1152,7 +1152,11 @@ middle-ellipsis-element { @@ -1152,7 +1152,11 @@ middle-ellipsis-element {
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;
top: 0;
right: 0;

Loading…
Cancel
Save