Skip to main content

[DEPRECATED] Integrate the Flipbase player

The Player can be integrated following the same steps as the Recorder. The Player utilizes HTML5 technology.

WARNING: We highly recommend the usage of Player v2 instead.

How to integrate the Player?​

To show the Flipbase Player you have to integrate the code as shown below and replace the ‘playerId’ parameter with your own unique PlayerId.

This bundle is frozen, at two URLs. The one below, app.flipbase.com/player.js, goes through a reverse proxy on a single instance rather than to a CDN edge. The same bytes are also served from the CDN, at cdn.flipbase.com/player/app.min.js. Neither receives fixes, which is one reason among several to move to a current version.

<head>
...
<!-- Load the JavaScript Player library in the HTML head tag of your page -->
<script src="//app.flipbase.com/player.js"></script>
...
</head>

<!--
Place the HTML video element somehwere in the body where you want to show the video
-->
<video
type="flipbase"
data-video-id="5120293b-583b-4534-90dc-0f44cd51705e"
></video>
<video
type="flipbase"
data-video-id="a24e-22ae-cca6-891861f7895-78653529"
></video>

<!-- Initialize the Player and provide your 'playerId' -->
<script>
var videoPlayers = Flipbase.player({
playerId: "95f4d94b-86c0-4e4a-b23d-484158efd1a4"
});

// When one of the video players is not instantly invisible, because it is placed in a tab that is not yet visible, we need to re-render all instances.
videoPlayers.reload();
</script>

Secure mode​

When collections have enabled secure_mode all videos that are held in that collection needs to be loaded using the Flipbase player.js along with a signature property. You can read how to create this signature here. For EACH video element you need to generate a seperate signature.

...
<video
type="flipbase"
data-video-id="786553529-a24e-22ae-cca6-891861f7895"
data-signature="<SIGNATURE_VIDEO1>"
></video>
<video
type="flipbase"
data-video-id="a24e-22ae-cca6-891861f7895-78653529"
data-signature="<SIGNATURE_VIDEO2>"
></video>
...
Using the signature with the Flipbase Player.js​

Just create a signature the way you do with any API request, but append the elements you've used in the StringToSign in querystring like style to the signature. NOTE: the URI-encoded path should equal: '/api/videos/<VIDEO_ID>' when creating signatures to be used along with the video player.

SignatureString = 'signature=<SIGNATURE>&' +
'api_key=<FLIPBASE_API_KEY>&' +
'date=<DATE>'

Add this signature to each Flipbase HTML video element on the page;

<video type="flipbase" data-video-id="786553529-a24e-22ae-cca6-891861f7895" data-signature="<SIGNATURE_STRING>"></video>
Show and control a single video player​

It is also possible to just render a single video player. Then it is recommended to use the elementId option. Please be aware that in case the elementId is used, the reload option no longer can works on this video player node. You can safely remove the video element from the DOM and re-create a new DOM elment with the same attributes as shown below and then invoke the Flipbase.player function again (with the same options).

<video
type="flipbase"
id="video"
data-video-id="786553529-a24e-22ae-cca6-891861f7895"
></video>
<script>
Flipbase.player({
elementId: "video",
playerId: "xxxx-xxxxx-xxxxxx-xxxxxxx"
});
</script>

Player settings​

Maximum width or height (deprecated)

You can set maxWidth or maxHeight (in pixels, as a number rather than a string) to cap the Player's size.

Neither has a default. With both left out — which is the normal case — the Player takes the width of its parent element and derives its height from the video's own aspect ratio, falling back to 0.625 (a 16:10 shape) until the video reports its dimensions. The frequently repeated "640 by 360 by default" is not in this bundle; there is no such default to override.