Can I save a stream-only track locally for offline capability? - ios

I am developing an iOS app that will play music from soundcloud. I want to give the user the option of an offline mode so he/she can play music even if there is no connection available.
it is technically possible to download the streamed mp3:s locally (I have already implemented it) but will Soundcloud allow me to do it? I have no intention of making these mp3:s accessible outside the app.
The problem of using a downloaded copy instead of the streamed track would be that the play would not count. Is there a way to register a play without actually playing the track?
I have tried to reach them through mail and twitter but I have got no reply yet.
Any thoughts?

Short summary of nickf:s comment above:
this is expressly disallowed

Related

How to upload video chunks to server and download them in real time in iOS

I'm creating an iOS app where I want a user to be able to live stream a video, however, users who join the live stream after it starts, start watching the stream from the beginning instead of live (I will also add functionality that allows the user watching to skip ahead and then be able to watch live).
I have looked at many third party streaming options such as Agora, Twilio, Vimeo, etc, however, I don't believe they meet my needs as I need users who join the live stream to start watching from the beginning and not live.
I have explored continuously uploading small video chunks to something like firebase storage, and then continuously reading those chunks for users watching the stream. However, as explained here: https://stackoverflow.com/a/37870706/13731318 , this is to very efficient and leads to a substantial lag.
Does anyone have any idea how to go about doing this that leverages third parties?
I think you can use the HLS protocol to implement this.
HLS allows starting to watch from the beginning or not. That is controlled by the settings.
I am not sure about uploading because I think it has to be implemented on the server-side more.

Control music of other apps within my app

I'm currenty trying to find out if it's possible to control the music of other apps, e.g. Spotify, within my app. The two solutions I found are:
using the SDK of the specific service (e.g. Spotify SDK)
take over the audio session in my app, but this only allows me to stop/ play the music
I'm trying to find a solution that provides me with pause, play, forward, backward control and access to the title, maybe also the cover. Then I came across the "Sony Headphones Connect" app. It has a page with media control buttons, the title of the current song and is does not require any kind of sing in to Spotify or something else.
Picture is from the app from the App Store, I tested the controls and they work.
So somehow it must be possible, does anyone have an idea how I can achieve my desired result or how the "Sony Headphones Connect" app is handling this issue?
I think I found the answer, the "Sony Headphones Connect" app is controlling the music over bluetooth. So it's not directly possible to control the music of another app.

iOS - play a song from iTunes which the user has not purchased?

I have not started coding my app but I have an idea and want to see if this part of it is possible. Would it be ok if, given a track ID, I played the song (through MediaPlayer) in the app, even if the user had not bought the song and do not have it in their library?
If not, what would be the best way to play music that anyone (or most people, at least) can listen to as they use my app?
You can play music that:
is in the user's library
or, is embedded in your app
or, is available online where your app can readily access it (assuming reachability etc.)

Issues with Soundcloud iframe and YouTube iframe together

The Soundcloud widget works fine playing multiple tracks in succession. If I then hide that frame, play a youtube video in a youtube iframe, and then switch back to a new track in the Soundcloud widget, it loads but will not play (ignoring the autoplay setting and any widget.play() calls). I had this working on Chromecast with the developer preview SDK and the 1.0 cast receiver but now with the 2.0.0 receiver it's broken. Any ideas how to proceed?
Currently there is no supported mechanism in the SDK to play YouTube videos outside of the YouTube app. Note that in general, applications may not allow other senders launch or control their receiver side, for example Hulu+ may not like it if you wan to write your own app to launch and control that application on your Chromecast; if they decide to allow such model, they need to publish the steps (for example, they can publish their App ID and additional custom data that would link deep into their application). YouTube is no different in that respect.
ok, got this working so hopefully this is useful to others. Assuming only one is active and visible at a time, the trick is to destroy the prior widgets rather than try to reuse them. For YouTube this does not mean reloading the iframe_api but simply calling YTPlayer.destroy() and new YT.Player() next time around. For SoundCloud keep a handle of the iframe and then call iframe.parentNode.removeChild(iframe) to destroy and then create again next time.

Play mp3 from web with MPMoviePlayerController over 3G

In my app I use MPMoviePlayerController to play an mp3 file from a web server. This plays while downloading the whole file, which is fine over WiFi. But now I want it to work over 3G (and get it into the app store). How do I get it to just buffer the next 10 seconds or so (as per apple rules)? I'm digging through the documentation on AVPlayer, HTTP Live streaming, etc, but I'm still confused about the best way to do this. With so many podcast apps out there, I'm suprised there aren't more tutorials/libraries about it.
Thanks for your time.
I investigated this as well, and I was not able find a way to limit the look-ahead buffer using MPMoviePlayerController. I believe you would have to load chunks at the network layer and feed them in at the AVFoundation layer, but I have not attempted this myself.
That said, I can confirm that you can get an app approved that plays mp3 files using MPMoviePlayerController over both WiFi and 3G connections. In my app I added a setting so the user can decide whether to enable mp3 downloads over 3G or not, although I don't know if that was needed to get approved. I provided it so users didn't inadvertently incur bandwidth costs.

Resources