fragments.md 1.95 KB
Newer Older
brice's avatar
brice committed
1 2
Libcast HTML5 Player URL Fragments
==================================
brice's avatar
brice committed
3

brice's avatar
brice committed
4
### Introduction
brice's avatar
brice committed
5 6

Some Libcast Player features may be activated with what's called `URL fragments`. 
brice's avatar
brice committed
7

brice's avatar
brice committed
8 9 10 11
In other words, it means that the Libcast embed (iFrame) source URL may be completed by query parameters introduced by a hash (#).

Here is the example of a Libcast embed code:
```
Brice Vercoustre's avatar
Brice Vercoustre committed
12
<iframe src="//media.libcast.com/widget/my-video" class="libcast_player" width="1280" height="720" frameborder="0" scrolling="no" allowfullscreen></iframe>
brice's avatar
brice committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
```

The source URL is `//media.libcast.com/widget/my-video`. 

Any fragment must be appened to the end of this URL after a hash `#`.
Example : `//media.libcast.com/widget/my-video#autoplay`

Multiple fragments may be concatenated with a semi-colon `;`.
Example : `//media.libcast.com/widget/my-video#autoplay;api`


### Autoplay

To launch video as soon as the player can, use `#autoplay`.


### Sequence

To start a video from `x`, use: `#t=x`.

To start a video from `x` and pause it at `y`, use: `#t=x,y`.

To start from the beginning and pause at `y`, use: `#t=,y`.

Time may be expressed in the following formats:
- `ss` (eg. `120` for 2 minutes)
- `mm:ss` (ex. `2:30` for two minutes and a half)
- `hh:mm:ss` (ex. `1:30:00` for one hour and a half)


### Allow API

To allow player to listen to API calls, use `#api`.


brice's avatar
brice committed
48 49 50 51 52 53 54 55 56 57 58
### Hide poster title

To hide the Player's title that is displayed on the bottom left corner of the poster, use `#hide-title`.


### Hide controls

To hide the Player's control bar, use `#hide-controls`.
Caution as you should integrate your own controls if you prevent users from accessing Libcast Player native ones.


brice's avatar
brice committed
59 60 61 62
### Complex example

Here is a URL fragment that automatically launches a sequence (from 30 seconds to an hour and a half) and enables API calls:
```
Brice Vercoustre's avatar
Brice Vercoustre committed
63
<iframe src="//media.libcast.com/widget/my-video#t=30,1:30:00;autoplay;api" class="libcast_player" width="1280" height="720" frameborder="0" scrolling="no" allowfullscreen></iframe>
brice's avatar
brice committed
64 65
```