Skip to content

Commit

Permalink
Send videos. If video is not loaded in time, show thumbnail instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Elia Doumerc committed Jun 26, 2024
1 parent ef6f604 commit 9739c9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ utility
newWith: aCore

|obj|
"self halt."
obj := super newWith: aCore.
" obj add: (Association key: -1 value: (Promise new initializeWithResolvedValue: ((GitAssetLoader for: 'TelegramClient')
'/assets/default_video_thumbnail.png')).
" ^ obj

((FileDirectory default / 'tdlib' / 'thumbnails') fileExists: 'default_video_thumbnail.png') ifFalse: [
((GitAssetLoader for: 'TelegramClient') loadForm: '/assets/default_video_thumbnail.png') writePNGfileNamed: ((FileDirectory default / 'tdlib' / 'thumbnails' / 'default_video_thumbnail.png') fullName).
].

obj add: (Association key: -1 value: (Promise new initializeWithResolvedValue: ((FileDirectory default / 'tdlib' / 'thumbnails' / 'default_video_thumbnail.png') fullName))).

^ obj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
"extractPathFrom:" : "pk 6/19/2021 16:23",
"imageFormFrom:" : "pk 8/5/2021 16:52",
"newWith:" : "ED 6/26/2024 12:24" },
"newWith:" : "ED 6/26/2024 14:50" },
"instance" : {
"getFormFor:" : "JK 6/12/2024 19:28",
"getFormPromiseFor:" : "JK 6/12/2024 19:30",
Expand Down

0 comments on commit 9739c9d

Please sign in to comment.