This repository was archived by the owner on May 2, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141 </ div >
4242 </ div >
4343
44- < script >
44+ < script type ="module ">
45+ import { VidstackPlayer , VidstackPlayerLayout } from '/client/vidstack.js' ;
46+
4547 function generateImg ( src , displayFull ) {
4648 return '<img id="message-img" ' + ( displayFull ? 'class="aspect-auto w-full h-full max-w-[100vw] max-h-[100vh]"' : '' ) + ' src="' + src + '" />' ;
4749 }
4850
4951 function generateAudioVideo ( src , displayFull , mediaIsShort ) {
50- return '<media-player id="message-player" ' + ( displayFull ? "class='h-[100vh] " + ( mediaIsShort ? "is-short mx-auto" : "aspect-contain w-[100vw] " ) + "'" : "class='aspect-contain " + ( mediaIsShort ? "is-short" : "" ) + "'" ) + ' src="' + src + '" autoPlay load="eager" logLevel="debug">' +
51- '<media-provider></media-provider>' +
52- '<media-audio-layout></media-audio-layout>' +
53- '<media-video-layout></media-video-layout>' +
54- '</media-player>' ;
52+ setTimeout ( ( ) => {
53+
54+ const player = VidstackPlayer . create ( {
55+ target : '#message-player' ,
56+ src : src ,
57+ layout : new VidstackPlayerLayout ( {
58+ } ) ,
59+ } ) ;
60+ } , 100 ) ;
61+
62+ return '<div id="message-player" data-autoplay data-load="eager" ' + ( displayFull ? "class='h-[100vh] " + ( mediaIsShort ? "is-short mx-auto" : "aspect-contain w-[100vw] " ) + "'" : "class='aspect-contain " + ( mediaIsShort ? "is-short" : "" ) + "'" ) + ' >' +
63+ '</div>' ;
5564 }
5665
5766 function displayAuthor ( authorUsername , authorPictureURL ) {
You can’t perform that action at this time.
0 commit comments