@phenixrts/sdk 2025.2.4-beta.726 → 2025.2.4-beta.727

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/channels/debug/channels.js +344 -14
  2. package/channels/debug/package.json +1 -1
  3. package/channels/debug.private/channels.js +344 -14
  4. package/channels/debug.private/package.json +1 -1
  5. package/channels/debug.provideGlobalScope/channels.js +344 -14
  6. package/channels/debug.provideGlobalScope/package.json +1 -1
  7. package/channels/es5.debug.private/channels.js +337 -14
  8. package/channels/es5.debug.private/package.json +1 -1
  9. package/channels/min/channels.js +1 -1
  10. package/channels/min/channels.js.map +1 -1
  11. package/channels/min/package.json +1 -1
  12. package/channels/min.private/channels.js +1 -1
  13. package/channels/min.private/channels.js.map +1 -1
  14. package/channels/min.private/package.json +1 -1
  15. package/channels/min.provideGlobalScope/channels.js +1 -1
  16. package/channels/min.provideGlobalScope/channels.js.map +1 -1
  17. package/channels/min.provideGlobalScope/package.json +1 -1
  18. package/channels/package.json +1 -1
  19. package/full/debug/full.js +344 -14
  20. package/full/debug/package.json +1 -1
  21. package/full/debug.private/full.js +344 -14
  22. package/full/debug.private/package.json +1 -1
  23. package/full/min/full.js +1 -1
  24. package/full/min/full.js.map +1 -1
  25. package/full/min/package.json +1 -1
  26. package/full/min.private/full.js +1 -1
  27. package/full/min.private/full.js.map +1 -1
  28. package/full/min.private/package.json +1 -1
  29. package/full/package.json +1 -1
  30. package/package.json +1 -1
  31. package/publish/debug/package.json +1 -1
  32. package/publish/debug/publish.js +1 -1
  33. package/publish/debug.private/package.json +1 -1
  34. package/publish/debug.private/publish.js +1 -1
  35. package/publish/min/package.json +1 -1
  36. package/publish/min/publish.js +1 -1
  37. package/publish/min.private/package.json +1 -1
  38. package/publish/min.private/publish.js +1 -1
  39. package/publish/package.json +1 -1
  40. package/types/sdk/streaming/AudioRenditions.d.ts +10 -0
  41. package/types/sdk/streaming/HlsPlayer.d.ts +26 -1
  42. package/types/sdk/streaming/IAudioRenditionPlayer.d.ts +14 -0
  43. package/types/sdk/streaming/IHlsPlayer.d.ts +14 -1
  44. package/types/sdk/streaming/NativeAudioTracks.d.ts +10 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phenixrts/sdk/publish",
3
- "version": "2025.2.4-beta.726",
3
+ "version": "2025.2.4-beta.727",
4
4
  "files": [
5
5
  "min/"
6
6
  ],
@@ -0,0 +1,10 @@
1
+ import IComparable from '../../lang/IComparable';
2
+ export default class AudioRenditions implements IComparable<AudioRenditions> {
3
+ readonly names: readonly string[];
4
+ readonly carriesAudio: boolean;
5
+ constructor({ names, carriesAudio }: {
6
+ names: readonly string[];
7
+ carriesAudio: boolean;
8
+ });
9
+ equals(other: AudioRenditions | null): boolean;
10
+ }
@@ -1,14 +1,39 @@
1
+ import ReadOnlySubject from '../../rx/ReadOnlySubject';
1
2
  import { ChunkedStreamingOptions, ChunkedStreamingStatistics } from './StreamTypes';
