Creating a live video playback app using Cordova and Ionic

Cordova and Ionic

Bambuser's JavaScript player can be used in a Cordova app, provided you add the following declarations to your project's plugin.xml:

<allow-navigation href="*" />
<allow-navigation href="*" />
<preference name="AllowInlineMediaPlayback" value="true" />

plugin.xml example

We will go more into detail on how to add the player to a typical Ionic app in a future update to this article. In the meantime, checkout the finished implementation bambuser-exampleplayer-ionic, while reading the JavaScript API portion of the web player guide.

Dynamic content

bambuser-exampleplayer-ionic currently plays one specific broadcast using a hard-coded, shareable (da_static=1), long-lived (da_ttl=0) resourceUri.

In most apps, you probably want to load content dynamically in the end. In many scenarios, creating your own backend as a mediator of who gets served what is a good idea, but for simple scenarios where all users have access to all videos, you can use the REST API directly from the mobile app, as long as you use a read-only api key!

The Android native player guide illustrates a simple workflow for dynamically displaying the latest broadcast in your account.

Whats next?

Also check out how to add broadcasting to your Ionic app, by using cordova-plugin-bambuser