calm / persistentstreamplayer Goto Github PK
View Code? Open in Web Editor NEWStream audio over http, and persist the data to a local file while buffering
License: MIT License
Stream audio over http, and persist the data to a local file while buffering
License: MIT License
The readyToPlay
fires only once video is down loading entirely, instead of shortly after the video started streaming. I've found that this is because the player is making range requests at the end of the file early on (I guess this is related to how mp4 are encoded) and they are only responded once the corresponding data is fetched, which is when the file is downloaded. I don't remember the specific yet, but what I observed in the requests passed to shouldWaitForLoadingOfRequestedResource
was something like:
for a file of byte length 10000. You get the idea. The second request is not responded to until all the file is downloaded, since the data is downloaded in the order it's written in the file. This is delaying the ready to play event
can we store stream video using this library
@tsheaff commented on Wed Oct 26 2016
Should wrap writeData:
in a try-catch. Any better means of handling the catch than by simply swallowing?
Hey there,
I've build in the PersistentStreamPlayer and works as expected!
However, I'm facing some issues when the iPhone locked, or when unlocking the iPhone. When unlocking the Screen, the player starts playing.
I'm using the AppDelegate class to stop the player right away, but it's still playing for about 0.5 seconds.
Another case is when starting the player, stopping it, locking the screen & then activating the screen (Not unlocking). The player starts playing then.
The second case is only in iOS 13, the first case even in lower versions.
Any ideas on how I can fix this? Do you need some more infos?
Thanks for your work.
i've tried to get this to work with radio streams which are endless stream , but it did not work
override func viewDidLoad() {
super.viewDidLoad()
let filemgr = FileManager.default
// let currentPath = filemgr.currentDirectoryPath
let dirPaths = filemgr.urls(for: .documentDirectory, in: .userDomainMask)
let docsDir = dirPaths[0].path
print("docsDir = \(docsDir)")
let url = URL(string: "http://mp3channels.webradio.antenne.de/oldies-but-goldies")!
let player = PersistentStreamPlayer(remoteURL: url, localURL: dirPaths[0])
player?.delegate = self
player?.play()
print("loaded")
}
any hint please
Hi, some background, I am using the player in a music app as the music player. So skip songs in playlists etc.. I have integrated the persistent stream player into our project and it works so far as:
However, I can't see in the documentation how to skip to another song/track? I can only see the destroy method?
Any guidance appreciated!
I'm not aware of good documentation on what order the bits will stream to resourceLoader:shouldWaitForLoadingOfRequestedResource:
I left a comment in the code about this here
So right now I believe it's only guaranteed to work if you only ever seek back rather than forward. I believe large forward seeks allow the OS to never fetch any of the bits that occurred in the middle. Anyone have more domain expertise on how the system handles seeks?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.