Class: VideoPlayerAPI

VideoPlayerAPI()

new VideoPlayerAPI()

Deprecated:
  • in favor of KalturaPlayerAPI VideoPlayerAPI class with methods of checking script state and embed video meta data and api data In order to set the Partner ID/UIConf ID, set the following environment variables: - KALTURA_PARTNER_ID (or REACT_APP_KALTURA_PARTNER_ID) - KALTURA_UICONF_ID (or REACT_APP_KALTURA_UICONF_ID)
Source:

Methods

(async, static) embedVideo(videoId, targetId, autoPlay) → {object}

Gets the embed meta data

Parameters:
Name Type Description
videoId string

The videoId we're embedding the placeholder for.

targetId string

The targetId the ID where we're putting the placeholder.

autoPlay boolean

Determine whether to autoplay on load of video.

Source:
Returns:

object

Type
object
Example
import { VideoPlayerAPI } from '@carbon/ibmdotcom-services';

function embedMyVideo() {
  const elem = document.getElementById('foo');
  const videoid = '12345';
  VideoPlayerAPI.embedVideo(videoid, elem);
}

(static) getVideoDuration(duration, fromMilliseconds) → {string}

Convert media duration from milliseconds and seconds to HH:MM:SS

Parameters:
Name Type Description
duration string

video duration in milliseconds

fromMilliseconds boolean

the duration argument is expressed in milliseconds rather than seconds

Source:
Returns:

converted duration

Type
string