-
Notifications
You must be signed in to change notification settings - Fork 765
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
Cannot preload sound files #294
Comments
It would really help us, if you can identify the version which "broke"(?) the feature you are describing. Was the behavior changed in the v2.0.0 release or later on? |
It "broke" in the v3.0.0 release. Thank you! |
I am so sorry, I just realized there are a bunch of minor versions between v2 and v3. |
These are the changes between v2.1.0 and v2.2.0 |
Had the same issue on ios, didn't test it on andorid. Downgrading from 5.0 to 2.0 solved the issue. |
Version 4.0 is also working |
I don't know if it's linked to #293 (comment) , but I also fixed my issue on iOS by reverting from 5.0.3 to 4.0. |
I believe this is due to 00ddb93. For remote streams, the plugin does not keep track of the created AVPlayer instance and keeps overwriting a single CDVSound
I think you can also run into inconsistencies with one remote and one local sound, although I haven't actually tested it: create a remote sound, then create a local sound, then play the local sound. Because the logic only checks for the presence of Unfortunately, it seems the iOS implementation of the plugin is badly unmaintained. Whatever the reasons were to use different code path (AVPlayer vs. AVAudioPlayer) for local and remote streams, I don't think these are still relevant nowadays. |
The plugin was originally written only with avaudioplayer. This framework does not support streaming audio, it will download an entire file and then play it. So the avplayer implementation was added so that streaming sources would use avplayer so that media streaming worked properly. I have a fork of the plugin that I have been working on slowly removing the avaudioplayer code completely so that everything just uses avplayer as it supports both file and streaming sources. There is a lot of cruft in this plugin though so it is slow going cleaning it up. |
With media plugin version 1.0.1, you can preload sound files, and play them without any problem.
With the latest media plugin, if you preload multiple sound files, only the last one will be played.
For example:
var a = new Media(file1);
var b = new Media(file2);
a.play(); // works in v.1.0.1 but not the latest version
I'd been using 1.0.1 to bypass the issue but it seems no longer possible with new ios build requirements.
Preloading is quite important for me. Could someone please help? Thank you!
The text was updated successfully, but these errors were encountered: