Downloading and storing locally on tvOS - swift

I’m struggling to find any good docs/tutorials on this topic as generally TVOS development isn’t so popular and because my use case is a little niche so the questions I’m about to ask might be a bit silly but here goes:
I’m trying to build an app that will essentially be a video player (will actually be a mix of file types eventually but starting with video) that lets you navigate back and forth through videos like a slide deck.
I need to be able to download the videos and store them on the Apple TV as the actual device will be taken to my different clients’ locations and there may be no internet connection there.
The device won’t be used to install any other apps so I’m not worried about there not being enough space or TVOS clearing out downloaded files automatically to make space. I just want to know where I’m supposed to save files to!
Is there a temporary files folder or do I need to create a database or can I use coreData in some way?
Thanks,
Elliot

Related

Split game Into Parts

Hello I have a big game (mobile) divided into different parts is it possible to build a small version and make the user only download certain part ?like for example creating different games and he can download some
It's complicated but it's possible.
I don't write code because it would be endless work, but I give you some guidelines:
Asset bundles
Asset bundle is a way to very compress all your assets except scripts.
Basically you can think of it as zip files, which you can unzip and use whenever you want.
For example you can insert all the assets of a specific minigame, such as textures, 3D models, sprites, audio files and the rest.
When the user wants to play a minigame, you will have to unzip it.
You can also show a screen showing the upload percentage.
Firebase Storage
Asset bundles save you a lot of space, but if you need to save even more space, you can upload them to a server and the user will download the asset bundle from the server.
Obviously it will take a little longer than to recall it from memory; moreover, he will not be able to download it and then play it if he is offline.
To upload your asset bundles, I can recommend the Firebase Storage service.
You will not pay anything for a long time because you have 5gb free and in a month you can download it seems to me up to 1gb totally free.
Alternatively you can rent a normal server.
if you think my answer helped you, you can mark it as accepted. I would very much appreciate it :)

[Flutter]How to download video to app, and make it accessible only through the app (Similarly to Youtube/Netflix)

i'm fairly new to Flutter and is currently working on a course app that requires downloading the videos to the app.
The downloaded video will only be accessible through the app just like Youtube and Netflix, and will be hidden/encrypted from gallery. Would greatly appreciate if someone if someone could point me in the right direction in building this feature.
On iOS and Android your app has it's own isolated folder for storing documents. Items stored there are not intended to be accessible to the user outside of your app. This folder isn't scanned by the Gallery or accessible to other apps on the device. (However, with a little effort a user can access the files so this is not a complete solution where security is an concern. You would need to add encryption if you didn't, say, want a motivated user to copy the video file to a PC and be able to play it.)
the path_provider plugin gives your Flutter app common file locations on a device. The private app folder location is retrieved with getApplicationDocumentsDirectory()
"Download video" is a vague requirement. Most video on the internet (Netflix, Youtube) is provided via HLS or DASH for streaming, which you do download but the video is split up into many files- sometimes thousands of files for a single video. The dart:http package is likely what you're going to want to use to get/download the files (unless the video files aren't available via HTTP/HTTPS, then you'll need a different transport-specific library, like FTP, RTSP, etc.)

Multilingual iPhone App with Audio

I'm currently developing an ios app with a lot of audio. I want to release versions in different languages but this means having all the audio in every language, which would take up too much space.
Is there a way to release different versions of the app to the different app stores, including only the relevant audio? Can this be done under one app name/id?
Thanks!
I believe that the short answer is 'no', but there are work arounds.
Each app id has one binary associated with it, although you can change the app name by localisation.
Audio is a resource, so there is no reason not to download it separately from a web server under your control. I don't believe there is any restriction on downloading media.
Alternatively, you can store the audio on Apple's servers and call it downloadable content for a freebie in app purchase.
I think you should use webservices to get the audio files from the server and get the relevant file from the server so this may help you to achieve only the relevant data in the application.

Sencha Touch and Saving Local Media

Does anyone know if it is possible to save media from the internet on the local device using Sencha Touch? From what I've seen so far, I understand it's definitely possible to save XML or JSON data locally on the device, but I have had no luck finding ways to store media locally.
To be more specific, I am looking to program an app that provides the user with a series of audio seminars - like podcasts, really. The user would be able to stream those audio files directly from the internet, but I also need to provide the user with the ability to save an episode/seminar for later. This will be important for when a user is traveling and does not have a reliable internet connection or data plan.
The primary delivery device would be on iOS (iPhone, iPad, iPod Touch) and I would hope to be able to use the same technology on Android devices - but that would be a secondary phase.
If this is possible, how would I go about saving material? And what, if any, would be the limitations on doing so? Any thoughts on this would be greatly appreciated.
I have done something similar using Sencha Touch 1 and PhoneGap to produce a hybrid app.
Basically, I use Sencha Touch to download the JSON, etc and LocalStorage to hold the data. Downloading media/files/etc to the actual device is not supported in Sencha Touch as the framework doesn't have access to a file system.
I then use PhoneGap's API's to tap into the device's native file system and download files to the app's Documents directory and pass the file names/paths to Sencha Touch for use in the app.
I'm assuming you are looking to create a hybrid app based on your question but if this is strictly a web app then there isn't much you can do.
TO add to the above point, you possibly could base64 encode the file and store it within LocalStorage but this isn't a sustainable model as LocalStorage only gives you 5mb of space. If you go over 5mb, the user is prompted (yes, no) to allow LocalStorage to use more space (in 5mb increments). Since the files your reference have the potential to be 5mb each, you can see how this could quickly become unmanageable for both you and the user.
EDIT:
See http://phonegap.com/ for the native wrapper
http://blog.clearlyinnovative.com/post/2056122828/phonegap-plugin-for-downloading-url-all-the-code for the phonegap download plugin
and https://github.com/aaronksaunders/FileDownLoadApp for the code
Check this website out. Scroll down to storing data offline. They discuss Sencha Touch provides a set of data store and proxy classes that make it very easy to work with data from (and going to) a variety of sources - both server- and client-side... hope this helped, cheers.

Making ringtone of music files on Iphone

Is it possible to edit music files stored on iphone in app and create ringtone from them?
Any help would be appreciated.
If I understand correctly, you want to extract the music from an existing iPhone app, and then turn that music from the app into a ring tone?
The short answer is no, not if you keep your iDevice up to date and within apple's licensed operating paradigm.
The longer answer is maybe. If you jailbreak the device, you may be able to hack access to the application and extract the desired data.
If I don't understand correctly, and you're just looking to change any old mp3 into an iPhone ringtone, try googling for iPhone ringtone hacks. Of course your mileage may vary but google is again your friend.
Sorry to not provide any code. This question didn't seem to warrant it.
No, for a number of reasons. The SDK doesn't give you access to the actual file data from the music library (just an object that will play music back for you), and while you can probably export an M4A file, with an "m4r" extension that iTunes will recognize as a ringtone, you'll have to get the user to take the file off their device and import it into iTunes manually for it to be usable as an actual ringtone on their phone.