2
- export default class HlsPlayer {
3
+ import AudioRenditions from './AudioRenditions';
4
+ import { IAudioRenditionFailure, IAudioRenditionPlayer, IAudioRenditionSelection } from './IAudioRenditionPlayer';
5
+ export default class HlsPlayer implements IAudioRenditionPlayer {
3
6
  private readonly _videoElement;
4
7
  private readonly _kind;
5
8
  private readonly _streamId;
6
9
  private readonly _manifestURI;
7
10
  private readonly _options;
11
+ private readonly _audioRenditions;
12
+ private readonly _readOnlyAudioRenditions;
13
+ private readonly _audioRenditionFailure;
14
+ private readonly _readOnlyAudioRenditionFailure;
15
+ private readonly _audioRenditionSelectedByViewer;
16
+ private readonly _readOnlyAudioRenditionSelectedByViewer;
17
+ private readonly _disposables;
8
18
  private _player;
19
+ private _isNative;
20
+ private _selectedAudioRenditionName;
21
+ private _failedAudioRenditionName;
22
+ private _audioRenditionFailureTimeout;
9
23
  constructor(videoElement: HTMLVideoElement, kind: string, streamId: string, manifestURI: string, options: ChunkedStreamingOptions);
24
+ get audioRenditions(): ReadOnlySubject<AudioRenditions | null>;
25
+ get audioRenditionFailure(): ReadOnlySubject<IAudioRenditionFailure | null>;
26
+ get audioRenditionSelectedByViewer(): ReadOnlySubject<IAudioRenditionSelection | null>;
10
27
  start(): void;
28
+ selectAudioRendition(name: string): void;
11
29
  isSupported(): boolean;
12
30
  getStats(): ChunkedStreamingStatistics;
13
31
  dispose(): void;
32
+ private listenToAudioRenditions;
33
+ private reportAudioRenditionFailureAfterTheErrorEvent;
34
+ private applyAudioRenditionSelection;
35
+ private readNativeAudioRenditions;
36
+ private applyNativeAudioRenditionSelection;
37
+ private followViewerSelection;
38
+ private static findFailedAudioRenditionName;
14
39
  }
@@ -0,0 +1,14 @@
1
+ import ReadOnlySubject from '../../rx/ReadOnlySubject';
2
+ import AudioRenditions from './AudioRenditions';
3
+ export interface IAudioRenditionFailure {
4
+ readonly name: string;
5
+ }
6
+ export interface IAudioRenditionSelection {
7
+ readonly name: string;
8
+ }
9
+ export interface IAudioRenditionPlayer {
10
+ readonly audioRenditions: ReadOnlySubject<AudioRenditions | null>;
11
+ readonly audioRenditionFailure: ReadOnlySubject<IAudioRenditionFailure | null>;
12
+ readonly audioRenditionSelectedByViewer: ReadOnlySubject<IAudioRenditionSelection | null>;
13
+ selectAudioRendition(name: string): void;
14
+ }
@@ -6,6 +6,7 @@ export type HlsEvents = {
6
6
  LEVEL_LOADED: string;
7
7
  VIDEO_TRACK_LOADED: string;
8
8
  MEDIA_ENDED: string;
9
+ AUDIO_TRACKS_UPDATED: string;
9
10
  ERROR: string;
10
11
  };
11
12
  export interface IHlsPlayerType {
@@ -23,9 +24,10 @@ export interface IHlsPlayerType {
23
24
  readonly levels: IHlsLevel[];
24
25
  startLevel: number;
25
26
  nextAutoLevel: number;
27
+ readonly audioTracks: IHlsAudioTrack[];
28
+ audioTrack: number;
26
29
  on: (event: string, handler: (event: string, data: IHlsEventData) => void) => void;
27
30
  off: (event: string, handler?: (event: string, data: IHlsEventData) => void) => void;
28
- Events: HlsEvents;
29
31
  }
30
32
  export interface IHlsLevelDetails {
31
33
  startSN?: number;
@@ -46,9 +48,15 @@ export interface IHlsEventData {
46
48
  text?: string;
47
49
  };
48
50
  levels?: IHlsLevel[];
51
+ audioTracks?: IHlsAudioTrack[];
52
+ context?: {
53
+ type?: string;
54
+ id?: number;
55
+ };
49
56
  frag?: {
50
57
  level?: number;
51
58
  sn?: number | string;
59
+ type?: string;
52
60
  };
53
61
  }
54
62
  export interface IHlsLevel {
@@ -56,6 +64,11 @@ export interface IHlsLevel {
56
64
  width?: number;
57
65
  bitrate?: number;
58
66
  name?: string;
67
+ audioCodec?: string;
68
+ }
69
+ export interface IHlsAudioTrack {
70
+ name: string;
71
+ groupId?: string;
59
72
  }
60
73
  export type HlsErrorTypes = {
61
74
  NETWORK_ERROR: string;
@@ -0,0 +1,10 @@
1
+ import IDisposable from '../../lang/IDisposable';
2
+ import AudioRenditions from './AudioRenditions';
3
+ export default class NativeAudioTracks {
4
+ static listen(videoElement: HTMLVideoElement, listener: () => void): IDisposable;
5
+ static keepSelection(videoElement: HTMLVideoElement, getSelectedName: () => string | null, onSelectedByViewer: (name: string) => void): IDisposable;
6
+ static readRenditions(videoElement: HTMLVideoElement): AudioRenditions | null;
7
+ static select(videoElement: HTMLVideoElement, name: string): void;
8
+ private static getTrackList;
9
+ private static toArray;
10
+ }