florent37 / Flutter-AssetsAudioPlayer

Play simultaneously music/audio from assets/network/file directly from Flutter, compatible with android / ios / web / macos, displays notifications
https://pub.dartlang.org/packages/assets_audio_player
Apache License 2.0
757 stars 368 forks source link

DASH Streaming support on android and ios and web #820

Open Anthrapper opened 9 months ago

Anthrapper commented 9 months ago

Flutter Version

My version : 3.16.9

Lib Version

My version : latest

Platform (Android / iOS / web) + version

Platform : Android + IOS + Web

Describe the bug

Getting playback error while playing DASH MPD streams in android (But it's playing audio) E/ExoPlayerImplInternal(29813): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) E/ExoPlayerImplInternal(29813): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) E/ExoPlayerImplInternal(29813): at java.lang.Thread.run(Thread.java:1012) I/ExoPlayerImpl(29813): Release 9da1171 [ExoPlayerLib/2.18.1] [violet, Redmi Note 7 Pro, Xiaomi, 34] [goog.exo.core, goog.exo.exoplayer, goog.exo.decoder, goog.exo.datasource, goog.exo.extractor]

Where as in IOS and WEB, it's neither showing any errors nor playing the stream. The package description says it supports dash streaming in all platforms though.

Small code to reproduce

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State {
  final audio = Audio.liveStream(
    'https://livesim.dashif.org/livesim/testpic_2s/Manifest.mpd',
  );

  final AssetsAudioPlayer _assetsAudioPlayer = AssetsAudioPlayer();

  @override
  void initState() {
    _assetsAudioPlayer.open(audio);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(),
      ),
    );
  }
}