Image links show a video Thumbnail, similar to what happens in Markdeep.
This commit is contained in:
parent
c6a51d3896
commit
efbe655c78
@ -16,5 +16,5 @@ BaselineOfVideoWeb >> baseline: spec [
|
|||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
BaselineOfVideoWeb >> semanticVersion [
|
BaselineOfVideoWeb >> semanticVersion [
|
||||||
^ '0.3.0'
|
^ '0.4.0'
|
||||||
]
|
]
|
||||||
|
23
app/VideoWeb/BrAsyncFileWidget.extension.st
Normal file
23
app/VideoWeb/BrAsyncFileWidget.extension.st
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Extension { #name : #BrAsyncFileWidget }
|
||||||
|
|
||||||
|
{ #category : #'*VideoWeb' }
|
||||||
|
BrAsyncFileWidget >> url: aUrl [
|
||||||
|
|
||||||
|
| realUrl imageUrl |
|
||||||
|
realUrl := aUrl asZnUrl.
|
||||||
|
|
||||||
|
realUrl scheme = #file ifTrue: [
|
||||||
|
^ self file: realUrl asFileReference ].
|
||||||
|
imageUrl := realUrl.
|
||||||
|
realUrl host = 'www.youtube.com' ifTrue: [ | video |
|
||||||
|
video := Invidious defaultInstance video: (realUrl queryAt: 'v').
|
||||||
|
imageUrl := video defaultThumbnailLink asUrl.
|
||||||
|
].
|
||||||
|
|
||||||
|
self stencil: [
|
||||||
|
(SkiaImage fromForm:
|
||||||
|
(Form fromBase64String: imageUrl retrieveContents base64Encoded))
|
||||||
|
asElement constraintsDo: [ :c |
|
||||||
|
c horizontal matchParent.
|
||||||
|
c vertical matchParent ] ]
|
||||||
|
]
|
@ -10,7 +10,8 @@ Class {
|
|||||||
'description',
|
'description',
|
||||||
'subscribersCount',
|
'subscribersCount',
|
||||||
'totalViews',
|
'totalViews',
|
||||||
'isFamilyFriendly'
|
'isFamilyFriendly',
|
||||||
|
'latestVideos'
|
||||||
],
|
],
|
||||||
#category : #VideoWeb
|
#category : #VideoWeb
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user