New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Grey Screen issue when you deploy web app #909
Comments
https://sarbagyastha.github.io/youtube_player_flutter/#/ Seems to be working, can you provide console logs ? |
I'm getting the same issue. Any solution? |
@superman-danny did you find any solution ? I am also facing the same. |
Same here, grey screen is the flutter production way to replace the big red error screen on debug btw. Not that useful tho. If someone could help us, it'd be amazing :) |
@Z3ZEL deploying to production with a workflow is solving the issue. |
Same here. Suspecting CORS to be a problem. |
Hello there ! |
Well fixed it myself, looks like it's link to the renderer used to build the web. I was using the default CanvasKit and I build and deploy using the html and deployed and it works. |
@romain-girou html renderer isn't recomended. Low performance. I just needed embeded iframe youtube video. So i made my own widget that is doing just that. |
@ReinisSprogis it would be helpful if you could share your code of the widget, thanks. |
import 'package:flutter/material.dart';
import 'package:web/web.dart' as web;
import 'dart:ui_web' as ui;
import 'package:youtube_parser/youtube_parser.dart';
class YoutubeVideoIFrame extends StatefulWidget {
const YoutubeVideoIFrame({super.key, required this.videoURL});
final String videoURL;
@override
State<YoutubeVideoIFrame> createState() => _YoutubeVideoIFrameState();
}
class _YoutubeVideoIFrameState extends State<YoutubeVideoIFrame> {
@override
void initState() {
super.initState();
String? id = getIdFromUrl(widget.videoURL);
if (id != null) {
ui.platformViewRegistry.registerViewFactory(
'youtube_player_${widget.videoURL}',
(int viewId) => web.HTMLIFrameElement()
..style.width = '100%'
..style.height = '100%'
..allowFullscreen = true
..src = 'https://www.youtube.com/embed/${id}'
..style.border = 'none');
}
}
@override
Widget build(BuildContext context) {
return HtmlElementView(viewType: 'youtube_player_${widget.videoURL}');
}
} |
@superman-danny @droidbg |
It shows and works perfectly in development server but when it goes live or in release mode. I get a grey screen
LIVE
PRODUCTION
The text was updated successfully, but these errors were encountered: