Socket
Book a DemoInstallSign in
Socket

@codebayu/mux-data-expo-av

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codebayu/mux-data-expo-av

Mux analytics plugin for expo-av

1.0.3
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Mux Data Integration with expo-av

This is a package for using Mux Data for video QoS monitoring with a expo-av player.

If you are using React Native CLI, check out this package

View the DemoApp/ directory to see a demo application that implements this library.

Installation

# npm
npm install @codebayu/mux-data-expo-av

# yarn
yarn add @codebayu/mux-data-expo-av

Usage

import app from './package.json'; // this is your application's package.json
import { ResizeMode, Video } from 'expo-av'; // import Video from expo-av like you normally would
import { Platform } from 'react-native';
import muxExpoAv from '@codebayu/mux-data-expo-av';

// wrap the `Video` component with Mux functionality
const MuxVideo = muxExpoAv(Video);

// Pass the same props to `MuxVideo` that you would pass to the
// `Video` element. All of these props will be passed through to your underlying expo-av component
// Include a new prop for `muxOptions`
<MuxVideo
  source={{
    uri: 'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8',
  }}
  style={{ width: '100%', aspectRatio: 16 / 9 }}
  resizeMode={ResizeMode.COVER}
  isLooping
  useNativeControls
  muxOptions={{
    application_name: app.name, // (required) the name of your application
    application_version: app.version, // the version of your application (optional, but encouraged)
    data: {
      env_key: 'YOUR_ENVIRONMENT_KEY', // (required)
      player_software_version: '5.0.2', // (optional, but encouraged) the version of expo-av that you are using

      // Site Metadata
      viewer_user_id: '12345', // ex: '12345'
      experiment_name: 'player_test_A', // ex: 'player_test_A'
      sub_property_id: 'cus-1', // ex: 'cus-1'

      // Player Metadata
      player_name: '', // ex: 'My Main Player'
      player_version: '', // ex: '1.0.0'
      player_init_time: 0, // ex: 1451606400000

      // Video Metadata
      video_id: '', // ex: 'abcd123'
      video_title: '', // ex: 'My Great Video'
      video_series: '', // ex: 'Weekly Great Videos'
      video_duration: '', // in milliseconds, ex: 120000
      video_stream_type: 'on-demand', // 'live' or 'on-demand'
      video_cdn: '', // ex: 'Fastly', 'Akamai'

      // Custom Metadata
      custom_1: 'custom value 1',
    },
  }}
/>;

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

mux

FAQs

Package last updated on 30 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.