fluttercommunity / chewie

The video player for Flutter with a heart of gold
MIT License
1.94k stars 1.01k forks source link

no sound when playing videos using Chewie #827

Open Yigehaoren8848 opened 7 months ago

Yigehaoren8848 commented 7 months ago

There is no sound when I use chewie to play the video. This is an ipv6 online live broadcast address, and the video format is m3u8/mpeg. However, it can be played normally in browsers or other players. I don't know if it's because of the encoding or the audio track, because when I change the video address, it plays normally. My dart version: 3.1, chewie:1.7.2, video_player:2.8.5. I also tried changing to other versions, but it didn't work. please help me,thank you。

import 'package:flutter/material.dart';

import 'package:chewie/chewie.dart'; import 'package:video_player/video_player.dart';

class ChewieVideoPage extends StatefulWidget { ChewieVideoPage({required Key key}) : super(key: key); @override _ChewieVideoPageState createState() => _ChewieVideoPageState(); }

class _ChewieVideoPageState extends State {

late VideoPlayerController videoPlayerController; late ChewieController chewieController;

void initState(){ super.initState(); videoPlayerController=VideoPlayerController.networkUrl( Uri.parse("http://[2409:8087:7000:20::4]/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226463/index.m3u8") ); chewieController = ChewieController( videoPlayerController: videoPlayerController, aspectRatio: 3/2, autoPlay: true, ); }

@override void dispose() {

videoPlayerController.dispose();
chewieController.dispose();
super.dispose();

}

@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(

    ),

    body:Chewie(
      controller: chewieController,
    )

);

} }

class Home extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: ChewieVideoPage(key: UniqueKey(),), debugShowCheckedModeBanner: false, ); } }

void main(){ runApp(Home()); }

diegotori commented 7 months ago

@zsl-157 looks like this issue is completely related to video_player, since chewie is merely a UI wrapper around video_player.

Please raise an issue with the Flutter Team regarding this.

diegotori commented 7 months ago

It may be a device compatibility issue. I just tested it on other devices and everything was fine.

Still though, the issue lies with video_player, and not this library.