Browse Source

Display thumb for video message in chat list

master
Eduard Kuzmenko 3 years ago
parent
commit
2b74ca9c5b
  1. 9
      src/lib/appManagers/appDialogsManager.ts
  2. 8
      src/scss/partials/_chatlist.scss

9
src/lib/appManagers/appDialogsManager.ts

@ -1490,13 +1490,18 @@ export class AppDialogsManager { @@ -1490,13 +1490,18 @@ export class AppDialogsManager {
let mediaContainer: HTMLElement;
if(!lastMessage.deleted && !draftMessage && !isRestricted) {
const media: MyDocument | MyPhoto = appMessagesManager.getMediaFromMessage(lastMessage);
if(media && (media._ === 'photo' || (['video', 'gif'] as MyDocument['type'][]).includes(media.type))) {
const videoTypes: Set<MyDocument['type']> = new Set(['video', 'gif', 'round']);
if(media && (media._ === 'photo' || videoTypes.has(media.type))) {
const size = appPhotosManager.choosePhotoSize(media, 20, 20);
if(size._ !== 'photoSizeEmpty') {
mediaContainer = document.createElement('div');
mediaContainer.classList.add('dialog-subtitle-media');
if((media as MyDocument).type === 'round') {
mediaContainer.classList.add('is-round');
}
wrapPhoto({
photo: media,
message: lastMessage,
@ -1506,7 +1511,7 @@ export class AppDialogsManager { @@ -1506,7 +1511,7 @@ export class AppDialogsManager {
loadPromises
});
if((media as MyDocument).type === 'video') {
if(videoTypes.has((media as MyDocument).type)) {
const playIcon = document.createElement('span');
playIcon.classList.add('tgico-play');

8
src/scss/partials/_chatlist.scss

@ -364,6 +364,14 @@ ul.chatlist { @@ -364,6 +364,14 @@ ul.chatlist {
display: inline-block;
vertical-align: middle;
&.is-round {
border-radius: 50%;
.tgico-play {
font-size: .875rem;
}
}
.tgico-play {
position: absolute;
z-index: 1;

Loading…
Cancel
Save