Fix video view factory: format code for better readability
This commit is contained in:
@@ -111,7 +111,9 @@ class _PublicFileViewerState extends State<PublicFileViewer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _registerVideoViewFactory(String videoUrl) {
|
void _registerVideoViewFactory(String videoUrl) {
|
||||||
ui_web.platformViewRegistry.registerViewFactory(_videoViewType!, (int viewId) {
|
ui_web.platformViewRegistry.registerViewFactory(_videoViewType!, (
|
||||||
|
int viewId,
|
||||||
|
) {
|
||||||
final videoElement = web.HTMLVideoElement()
|
final videoElement = web.HTMLVideoElement()
|
||||||
..src = videoUrl
|
..src = videoUrl
|
||||||
..controls = true
|
..controls = true
|
||||||
@@ -124,7 +126,8 @@ class _PublicFileViewerState extends State<PublicFileViewer> {
|
|||||||
videoElement.onError.listen((event) {
|
videoElement.onError.listen((event) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_error = 'Video format not supported or could not be loaded. Please download the file.';
|
_error =
|
||||||
|
'Video format not supported or could not be loaded. Please download the file.';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user