Sign up for free

Private Video Delivery With Mp4 Built In Players recommends that you read Private Videos to ensure that you understand the concept of private videos before proceeding.

There are cases where you would want to use built-in players that are not We support private video delivery via other players other than our in-house. In this article you can find how to deliver private videos with MP4 built-in player

MP4 private video url

Playing your private video on an MP4 player, like video.js or Android native player is as easy as just passing on the url we provide while you retrieve for example, if you would like to play the video on video.js, we provide a ready made url with mp4 extension :

Serving private videos to HTML on Chrome, Mozilla or Safari:

You can use the video tag directly to play the video in a browser, for example:

    <video height="30%" width="30%" controls>
        <source src='{video id}/token/{private token}/hls/manifest.m3u8'>

Serving private videos dynamically

In order to build a dynamically served private videos, you can leverage the /videos endpoint in order to get the url of the video and private token. For example the following steps are possible:

  • Make a request to /videos endpoint
curl --request GET \
     --url \
     --header 'accept: application/json' \
     --header 'authorization: Basic ZYX='
  • You will get the following response, where the private token in the url and you can get the mp4 url from the mp4 field:
  "videoId": "ABC",
  "title": "test video",
  "description": "something that I wanted to share",
  "public": false,
  "panoramic": false,
  "mp4Support": true,
  "publishedAt": "2023-01-19T10:19:19+00:00",
  "createdAt": "2023-01-19T10:19:19+00:00",
  "updatedAt": "2023-01-26T16:55:41+00:00",
  "tags": [],
  "metadata": [],
  "source": {
    "type": "upload",
    "uri": "/videos/ABC/source"
  "assets": {
    "iframe": "<iframe src=\"\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"true\"></iframe>",
    "player": "",
    "hls": "",
    "thumbnail": "",
    "mp4": ""
  • All you have to do now is to get the mp4 url and pass it as a value to the HTML that will be generated by the server. We will handle the rest.

Private video delivery on Android native player

You can follow the same steps as you've seen above to retrieve the video url and pass it to the native Android media player, like the example below.

Reference can be found here:

String url = "";
MediaPlayer mediaPlayer = new MediaPlayer();
    new AudioAttributes.Builder()
mediaPlayer.prepare(); // might take long! (for buffering, etc)

Was this page helpful?