Open joshua750 opened 1 year ago
Got any solution
have same problem it appears just in Android for me. In iOS its working fine.
Turns out this error appear in iframe package in youtube_player_flutter
Their is a pull request for this issue i think merging it will solve this issue.
Is it possible to get this PR merged and released? This error is prevalent in my Sentry logs.
can we please merge this?
@sarbagyastha any news on this?
when i tried close the controller in dispose i am getting this error Unhandled Exception: Bad state: Cannot add new events after calling close
import 'dart:developer';
import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:lhtv/Api/Api.dart'; import 'package:youtube_player_iframe/youtube_player_iframe.dart';
import '../Models/Slidermodel.dart';
class Livestream extends StatefulWidget {
@override State createState() => _LivestreamState();
}
class _LivestreamState extends State {
late YoutubePlayerController _controller;
@override void initState() { super.initState();
}
@override void dispose() { super.dispose(); _controller.close(); print('Close'); }
@override Widget build(BuildContext context) { return SafeArea( child: Scaffold( body: FutureBuilder<Model?>( future: Api().livestream(17), builder: (BuildContext context, AsyncSnapshot<Model?> snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { return Center(child: CircularProgressIndicator()); } else if (snapshot.hasError || snapshot.data == null) { return Text('Error fetching data'); } else { String videoId = snapshot.data!.nEWSAPP![0].videoId!;
} }