chewie
chewie copied to clipboard
open and close video on a full screen bugging in Flutter WEB
Hello. I test this lib with video_player lib for flutter web, but when i open (or close) a video in fullscreen, an bug occurred. Follow the video.
https://user-images.githubusercontent.com/55509616/123291798-d40c2900-d4e8-11eb-8ca1-c32015e8fa8f.mov
I have been noticing the same issue Have you been able to figure out any workaround or fix yet?
I am experiencing the same issue with both chewie and using the video_player plugin directly. It is probably a problem with the video_player plugin. I am trying to use a HtmlElementView to display the video on web instead.
I have been noticing the same issue Have you been able to figure out any workaround or fix yet?
I still haven't got a good solution. At the time, i only block the user for not opened fullscreen.
I am experiencing the same issue with both chewie and using the video_player plugin directly. It is probably a problem with the video_player plugin. I am trying to use a HtmlElementView to display the video on web instead.
I saw the workaround, but for the project that I work, does not solve the problem.
As mentioned here, I have still found a workaround. HtmlElementView does not work neither.
In case it digs someone out of a hole while the main issue is being resolved, this is working well for me.
`import 'dart:html'; import 'dart:ui' as ui; import 'package:flutter/material.dart';
///Working well in Windows, Linux, MacOS, iOS and Android Mobile Web / PWA class WebVideoElement extends StatefulWidget { const WebVideoElement(this.src);
final String src; final double startAt = 0; final bool autoplay = false; final bool controls = true;
@override _WebVideoElementState createState() => _WebVideoElementState(); }
class _WebVideoElementState extends State<WebVideoElement> { @override void initState() { super.initState();
String? URL = 'http://www.website.com/pathtovideo' + '#t=${widget.startAt}';
// Do not remove the below comment - Fix for missing ui.platformViewRegistry in dart.ui
// ignore: undefined_prefixed_name
ui.platformViewRegistry.registerViewFactory(widget.src, (int viewId) {
//https: //api.flutter.dev/flutter/dart-html/VideoElement-class.html
final video = VideoElement()
..src = URL
..autoplay = widget.autoplay
..controls = widget.controls
..style.border = 'none'
..style.borderColor = 'red'
..style.height = '100%'
..style.width = '100%';
// Allows Safari iOS to play the video inline
video.setAttribute('playsinline', 'true');
return video;
});
}
@override Widget build(BuildContext context) { return HtmlElementView(viewType: widget.src); } }`
Any update on this?
any update?