File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -378,6 +378,7 @@ public function generate(): string
378378 if (!$ isAudio && $ videoInfo ['platform ' ] !== 'default ' ) {
379379 $ code .= " data-video-platform= \"" . rex_escape ($ videoInfo ['platform ' ]) . "\" data-video-id= \"" . rex_escape ($ videoInfo ['id ' ]) . "\""
380380 . " aria-label= \"" . rex_escape ($ this ->getText ('a11y_video_from ' )) . " " . rex_escape ($ videoInfo ['platform ' ]) . "\"" ;
381+ // Never set src attribute for YouTube/Vimeo - this should be done by JavaScript after consent
381382 } else {
382383 $ code .= " src= \"" . rex_escape ($ sourceUrl ) . "\"" ;
383384 }
@@ -439,11 +440,24 @@ public static function parseOembedTags(string $content): string
439440 {
440441 return preg_replace_callback ('/<oembed url="(.+?)"><\/oembed>/is ' , static function ($ match ) {
441442 $ video = new self ($ match [1 ]);
442- $ video ->setAttributes ([
443- 'crossorigin ' => '' ,
444- 'playsinline ' => true ,
445- 'controls ' => true
446- ]);
443+ $ videoInfo = self ::getVideoInfo ($ match [1 ]);
444+
445+ // For YouTube/Vimeo videos, don't use native controls - let Vidstack handle the UI
446+ if ($ videoInfo ['platform ' ] === 'youtube ' || $ videoInfo ['platform ' ] === 'vimeo ' ) {
447+ $ video ->setAttributes ([
448+ 'crossorigin ' => '' ,
449+ 'playsinline ' => true ,
450+ 'controls ' => false // Important: disable native controls for embed videos
451+ ]);
452+ } else {
453+ // For regular video files, use native controls
454+ $ video ->setAttributes ([
455+ 'crossorigin ' => '' ,
456+ 'playsinline ' => true ,
457+ 'controls ' => true
458+ ]);
459+ }
460+
447461 return $ video ->generateFull ();
448462 }, $ content );
449463 }
Original file line number Diff line number Diff line change 11package : vidstack
2- version : ' 1.5.0 '
2+ version : ' 1.5.1 '
33author : ' Friends Of REDAXO'
44supportpage : https://github.com/FriendsOfREDAXO/vidstack
55requires :
You can’t perform that action at this time.
0 commit comments