Giter Club home page Giter Club logo

Comments (3)

xiaowei-guan avatar xiaowei-guan commented on September 22, 2024

@elethiame
Can you describe in detail the steps to reproduce?

from plugins.

elethiame avatar elethiame commented on September 22, 2024
  const RunningPage({Key? key}) : super(key: key);

  @override
  _RunningPageState createState() => _RunningPageState();
}

class _RunningPageState extends State<RunningPage> {
  late VideoPlayerController _controller;
  late final AppLifecycleListener _appLifecycleListener;
  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.asset('assets/videos/config_video.mp4')
      ..initialize().then((_) {
        _controller.setLooping(true);
        _controller.play();
      });

    _appLifecycleListener = AppLifecycleListener(
      onStateChange: (state) async {
        if (state == AppLifecycleState.resumed) {
          UILogger.info('app resumed, play video');
          _controller.play();
        } else if (state == AppLifecycleState.paused) {
          UILogger.info('app paused, pause video');
          _controller.pause();
        }
      },
    );
  }

  @override
  void dispose() {
    _controller.dispose();
    _appLifecycleListener.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.black,
      body: Stack(
        fit: StackFit.expand,
        alignment: Alignment.center,
        children: [
          AspectRatio(
            aspectRatio: _controller.value.aspectRatio,
            child: VideoPlayer(_controller),
          ),
          Focus(
            autofocus: true,
            onKey: (node, event) {
              if (event is RawKeyDownEvent) {}
              if (event.isConfirmKeyPressed() || event.isEscapeKeyPressed()) {
                _stop(context);
                return KeyEventResult.handled;
              }
              return KeyEventResult.ignored;
            },
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              mainAxisSize: MainAxisSize.min,
              children: [
                Text(
                  context.localizations.runningPageSubtitle,
                  style: TextStyle(
                    fontSize: 24.px,
                    fontWeight: FontWeight.w500,
                    color: Color(0x99FFFFFF),
                  ),
                ),
                SizedBox(
                  height: 20.px,
                ),
                _buildRichText(),
              ],
            ),
          ),
          _buildCapturePosition(),
        ],
      ),
    );
  }
}

When this page is loaded, an error is thrown, but everything else seems alright:

[E] [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(Pause, Player pause failed, null, null)
#0 VideoPlayerAvplayApi.pause (package:video_player_avplay/src/messages.g.dart:803:7)

https://github.com/flutter-tizen/plugins/pull/1 VideoPlayerController._applyPlayPause (package:video_player_avplay/video_player.dart:615:7)

https://github.com/flutter-tizen/plugins/pull/2 VideoPlayerController.pause (package:video_player_avplay/video_player.dart:543:5)

Then, I return to the TV home screen and open Bilibili to play a video. After that, when I go back to my app, the video widget appears black.

I am using this package on Samsung TV Q60C/Q70C for China.

from plugins.

xuelian-bai avatar xuelian-bai commented on September 22, 2024

Hi, in China current TV products are different from global TV, both android app and tizen app can run on Chinese products, if you develop tizen app, you need to send request to us for app entry(your app will be shown in "ζˆ‘ηš„εΊ”η”¨") when release.

from plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.