0

I am using this flutter plugin - youtube_player_flutter v7.0.0+7.

The player works fine on portrait mode but on clicking the full-screen icon it crashes. Please see the below code:

return YoutubePlayerBuilder(
      onExitFullScreen: () {
        
        SystemChrome.setPreferredOrientations(DeviceOrientation.values);
      },
      player: YoutubePlayer(
        controller: _controller,
        showVideoProgressIndicator: true,
        progressIndicatorColor: Colors.blueAccent,
        onReady: () {
          _isPlayerReady = true;
        },
        onEnded: (data) {
//          _controller
//              .load(_ids[(_ids.indexOf(data.videoId) + 1) % _ids.length]);
          _showSnackBar('Next Video Started!');
        },
      ),
      builder: (context, player) => Scaffold(
        key: _scaffoldKey,
        appBar: AppBar(
          title: Text(
            widget.content.title,
            style: TextStyle(color: Colors.white),
          ),
        ),
        body: ListView(
          children: [
            player,
            Padding(
              padding: const EdgeInsets.all(8.0),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.stretch,
                children: [],
              ),
            ),
          ],
        ),
      ),
    );
  }
nvoigt
  • 75,013
  • 26
  • 93
  • 142
nick_k
  • 107
  • 1
  • 8

0 Answers0