Skip to content

video_player plugin can render a green bar for certain videos on certain Android devices #34642

@dannyvalentesonos

Description

@dannyvalentesonos

Certain videos can be rendered with a green bar on the right or bottom edge on certain Android devices. This never happens on iOS devices. I can repro this 100% on a Nexus 9.

The following code leads to the problem:

import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

class VideoBarsHomePage extends StatefulWidget {
  @override
  _VideoBarsHomePageState createState() => _VideoBarsHomePageState();
}

class _VideoBarsHomePageState extends State<VideoBarsHomePage> {
  
  VideoPlayerController _videoPlayerController;

  @override
  void initState() {
    super.initState();

    _videoPlayerController = VideoPlayerController.asset("videos/beam_white.mp4");
    _videoPlayerController.setLooping(true);
    _videoPlayerController.play();
    _videoPlayerController.initialize();
  }

  @override
  void dispose() {
    _videoPlayerController.dispose();

    super.dispose();
  }

  @override
  Widget build(BuildContext context) {

    return Material(
        type: MaterialType.transparency,
        elevation: 0,
        child: Align(
            // align the card to the bottom
            alignment: Alignment.bottomCenter,
            child: Container(
              decoration: BoxDecoration(
                color: Colors.grey,
                borderRadius: BorderRadius.circular(16.0),
              ),
              height: 528.0,
              width: 416.0,
              child: Column(
                mainAxisAlignment: MainAxisAlignment.start,
                crossAxisAlignment: CrossAxisAlignment.stretch,
                children: <Widget>[
                  Expanded(
                      //child: VideoPlayer(_videoPlayerController)
                      /*child: Center(
                        child: AspectRatio(
                          aspectRatio: 1080.0 / 400.0,
                          child: Container(
                              width: 1080,
                              height: 400,
                              child: VideoPlayer(_videoPlayerController)
                          )
                        ),
                      )*/
                      child: FittedBox(
                        fit: BoxFit.contain,
                        child: Container(
                            width: 1080,
                            height: 400,
                            child: VideoPlayer(_videoPlayerController)
                        )
                      )
                  ),
                ],
              ),
            )
        )
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listengineflutter/engine related. See also e: labels.found in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1p: video_playerThe Video Player pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions