Skip to content
New issue

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

在androidTV上播放的时候画面极其慢 #628

Closed
langziyang opened this issue Apr 22, 2024 · 1 comment
Closed

在androidTV上播放的时候画面极其慢 #628

langziyang opened this issue Apr 22, 2024 · 1 comment

Comments

@langziyang
Copy link

我是一个新手,使用flutter写了一个在电视上播放的APP,有直播有和点播,最开始用的video_player,,点播没问题,直播不行,所以换成了Fijkplayer,在开发过程中播放都很流畅,但是编译后到电视上播放发现画面走得很慢很慢,当前,也有可能是因为我不懂所以才这样。下面是我的代码:

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

class TvPage extends StatefulWidget {
  const TvPage({super.key});

  @override
  State<TvPage> createState() => _TvPageState();
}

class _TvPageState extends State<TvPage> {
  FijkPlayer player = FijkPlayer();

  @override
  void initState() {
    super.initState();
    player.setDataSource(
        'http://[2409:8087:1a01:df::7005]:80/ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221225738/index.m3u8',
        autoPlay: true);
  }

  @override
  void dispose() {
    super.dispose();
    player.release();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: FijkView(
          player: player,
        ),
      ),
    );
  }
}

@Yigehaoren8848
Copy link

首先确保你的AndroidManifest.xml文件中设置了android:hardwareAccelerated="true",这是为了硬件加速,其次检查你使用的是不是release版本,如果不是的话会在视频播放的时候会打印大量日志消耗资源,当然最好关闭日志,关闭日志的方法在https://github.com/befovy/fijkplayer/issues/619。如果还是卡顿那可能是你电视配置的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants