🎨 Continued to rearrange core folders content
This commit is contained in:
28
lib/drive/content/video.web.dart
Normal file
28
lib/drive/content/video.web.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'package:web/web.dart' as web;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class UniversalVideo extends StatelessWidget {
|
||||
final String uri;
|
||||
final double? aspectRatio;
|
||||
final bool autoplay;
|
||||
const UniversalVideo({
|
||||
super.key,
|
||||
required this.uri,
|
||||
this.aspectRatio,
|
||||
this.autoplay = false,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return HtmlElementView.fromTagName(
|
||||
tagName: 'video',
|
||||
onElementCreated: (element) {
|
||||
element as web.HTMLVideoElement;
|
||||
element.src = uri;
|
||||
element.style.width = '100%';
|
||||
element.style.height = '100%';
|
||||
element.controls = true;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user