I have rewritten the ionic-audio plugin for ionic/angular 2. I’d love to hear from the community as I am in the process of finalizing the API and could use some feedback here or any suggestions you may have.
Here are some of the features:
Platform independent: it works in the browser and on Android/iOS. If cordova-plugin-media is added to the project, the plugin will use it as the underlying audio provider, otherwise it defaults to HTML5 audio.
API: a set of components and providers to control audio playback from the component’s view and controller.
About the demo: I haven’t been able to set up a proper codepen. I’ve found it really challenging to have a typescript project work within a codepen, plunker or similar. So I had to resort to publishing the compiled version of the project.
Ah okay, i think i found the problem. I missed the following line of code (which isn’t bold ) in your documentation:
import {Type, provide} from '@angular/core';
When i add it, your ionicBootstrap() arguments work. But now i’m wondering, why it works as well without this line of code when i change the ionicBootstrap() arguments?
@arielf i just noticed that the „Add components to views“ section in your documentation (http://arielfaur.github.io/ionic-audio/2.0/index.html) is somehow wrong. When i take this code, the attributes like audio.title and audio.artist will not be shown and the progress-bar is not working. But the code in your demo is working fine!
Can I try the forum’s patience with some more novice questions? My Ionic framework is 2.0.0-rc1 on windows. The demo of this plugin works perfectly. Does that answer the questions above - about windows and rc0?
However having got it the demo to run, I am completely baffled as to how I should install it in a new project built from “ionic start” in the CLI. The file/folder structures are completely different, no app.module.ts etc. Is this the question arielf hopes to go over on his return from holidays? (and I’m in no hurry - enjoy your hols :-)). If anyone else can help me I’d be very grateful.
Finally, what I hope to achieve is playing an mp3 stored with my project. The player will stop when a second mp3 is loaded to play. In the demo multiple audio streams play and I can’t work out how to stop the first one once the second one is started. I can’t find any other threads on audio in Ionic 2 and would appreciate any hints.
Can you, @arielf, give us an outlook when you think you can have a look about it? I would like to use your plugin in an Ionic 2 RC.1 project. Otherwise i’ll have to search about a different solution…