chewie icon indicating copy to clipboard operation
chewie copied to clipboard

open and close video on a full screen bugging in Flutter WEB

Open mathataides-dev opened this issue 4 years ago • 8 comments

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

mathataides-dev avatar Jun 24 '21 15:06 mathataides-dev

I have been noticing the same issue Have you been able to figure out any workaround or fix yet?

akshaycrt2k avatar Jul 06 '21 08:07 akshaycrt2k

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.

sondresorbye avatar Jul 06 '21 10:07 sondresorbye

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.

mathataides-dev avatar Jul 06 '21 12:07 mathataides-dev

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.

mathataides-dev avatar Jul 06 '21 12:07 mathataides-dev

As mentioned here, I have still found a workaround. HtmlElementView does not work neither.

sondresorbye avatar Jul 06 '21 12:07 sondresorbye

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); } }`

zambetpentru avatar Jul 12 '21 18:07 zambetpentru

Any update on this?

pratik-7span avatar Oct 01 '21 05:10 pratik-7span

any update?

Trung15010802 avatar Jul 18 '24 08:07 Trung15010802