0.1.52 • Published 2 years ago

jixie-player-sdk v0.1.52

Weekly downloads
-
License
MIT
Repository
bitbucket
Last release
2 years ago

jixie-player-sdk

a player relying on our own infrastructure to play videos.

Installation

npm install jixie-player-sdk react-native-video-inc-ads react-native-vector-icons

or

yarn add jixie-player-sdk react-native-video-inc-ads react-native-vector-icons

Then, for React Native >= 0.60:

cd ios
pod install

Add the following at the beginning of ./android/app/build.gradle on Android (required for react-native-vector-icons to work):

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

Add the following in your Info.plist file on iOS (required for react-native-vector-icons to work):

<key>UIAppFonts</key>
<array>
	<string>MaterialIcons.ttf</string>
    <string>FontAwesome.ttf</string>
</array>

For React Native < 0.60

react-native link react-native-video
react-native link react-native-vector-icons

Usage

import VideoPlayer from 'jixie-player-sdk';
import React, { useRef} from 'react';
import { Button } from 'react-native';

const videoRef = useRef(null);

render() {
  
  return(
    <View>
      <Button title={'play'} onPress={() =>{videoRef.current.play()}
      }}>
        
      <VideoPlayer
        ref={videoRef}
        accountId={'accountId'}
        clientId={'clientId'}
        videoWidth={428}
        videos={['16459, 16451']}
        mainAdUnit={{ id: 'id', delay: 'delay' }}
        onStart={() => {
          // trigger when video start 
        }}
        onEnded={() => {
          // trigger when video end
        }}
        onVideoChange={() => {
          // trigger when video change
        }}
        onPlaying={() => {
          // trigger when video playing
        }}
      />
    </View>
    
  )
}

Props

PropRequiredTypeDescription
accountIdtruestringthat parameter is important as it allows to identify the organisation who has integrated the video player
jixieAccessKeytruestringthe access key provided for Jixie's partner to authenticate API requests, for example get DRM licence token
clientIdtruestringuser ad identifier or the client_id we have stored locally
videoWidthfalsenumberwidth of the video to calculate the player size.
videostruearrayan array of videoIds
mainAdUnitfalseobjectan object wrap id and delay
-idfalsestringan identifier that will allow the player to pass a proper request to the ad-server, used for the ad-slot
that is at the beginning of the video. If not set then there is no ad played
-delayfalsestringa delay in seconds to make the ad call after the start of the video.
adMidRollfalseobjectan object wrap id and interval, minimum, maximum
-idfalsenumberid of the ad unit used for mid roll ads. If not set then there is no mid-roll ads
-intervalfalsenumberit is the interval in seconds between 2 calls to the ad-server in case there is a mid-roll ad unit
-MinimumfalsenumberMinimum time left before the end of the video
-Maximumfalsenumbermaximum number of ads for a video
hotspotfalseobjectan object wrap id, hsDelay, hsDuration, maximum
-idfalsenumberthe identifier of the hotspot ad unit
-hsDelayfalsenumberthe delay between a video ad and a hotspot
-hsDurationfalsenumberthe duration to display the hotspot
-maximumfalsenumberMaximum number of hotspots

Function

load()

play()

pause()

nextVideo()

Event props

onStart

Callback function that is called when the player start video.

onPlaying

Callback function that is called every progressUpdateInterval seconds with info about which position the media is currently playing.

onEnded

Callback function that is called when the player reaches the end of the video.

onVideoChange

Callback function that is called when the player next video.

onMetadata

Callback function to receive metadata.

onEvent

trigger all events.

0.1.52

2 years ago

0.1.50

2 years ago

0.1.51

2 years ago

0.1.49

2 years ago

0.1.48

2 years ago

0.1.47

2 years ago

0.1.46

2 years ago

0.1.44

2 years ago

0.1.43

2 years ago

0.1.42

2 years ago

0.1.41

2 years ago

0.1.40

2 years ago

0.1.39

2 years ago

0.1.38

2 years ago

0.1.37

2 years ago

0.1.36

2 years ago

0.1.35

2 years ago

0.1.34

2 years ago

0.1.33

2 years ago

0.1.31

2 years ago

0.1.30

2 years ago

0.1.29

2 years ago

0.1.28

2 years ago

0.1.27

2 years ago

0.1.26

2 years ago

0.1.25

2 years ago

0.1.24

2 years ago

0.1.23

2 years ago

0.1.22

2 years ago