@clappr/player 0.13.0 → 0.14.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/player",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "An extensible media player for the web",
5
5
  "main": "dist/clappr.js",
6
6
  "scripts": {
@@ -34,10 +34,11 @@
34
34
  },
35
35
  "homepage": "https://github.com/clappr/clappr",
36
36
  "devDependencies": {
37
- "@clappr/core": "^0.15.0",
38
- "@clappr/hlsjs-playback": "^2.0.1",
39
- "@clappr/plugins": "^0.9.9",
37
+ "@clappr/core": "^0.16.0",
38
+ "@clappr/hlsjs-playback": "^3.0.0",
39
+ "@clappr/plugins": "^0.9.10",
40
40
  "@rollup/plugin-replace": "^2.4.2",
41
+ "hls.js": "^1",
41
42
  "rollup-plugin-filesize": "^9.1.1",
42
43
  "rollup-plugin-serve": "^1.1.0"
43
44
  },
@@ -12,6 +12,7 @@ const { TextEncoder, TextDecoder } = require('util')
12
12
  global.TextEncoder = global.TextEncoder || TextEncoder
13
13
  global.TextDecoder = global.TextDecoder || TextDecoder
14
14
  const { JSDOM } = require('jsdom')
15
+ const { expectNoNativeClasses, expectEs5Subclassable } = require('../../../test/dist-contract')
15
16
 
16
17
  const DIST = path.join(__dirname, '..', 'dist')
17
18
  const pkg = require('../package.json')
@@ -121,6 +122,16 @@ describe.each([
121
122
  test('exports plugins that extend the same-bundle plugin bases', () => {
122
123
  assertSharedBundleContract(resolveClappr(loadArtifact(filename)))
123
124
  })
125
+
126
+ test('plugin bases are ES5-subclassable', () => {
127
+ // Behavioral contract for full + plainhtml5: third-party ES5 plugins call
128
+ // Parent.call(this, ...) on these bases (#2540). Syntax scan below cannot
129
+ // cover full clappr(.min).js — embedded hls.js ships native classes.
130
+ const C = resolveClappr(loadArtifact(filename))
131
+ expectEs5Subclassable(C.BaseObject)
132
+ expectEs5Subclassable(C.UIObject)
133
+ expectEs5Subclassable(C.UICorePlugin, { options: {} })
134
+ })
124
135
  })
125
136
 
126
137
  describe('full player HLS', () => {
@@ -128,6 +139,12 @@ describe('full player HLS', () => {
128
139
  const C = resolveClappr(loadArtifact(filename))
129
140
  expect(Object.getPrototypeOf(C.HLS.prototype)).toBe(C.HTML5Video.prototype)
130
141
  })
142
+
143
+ test.each(FULL_PLAYER)('%s embeds its own hls.js copy', filename => {
144
+ const C = resolveClappr(loadArtifact(filename))
145
+ expect(C.HLS.HLSJS).toBeDefined()
146
+ expect(C.HLS.HLSJS).not.toBe(require('hls.js'))
147
+ })
131
148
  })
132
149
 
133
150
  describe('plainhtml5 bundle', () => {
@@ -135,6 +152,12 @@ describe('plainhtml5 bundle', () => {
135
152
  const C = resolveClappr(loadArtifact(filename))
136
153
  expect(C.HLS).toBeUndefined()
137
154
  })
155
+
156
+ // Syntax-only on plainhtml5: full player embeds hls.js (native class). ES5
157
+ // subclassability of Clappr bases is asserted for all artifacts above.
158
+ test.each(PLAINHTML5)('%s does not emit native class syntax', filename => {
159
+ expectNoNativeClasses(readArtifact(filename))
160
+ })
138
161
  })
139
162
 
140
163
  describe('UMD global and AMD branches', () => {