@klever-one/web-sdk
Version:
Web SDK for integrating real-time room management and streaming functionality into web applications
39 lines (38 loc) • 1.2 kB
TypeScript
import { PixelStreaming } from '@epicgames-ps/lib-pixelstreamingfrontend-ue5.4';
/**
* AudioManager
*
* Manages audio track locking and playback for PixelStreaming.
* Handles Safari-specific audio playback issues by locking the initial audio track.
*/
export declare class AudioManager {
private initialAudioTrack;
private lockedAudioElement;
private currentVolume;
private psAudioElement;
/**
* Setup audio tracking for the given PixelStreaming instance
* Extracts and locks the initial audio track to prevent Safari audio issues
*/
setup(stream: PixelStreaming): void;
/**
* Create locked audio element with the given track
* This prevents Safari from losing audio during stream transitions
*/
private createLockedAudio;
/**
* Set volume for both locked and PS audio elements
* @param volume - Volume level (0.0 to 1.0)
*/
setVolume(volume: number): void;
/**
* Get current volume level
* @returns Current volume (0.0 to 1.0)
*/
getVolume(): number;
/**
* Cleanup all audio resources
* Stops tracks and removes audio elements from DOM
*/
cleanup(): void;
}