videojs-hls-boomstream 1.2.84 → 1.2.86-alpha.1

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.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
1
  # Changelog of ```videojs-hls-boomstream```
2
+ ## 1.2.86-alpha.1
3
+ FIX: Исправлены проблемы с авто качеством плеера, добавлено API для выбора качества
4
+ ## 1.2.86-alpha.0
5
+ FIX: Версия 1.2.86 помечена как alpha
6
+ ## 1.2.86
7
+ FIX: Добавлено автокачество на айфоне и андройде
8
+ ## 1.2.85
9
+ FIX: Исправление проблем с вопроизведением видео с загружающимся транскодами
2
10
  ## 1.2.84
3
11
  FIX: Исправление проблем с вопроизведением на ipad в хроме
4
12
  ## 1.2.83
package/README.md CHANGED
@@ -282,6 +282,38 @@ Below will be a description of the playlist methods:
282
282
  - ```getCurrentAutoplayConfig(): AutoplayConfig;``` - returns current autoplay config (type is described above).
283
283
  - ```getCurrentPlaylist(): BMSPlaylistType;``` - returns **copy** of current playlist (type is described above).
284
284
  - ```getCurrentMedia(): BMSPlaylistItem;``` - returns **copy** of current media (type is described above).
285
+
286
+ ## Quality API
287
+ videojs-hls-boomstream creates **bQuality** property on **player** object if you enable quality plugin in options.
288
+ **bQuality** has the following interface:
289
+ ```ts
290
+ interface IQualityApi {
291
+ getQualityList: () => UsersQuality[];
292
+ getQualityById: (qualityId: string) => UsersQuality | undefined;
293
+ getSelectedQualityId: () => string;
294
+ setQualityById: (qualityId: string) => void;
295
+ }
296
+
297
+ interface UsersQuality {
298
+ id: string;
299
+ bandwidth: number;
300
+ width?: number;
301
+ height?: number;
302
+ name?: string;
303
+ };
304
+ ```
305
+
306
+ This api triggers (```player.trigger```) 2 types of events:
307
+ - ```qualities_initialized``` - triggers when quality list has been initialized (once for one media); has ```UsersQuality[]``` as a payload
308
+ - ```new_quality_selected``` - triggers every time a new quality sets by ```setQualityById``` method (not triggers when adaptive bitrate algorithm selects new quality when auto quality is setted)
309
+
310
+ Below will be a description of the quality api methods:
311
+ - ```getQualityList: () => UsersQuality[]``` - returns a list of available qualities for current media
312
+ - ```getQualityById: (qualityId: string) => UsersQuality | undefined``` - if ```qualityId``` isn't string print warning in console and return ```undefined```; returns a quality object if found in quality list otherwise return ```undefined```
313
+ - ```getSelectedQualityId: () => string``` - if selected quality is auto returns ```'auto'``` otherwise returns quality id
314
+ - ```setQualityById: (qualityId: string) => void``` - if ```qualityId``` isn't string prints error in console and do nothing; if ```qualityId``` equals id which has already been selected prints warning in console and do nothing; otherwise set new quality and triggers ```new_quality_selected``` event with qualityId payload;
315
+
316
+
285
317
  ## License
286
318
 
287
319
  MIT. Copyright (c) support@boomstream.com
package/dist/typings.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { IQualityApi, CustomQuality } from './quality/QualityApiTypes';
2
+ import { BMSPlaylistLoaderInterface } from './plugin/bms-playlist/playlist-loader/BMSPlaylistLoaderInterface';
1
3
  import boomstreamHls, {
2
4
  BMSPluginError,
3
5
  BMSPluginErrorType,
@@ -11,9 +13,14 @@ import { LiveVodRequestSenderInterface } from 'src/live-vod-request-sender/LiveV
11
13
  declare module 'video.js' {
12
14
  export interface VideoJsPlayer {
13
15
  boomstreamHls(options: Partial<BoomstreamHlsOptions>): void;
14
- tech_: {
15
- session: number
16
- }
16
+ mediaData: Source;
17
+ session: number;
18
+ bases: BoomstreamBases;
19
+ id_: string;
20
+ id_recovery: null | string;
21
+ bPlaylist?: BMSPlaylistLoaderInterface;
22
+ tech(): BoomstreamPlayerTech;
23
+ bQuality?: IQualityApi;
17
24
  }
18
25
  }
19
26
 
@@ -64,12 +71,12 @@ export enum VideoMimeTypesEnum {
64
71
  LIVE = 'live'
65
72
  }
66
73
 
67
- export type VideoMimeTypesList =
68
- 'application/x-mpegURL'
69
- | 'application/vnd.apple.mpegurl'
70
- | 'video/3gpp'
71
- | 'video/3gpp2'
72
- | 'video/3gp2'
74
+ export type VideoMimeTypesList =
75
+ 'application/x-mpegURL'
76
+ | 'application/vnd.apple.mpegurl'
77
+ | 'video/3gpp'
78
+ | 'video/3gpp2'
79
+ | 'video/3gp2'
73
80
  | 'video/mpeg'
74
81
  | 'video/mp4'
75
82
  | 'video/ogg'
@@ -102,8 +109,14 @@ export type Source = {
102
109
  };
103
110
 
104
111
  export type BoomstreamPlayerTech = videojs.Tech & {
112
+ vhs: any;
113
+ hls: any;
105
114
  currentSource_: Source;
106
115
  session: null | number;
116
+ qualities?: CustomQuality[];
117
+ play?: () => void;
118
+ load?: () => void;
119
+ setSource?: (source: unknown, onlyQuality: boolean) => void;
107
120
  }
108
121
 
109
122
  // Source[] with at least 1 Source object. There must be at least 1 source for item
@@ -157,6 +170,7 @@ export type GlobalState = {
157
170
  googleAnalyticPartnerKey: string;
158
171
  yandexAnalyticPartnerKey: string;
159
172
  typeApp: string;
173
+ config: unknown;
160
174
  }
161
175
 
162
176
  export type VideoElementDimensions = {