0.67.30 • Published 26 days ago
audience-webxrplayer-sdk v0.67.30
audience-webxrplayer-sdk
audience-webxrplayer-sdk
is a TypeScript library designed to simplify the integration and management of video streams within WebXR applications. It provides a streamlined way to connect to streaming services, manage video playback, and handle channel switching dynamically based on user interaction or predefined criteria.
Features
- Play video streams directly in WebXR environments.
- Easy integration with existing streaming services.
- Dynamic channel management and switching.
- Customizable video player controls optimized for WebXR.
Installation
You can install audience-webxrplayer-sdk using npm:
npm install audience-webxrplayer-sdk
Or using yarn:
yarn add audience-webxrplayer-sdk
Quick Start
Here's a quick example to get you started with audience-webxrplayer-sdk:
import { WebXRPlayer } from 'audience-webxrplayer-sdk';
const playerConfig = {
videoElement: document.getElementById('videoElement') as HTMLVideoElement,
apiServerUrl: 'https://api.example.com',
channelId: 'yourChannelId'
};
const player = new WebXRPlayer(playerConfig);
// Play the video stream
player.play().then(() => {
console.log('Streaming has started successfully');
}).catch((error) => {
console.error('Streaming encountered an error:', error);
});