Comments (6)
Hi
Thanks for getting back to me. First let me say that I'm aware it's "just" a code snippet and that it needs to be adapted to the desired environment. I didn't mean to mark this as an issue, just didn't know where else to comment :)
I have 4 tabs. the audio player is in a stack of tab 4. When I select that tab, then select tab 3 and than tries to select tab 4 again nothing happens. the application stays in tab 3.
I changed the
ionViewWillEnter(){
this.prepareAudioFile();
}
to
ionViewDidEnter(){
this.prepareAudioFile();
}
and the issue disappeared.
I have found one more "issue" that I'm currently working on. If I send the application to background on Android the audio starts looping and the console shows error
THREAD WARNING: exec() call to Media.seekToAudio blocked the main thread for 35ms. Plugin should use CordovaInterface.getThreadPool().
On iOS it's works fine. I'll get back to you when and if I find a fix
Again - thanks for your work
from ionic-audio-player.
Hi, thanks for considering this!
I personally didn't try to use this in a tabbed application. I did successfully embedded it in a navigation controller so that it can be navigate to from other pages. Would you mind elaborate on the "I cannot get back to that tab again part"? I'm kind of confused on how that could happen.
On the other hand, I would suggest adapting the code here to your code base with a refactor/rewrite. I'm showing a proof of concept in this application, and I recall spending some effort merging to the other production app that I wrote.
from ionic-audio-player.
Good to know you've solved the original one! With Ionic you certainly need to do all these trial and error things before you actually achieve something (sad face). But yeah, I'm glad you solved it!
In terms of the other warning, I suspect it's a framework thing instead of your problem to worry about. I had this experience of trying to optimize for Android but the code completely breaks on iOS, which again, turned out to be a "framework" problem and luckily got resolved in the next update that came in a week later.
But, yeah! Please feel free to talk about stuff here! I really appreciate that you actually looked into my code and decided to integrate into your project!
from ionic-audio-player.
Actually I tried to change to ionViewWillEnter and the error is still not there. It must have been another issue I guess and apologize for bringing that up.
The other issue is far worse. It's essential to me that the user can listen to the audio while doing other things on the device. The audio loops over and over again in 1 seconds interval.
I find that if I comment out the line
self.curr_playing_file.seekTo(last_position * 1000);
the error and annoying audio looping stops. Of course thats breaks the apps progressbar as well, but I think I somehow have to deal with that method call. I Tried stopping that method call when the app is onPause, but it's still not working right. I'll keep working on the issue.
Thx
from ionic-audio-player.
Yeah, I can see it's annoying. The original problem I had was Ionic doesn't get me the length of the audio file no matter how I tried before I actually play the file, which is so annoying that I wouldn't be able to properly display that on the progress bar. I think that work-around was to "secretly" play the file with a volume of "0" for a very short period of time and rewind it to the beginning and pretend that nothing happened. I don't know if this is useful information for you to know.
from ionic-audio-player.
The "funny" thing is that the component found here https://github.com/arielfaur/ionic-audio/tree/3.0 doesn't that have problem. He didn't implement your audio length solution you posted in there though, so only the html5 web player version will show the length before the file is actually playing. I wish I was smart enough to make a merged version of yours and his version. Perhaps I will try that someday. I liked your version a lot because of it's simplicity and minimal implementation 👍
from ionic-audio-player.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-audio-player.