@theoplayer/react-native-analytics-youbora
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

THEOplayer React-Native Youbora Connector

A Youbora analytics connector for @theoplayer/react-native.

Installation

npm install @theoplayer/react-native-analytics-youbora

Usage

Configuring the connector

Create the connector by providing the THEOplayer instance, the appId provided by Youbora, and instanceName that describes the player or site, and an optional set of YouboraOptions:

import { useYoubora } from '@theoplayer/react-native-analytics-youbora';

const youboraOptions: youbora.Options = {
  'accountCode': 'powerdev',
  // 'username': 'dev',
  // 'parse.HLS': true,
  // 'parse.CDNNode': true,
  // 'network.ip': '1.1.1.1',
  // 'network.isp': 'MyISP',
  // 'network.connectionType': 'dialup',
  // 'content.transactionCode': 'myTransCode',
  // 'content.resource': 'mysrc.mp4',
  'content.isLive': true,
  'content.title': 'My Title',
  // 'content.title2': 'My Title2',
  // 'content.duration': 100,
  // 'content.fps': '100',
  // 'content.bitrate': 1000000,
  // 'content.throughput': 8000000,
  // 'content.rendition': 'My Rendition',
  // 'content.cdn': 'NICE264',
  // 'content.metadata': {
  //   custom_info: 'info'
  // },
  // 'ad.metadata': {
  //   custom_info: 'info'
  // },
  // 'extraparam.1': 'myExtraParam1',
  // 'extraparam.2': 'myExtraParam2'
};

const App = () => {
  const [youbora, initYoubora] = useYoubora(youboraOptions, youbora.Log.Level.DEBUG);

  const onPlayerReady = (player: THEOplayer) => {
    // Initialize Youbora connector
    initYoubora(player);
  }

  return (<THEOplayerView config={playerConfig} onPlayerReady={onPlayerReady}/>);
}

Configuration on iOS

As outlined on the native iOS connector's git repository, the app's Podfile still needs to include a dependency to the THEOplayerSDK by adding a pre-install script:

pre_install do |installer|
  adapter_target_name = "YouboraTHEOPlayerAdapter"
  puts "Patching dependencies of #{adapter_target_name}"
  def target_by_name(installer, name)
    target = installer.pod_targets.filter { |t| t.name == name }.first
    raise "No target '#{name}'" unless target
    target
  end
  adapter_target = target_by_name(installer, adapter_target_name)
  adapter_target.dependent_targets <<= target_by_name(installer, "THEOplayerSDK-core")
end

Package Sidebar

Install

npm i @theoplayer/react-native-analytics-youbora

Weekly Downloads

26

Version

1.1.1

License

SEE LICENSE AT https://www.theoplayer.com/terms

Unpacked Size

82.8 kB

Total Files

80

Last publish

Collaborators

  • theotechnologies-admin