We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
late THEOplayer theOplayer;
theOplayer = THEOplayer( fullscreenBuilder: (BuildContext context, THEOplayer player) { // default, chromeless behaviour, same as not specifying a fullscreenBuilder. return theOplayer.isInitialized==false?const Center(child: CircularProgressIndicator(color: Colors.white,strokeAlign: 2,strokeWidth: 2)):PlayerScreen( isInPicture: isInPicture, forwardController: _forwardController, backwardController: _backwardController, animationController: animationController, theOplayer: theOplayer, /embedInfo: embedInfo!/ id: widget.id, image: widget.imgPath, title: widget.title); }, theoPlayerConfig: THEOplayerConfig( license: "", fullscreenConfiguration: FullscreenConfig(fullscreenSystemUiMode: SystemUiMode.immersiveSticky, preferredFullscreenOrientations: [ DeviceOrientation.landscapeRight, DeviceOrientation.landscapeLeft, ], preferredRestoredOrientations: [ DeviceOrientation.portraitUp ]), androidConfiguration: AndroidConfig.create( viewComposition: AndroidViewComposition.TEXTURE_LAYER, ),
// Extra THEOlive configuration: //theolive: TheoLiveConfiguration(externalSessionId: "mySessionID"), ), onCreate: () { print("main - THEOplayer - onCreate"); theOplayer.source = SourceDescription(sources: [ TypedSource(src: "https://cdn.theoplayer.com/video/big_buck_bunny/big_buck_bunny.m3u8"), ]); theOplayer.autoplay = true; theOplayer.allowBackgroundPlayback = false; animationController.forward(); theOplayer.videoTracks.map((e) { print("Video ${e.activeQuality}"); }).toList(); theOplayer.audioTracks.map((e) { print("Audio ${e.activeQuality}"); }).toList(); theOplayer.allowAutomaticPictureInPicture = false; isInPicture = false; if (kIsWeb) { theOplayer.setPresentationMode(PresentationMode.PIP); } theOplayer.addEventListener(PlayerEventTypes.ERROR, (errorEvent) { var error = errorEvent as ErrorEvent; ScaffoldMessenger.of(context).showSnackBar( SnackBar( duration: const Duration(milliseconds: 6000), backgroundColor: Colors.red, content: Text(error.error), action: SnackBarAction( label: 'OK', onPressed: () { // Code to execute. }, ), ), ); }); theOplayer.addEventListener(PlayerEventTypes.WAITING, (event) { isLoading = false; setState(() {}); print("Player is buffering ${event.type}"); }); theOplayer.addEventListener(PlayerEventTypes.PLAYING, (event) { isLoading = true; setState(() {}); print("Player is Paying ${event.type}"); }); });
can't initialize
The text was updated successfully, but these errors were encountered:
Hi @this-sunil ,
Do you have a stack trace of the problem?
Usually, this issue happens if you try to access the player before the player's onCreate()callback is called.
onCreate()
Sorry, something went wrong.
No branches or pull requests
late THEOplayer theOplayer;
theOplayer = THEOplayer(
fullscreenBuilder: (BuildContext context, THEOplayer player) {
// default, chromeless behaviour, same as not specifying a fullscreenBuilder.
return theOplayer.isInitialized==false?const Center(child: CircularProgressIndicator(color: Colors.white,strokeAlign: 2,strokeWidth: 2)):PlayerScreen(
isInPicture: isInPicture,
forwardController: _forwardController,
backwardController: _backwardController,
animationController: animationController,
theOplayer: theOplayer,
/embedInfo: embedInfo!/ id: widget.id,
image: widget.imgPath,
title: widget.title);
},
theoPlayerConfig: THEOplayerConfig(
license: "",
fullscreenConfiguration:
FullscreenConfig(fullscreenSystemUiMode: SystemUiMode.immersiveSticky, preferredFullscreenOrientations: [
DeviceOrientation.landscapeRight,
DeviceOrientation.landscapeLeft,
], preferredRestoredOrientations: [
DeviceOrientation.portraitUp
]),
androidConfiguration: AndroidConfig.create(
viewComposition: AndroidViewComposition.TEXTURE_LAYER,
),
can't initialize
The text was updated successfully, but these errors were encountered: