Skip to content

NiMO-TV/nimo-player-web

Repository files navigation

nimo-player-web

Non-Interactive Inline Frames for Live Streams, VODs and Clips

With the Nimo Embedded Player, you can embed the Nimo video player on your own website. The method to embed an iFrame tag on a web page is simpler and faster than calling API using Javascript or Flash.

<iframe
    src="https://www.nimo.tv/embed/<channel ID, video ID, clip ID>"
    height="<height>"
    width="<width>"
    frameborder="<frameborder>"
    scrolling="<scrolling>"
    allowfullscreen="<allowfullscreen>">
</iframe>

Device Adaption

Name URL Description
Desktop Embed Player https://www.nimo.tv/embed/<channel ID, video ID, clip ID> It will automatically redirect to the Mobile Embed player according to the User Agent Detection.
Mobile / Tablet https://m.nimo.tv/embed/<channel ID, video ID, clip ID> It will automatically redirect to the Desktop Embed player according to the User Agent Detection.

Browser Adaption

It only support the HTML player. The Flash player is no longer supported.

Iframe Attributes

These attributes are defined in the IFrame element. The Nimo player can not set or modify them.

NameTypeDescription
allowfullscreenbooleanIf true, the player can go full screen.
heightintegerHeight of the embedded window, in pixels. Recommended minimum: 300
scrollingbooleanIndicates when the browser should provide a scroll bar (or other scrolling device) for the frame. Recommended: no.
srcstringThe iframe src URL string should be https://www.nimo.tv/embed/{channel, video, clip} with one of these required url paths:
  • channel – (string) Name of the channel, for a live stream.
  • video – (string) Video ID (for past broadcasts, highlights, and video uploads). In this context (the video player), the video ID must have a “v” prefix.
  • clip - (string) Clip ID, for a clip of live stream. In this context (the video player), the Clip ID must have a “v” prefix.
widthintegerWidth of the embedded window, in pixels. Recommended minimum: 400

Optional Query String Parameters on Iframe src

Name Type Description
_lang integer(MS-LCID) We use MS-LCID as our language code. It is the language to be used in the interface. It is expressed as the language of the control bar. When this parameter is not set, it is determined automatically according to the accept-language in the Http Request Header. The default value is English.
_clang integer(MS-LCID) It is the language of the live stream content. The recommended channels will depends on this.

MS-LCID

The list of language <-> MS-LCID.

{
  "1025": "ar",
  "1028": "zh",
  "1033": "en",
  "1034": "es",
  "1041": "ja",
  "1046": "pt",
  "1049": "ru",
  "1054": "th",
  "1055": "tr",
  "1057": "id",
  "1066": "vi",
  "1081": "hi",
  "1086": "ms",
  "1124": "fil"
}

Interactive Frames for Live Streams, VODs and Clips

<script src= "https://www.nimo.tv/sdk/embed-player-0.5.0.min.js"></script>
<div id="<player div ID>"></div>
<script type="text/javascript">
  var options = {
    width: <width>,
    height: <height>,
    resourceId: "<channel ID> or <video ID> or <clip ID>"
  };
  var player = new NimoTV.Player("<player div ID>", options);
</script>

Required Parameters

Name Type Description
channel
– OR –
video
– OR –
clip
string or integer Channel ID (for a live stream), video ID, or clip ID.
height integer Height of the embedded window, in pixels. Recommended minimum: 300.
player div ID string Any value you like, as long as it is the same in both locations within the example.
width integer Width of the embedded window, in pixels. Recommended minimum: 400.

Optional Parameter

Name Type Description
lang integer(MS-LCID) We use MS-LCID as our language code. It is the language to be used in the interface. It is expressed as the language of the control bar. When this parameter is not set, it is determined automatically according to the accept-language in the Http Request Header. The default value is English.
autoplay integer This parameter specifies whether the initial video will automatically start to play when the player loads. Supported values are 0 or 1.
muted integer Set this parameter to 1 whether the initial video will silently start to play when the player loads.

Synchronous JavaScript Playback API

Call Description
pause():void Pauses the player.
play():void Begins playing the specified video.
destroy():void Removes the <iframe> containing the player.
muted(muted: boolean):void Mutes/Unmutes the player.

JavaScript Events

To listen to events, call addEventListener(event:String, callback:Function).

Event Emitted when …
NimoTV.Player.ENDED Video or stream ends.
NimoTV.Player.PAUSE Player is paused. Buffering and seeking is not considered paused.
NimoTV.Player.PLAY Player just unpaused, will either start video playback or start buffering.
NimoTV.Player.MUTED Player muted state is changed.

Example

<script src= "https://www.nimo.tv/sdk/embed-player-0.5.0.min.js"></script>
<div id="SamplePlayerDivID"></div>
<script type="text/javascript">
  var options = {
    width: 900,
    height: 400,
    resourceId: 6173062192
  };
  var player = new NimoTV.Player("SamplePlayerDivID", options);
  player.play();
</script>