Thinking of using Ionic to build an app where a user can play video that is stored on a server somewhere. The video has to play in app, is this possible?
Of course, Ionic is built around AngularJS. You’ll just need to setup a function in any page you want, define the URL of the server, and load the video on a click of a button or so (I use Firebase storage for jpegs, could do the same for vids if I wanted). I would just suggest to cache at least 10 seconds of the file before actual play, and “define” it on your other server, + use a preloader helper (loading controller).
i’ll be using ionic 3. so it’ll play video in-app without opening the native video player on ios?
That I don’t know yet sorry, I test my app only on Android for now (I don’t have an Iphone to test). But you can make tests with Ionic View (works on both). Once you added platform on ionic CLI, type “ionic upload”. Then test it in from Ionic View.
Edit : You can also run in CLI : “ionic run ios -c -l” or so if your apple phone is connected via USB to your MacOsx computer, to check it and debug (i use the same command on android, just not the same platform).
See my last comment please above in the thread, you can test it using “ionic run ios…”
iOS is more strict about video than Android. Also, it depends what you mean by “streaming.” A lot of databases allow you to download a video completely, and then play it. (So you have to wait until the download completes.) Video streaming, like Periscope or YouTube, is when a video file is chopped into lots of tiny files, which are download in order and played smoothly one after the other. Doing that in Ionic (or anywhere) is much more difficult, unless you just upload to Vimeo, Twitch or YouTube. For example, Red5Pro, one of the main video streaming services charges over $1,000/yr.
I agree Aaron, streaming can mean a lot of different things. I answered only a few options to test locally on development. In a production app, you also have to deal with cross-domain policy (security feature) that is becoming mainstream.
I see. The videos in this app would all be under 50mb. I guess I would have to look into how hard it would be to splice them on the backend but I really don’t want to do that.
Honestly making the user wait until the download completes isn’t a huge issue, I’m just looking for something like snapchat/instagram where the video plays on the same screen instead of opening in an in-app browser/external app.