From 0f0fa22218a9a26217a99f7ae799419c17783da3 Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Fri, 14 Aug 2020 03:26:24 +1000 Subject: [PATCH] Add setFilePath/setAsset to README. --- README.md | 2 ++ lib/just_audio.dart | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 898977f..fec3a90 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ Initialisation: ```dart final player = AudioPlayer(); var duration = await player.setUrl('https://foo.com/bar.mp3'); +var duration = await player.setFilePath('/path/to/file.mp3'); +var duration = await player.setAsset('path/to/asset.mp3'); ``` Standard controls: diff --git a/lib/just_audio.dart b/lib/just_audio.dart index 497709c..1331fe9 100644 --- a/lib/just_audio.dart +++ b/lib/just_audio.dart @@ -1123,7 +1123,7 @@ abstract class UriAudioSource extends IndexedAudioSource { }; } -/// An [AudioSource] representing a regular media file such asn an MP3 or M4A +/// An [AudioSource] representing a regular media file such as an MP3 or M4A /// file. The following URI schemes are supported: /// /// * file: loads from a local file (provided you give your app permission to @@ -1138,7 +1138,13 @@ class ProgressiveAudioSource extends UriAudioSource { : super(uri, headers: headers, tag: tag, type: 'progressive'); } -/// An [AudioSource] representing a DASH stream. +/// An [AudioSource] representing a DASH stream. The following URI schemes are +/// supported: +/// +/// * file: loads from a local file (provided you give your app permission to +/// access that file). +/// * asset: loads from a Flutter asset (not supported on Web). +/// * http(s): loads from an HTTP(S) resource. /// /// On platforms except for the web, the supplied [headers] will be passed with /// the HTTP(S) request. Currently headers are not recursively applied to items @@ -1148,7 +1154,13 @@ class DashAudioSource extends UriAudioSource { : super(uri, headers: headers, tag: tag, type: 'dash'); } -/// An [AudioSource] representing an HLS stream. +/// An [AudioSource] representing an HLS stream. The following URI schemes are +/// supported: +/// +/// * file: loads from a local file (provided you give your app permission to +/// access that file). +/// * asset: loads from a Flutter asset (not supported on Web). +/// * http(s): loads from an HTTP(S) resource. /// /// On platforms except for the web, the supplied [headers] will be passed with /// the HTTP(S) request. Currently headers are not applied recursively.