@clappr/hlsjs-playback 1.8.5 → 1.9.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clappr/hlsjs-playback",
3
- "version": "1.8.5",
3
+ "version": "1.9.0",
4
4
  "description": "HLS Playback based on hls.js",
5
5
  "main": "./dist/hlsjs-playback.js",
6
6
  "module": "./dist/hlsjs-playback.esm.js",
@@ -74,6 +74,5 @@
74
74
  ]
75
75
  }
76
76
  }
77
- },
78
- "gitHead": "893e3ad46908fdee89812396e66546f06d35fb09"
77
+ }
79
78
  }
package/src/hls.js CHANGED
@@ -347,6 +347,16 @@ export default class HlsjsPlayback extends HTML5Video {
347
347
  return this._duration
348
348
  }
349
349
 
350
+ // the frame rate should be retrieved from the HLS.js level information
351
+ // as it is not necessarily exposed directly by the video element
352
+ getFrameRate() {
353
+ if (this._hls && this._hls.levels && this._hls.currentLevel >= 0) {
354
+ const level = this._hls.levels[this._hls.currentLevel]
355
+ return level && level.frameRate ? level.frameRate : null
356
+ }
357
+ return null
358
+ }
359
+
350
360
  getCurrentTime() {
351
361
  // e.g. can be < 0 if user pauses near the start
352
362
  // eventually they will then be kicked to the end by hlsjs if they run out of buffer