SwiftAudio | Audio player for iOS | Audio Utils library
kandi X-RAY | SwiftAudio Summary
kandi X-RAY | SwiftAudio Summary
SwiftAudio is an audio player written in Swift, making it simpler to work with audio playback from streams and files.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SwiftAudio
SwiftAudio Key Features
SwiftAudio Examples and Code Snippets
Community Discussions
Trending Discussions on SwiftAudio
QUESTION
I have added audio player in UITableView using https://github.com/jorgenhenrichsen/SwiftAudio this library. Player is working fine but I am having issue in changing the play pause button image in UITableView.
This library has a method which gives the state of audio(play, ready, buffer , failed):
...ANSWER
Answered 2020-Feb-03 at 11:13You can just save in a property the index of the current playing cell (let's call it X). Than, on tap of that button from another cell (let's call it Y) you can:
- Change the icon on cell X
- Play the Y content
That will cause the state change again, this time for cell Y, so you will change the icon of cell Y.
As a side note I want to warn you that probably you should save the state of all cells in some sort of data structure (like an array) and then use that to dequeue cells in cellForRowAtIndexPath, otherwise you could get into some issue when cells start to be more than what you can see in the screen. I don't know if you did that already, but wanted to avoid you from ending up in some other trouble later.
EDIT:
Assuming that controller.player.currentIndex is the (optional) index of the cell playing) it would look something like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SwiftAudio
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page