1.2.5 • Published 6 years ago

@dive-tv/sdk-ea-front-javascript-library v1.2.5

Weekly downloads
7
License
MIT
Repository
-
Last release
6 years ago

ea-front-sdk-js

Dive Experience Amplifier front sdk for Javascript

Introduction

Dive provides a series of frontend SDK for the most common client programming languages which can be added as libraries on the client side.

The frontend SDK library provides a GUI which leverages displaying the context card real time stream and the detailed view of each card category.

NOTE: this document is being updated on a regular base and contents are subject to change.

Integration Methods

The following sections describe the different functions that SDK contains to integrate a client SW using Dive Front SDK.

  • Import SDK with npm -> npm i -S @dive-tv/sdk-ea-front-javascript-library
  • Import in js document -> var DiveSDK = require('@dive-tv/sdk-ea-front-javascript-library');
  • Authentication details are provided in the library initialization
  • API calls are performed calling library methods
  • Response statuses and objects are mapped to native objects of the library implementation language.

Initialize

initialize(selector, apiKey, userId, locale)

Initializes the library with the specified configuration

Parameters:

ClassMethodHTTP request
selectorStringHTML selector
user_idStringunique id that tracks a unique client of your service
api_keyStringclient api key provided by Dive
localelocalelanguage

Return:

N/A

Example:

var selector = "#container"
var apiKey = "client_api_key_example"; // String | Client api key provided by Dive
var userId = "user_id_example"; // String | Unique id that tracks a unique client of your s
var locale = "locale_example"; // String | Language to setup  texts of the UI and contents 

DiveSDK.initialize(selector, apiKey, userId, locale);

Movie sync availability

vodIsAvailable(movieId)

Checks if the movie/chapter is available to be synchronized using the Dive API

Parameters:

NameTypeDescription
movieIdStringrequested movies identifier

Return:

Promise => (boolean)

Example:

var clientMovieId = "clientMovieIdList_example"; // String | client movie ID
var result = DiveSDK.vodIsAvailable(clientMovieId).then((val) => {
      console.log("vod Is Available: ", val);
});

Movie Start

vodStart(movieId, timestamp, videoRef)

Initializes the synchronization and Carousel with a VOD content

Parameters:

NameTypeDescription
movieIdStringrequested movie identifier
timestampIntegerCurrent time in seconds of the media content
videoRef(optional) HTMLVideoElementHTML Video element to link the videoevents.

Return:

TypeDescription
Null--------------

Example:

var clientMovieId = "clientMovieId_example"; // String | client movie ID
var timestamp = 0; //Integer | timestamp in seconds
var videoRef = document.getElementById('video');

DiveSDK.vodStart(clientMovieId, timestamp);
or
DiveSDK.vodStart(clientMovieId, timestamp, videoRef);

Movie Start (Vimeo)

vodVimeoStart(movieId, timestamp, videoRef)

Initializes the synchronization and Carousel with a VOD content for Vimeo video embedded

Parameters:

NameTypeDescription
movieIdStringrequested movie identifier
timestampIntegerCurrent time in seconds of the media content
videoRefHTMLVideoElementHTML Video element to link the videoevents.

Return:

TypeDescription
Null--------------

Example:

var clientMovieId = "clientMovieId_example"; // String | client movie ID
var timestamp = 0; //Integer | timestamp in seconds
var videoRef = document.getElementById('video');

DiveSDK.vodVimeoStart(clientMovieId, timestamp, videoRef);

Movie Start (Youtube)

vodYoutubeStart(movieId, timestamp, player)

Initializes the synchronization and Carousel with a VOD content for Youtube video embedded

Parameters:

NameTypeDescription
movieIdStringrequested movie identifier
timestampIntegerCurrent time in seconds of the media content
playerYoutube API Video InstanceCurrent Youtube Iframe API Instance

Return:

TypeDescription
Null--------------

Example:

var clientMovieId = "clientMovieId_example"; // String | client movie ID
var timestamp = 0; //Integer | timestamp in seconds
var player = new YT.Player('ytPlayer', { height: '360', width: '640', videoId: 'M7lc1UVf-VE' });

DiveSDK.vodYoutubeStart(clientMovieId, timestamp, player);

Pause

vodPause()

Notifies to the library that the player has been paused

Parameters:

N/A

Return:

N/A

Example:

DiveSDK.vodPause();

Resume

vodResume(timestamp)

Notifies to the library that the player has been resumed

Parameters:

NameTypeDescription
timestampIntegerCurrent time in seconds of the media content

Return:

N/A

Example:

    DiveSDK.vodResume(timestamp);

Seek

vodSeek(timestamp)

Notifies to the library that the player has changed the time (seeking/jumping)

Parameters:

NameTypeDescription
timestampIntegerCurrent time in seconds of the media content

Return:

N/A

Example:

    DiveSDK.vodSeek(newTimestamp);
   

Finish

vodEnd()

Removes the carousel and disconnects the synchronization socket

Parameters:

N/A

Return:

N/A

Example:

    DiveSDK.vodEnd();

Channel sync availability

channelIsAvailable(channelId)

Checks if the channel is available to be synchronized using the Dive API

Parameters:

NameTypeDescription
channelIdId of available channelrequested channel identifier

Return:

Promise => (boolean)

Example:

var channelId = "TVE"; // String | channel ID
var result = DiveSDK.channelIsAvailable(channelId).then((val) => {
      console.log("Channel Is Available: ", val);
});

TV Start

tvStart(channelId)

Initializes the synchronization and Carousel with a Linear TV channel content

Parameters:

NameTypeDescription
channelIdStringrequested channel identifier

Return:

TypeDescription
Null-----------

Example:

diveFragment = DiveSDK.tvStart(channelId);

How to use

  • Import npm package
npm i -S @dive-tv/sdk-ea-front-javascript-library
  • DiveSDK is already enabled on your project.

Author

1.2.5

6 years ago

1.2.3

6 years ago

1.2.3-0

6 years ago

1.2.1

6 years ago

1.2.1-0

6 years ago

1.1.1

6 years ago

1.0.100-0

6 years ago

1.0.99-0

6 years ago

1.0.97-0

6 years ago

1.0.96-0

6 years ago

1.0.95-0

6 years ago

1.0.94-0

6 years ago

1.0.93-0

6 years ago

1.0.92-0

6 years ago

1.0.90-0

6 years ago

1.0.89-0

6 years ago

1.0.88-0

6 years ago

1.0.82

6 years ago

1.0.87-0

6 years ago

1.0.86-0

6 years ago

1.0.85-0

6 years ago

1.0.80-0

6 years ago

1.0.79-0

6 years ago

1.0.77-0

6 years ago

1.0.76-0

6 years ago

1.0.75

6 years ago

1.0.74

6 years ago

1.0.73

6 years ago

1.0.72

6 years ago

1.0.71

6 years ago

1.0.70

6 years ago

1.0.69

6 years ago

1.0.68

6 years ago

1.0.67

6 years ago

1.0.63

6 years ago

1.0.61

6 years ago

1.0.59

6 years ago

1.0.57

6 years ago

1.0.55

6 years ago

1.0.53

6 years ago

1.0.51

6 years ago

1.0.49

6 years ago

1.0.47

6 years ago

1.0.45

6 years ago

1.0.43

6 years ago

1.0.41

6 years ago

1.0.38

6 years ago

1.0.36

6 years ago

1.0.35

6 years ago

1.0.34

6 years ago

1.0.32

6 years ago

1.0.30

6 years ago

1.0.28

6 years ago

1.0.27

6 years ago

1.0.26

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago