vidply 1.0.5 → 1.0.6

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.
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "inputs": {
3
3
  "src/utils/EventEmitter.js": {
4
- "bytes": 949,
4
+ "bytes": 1002,
5
5
  "imports": [],
6
6
  "format": "esm"
7
7
  },
8
8
  "src/utils/DOMUtils.js": {
9
- "bytes": 3730,
9
+ "bytes": 3884,
10
10
  "imports": [],
11
11
  "format": "esm"
12
12
  },
13
13
  "src/i18n/translations.js": {
14
- "bytes": 16450,
14
+ "bytes": 17011,
15
15
  "imports": [],
16
16
  "format": "esm"
17
17
  },
18
18
  "src/i18n/i18n.js": {
19
- "bytes": 1573,
19
+ "bytes": 1639,
20
20
  "imports": [
21
21
  {
22
22
  "path": "src/i18n/translations.js",
@@ -27,7 +27,7 @@
27
27
  "format": "esm"
28
28
  },
29
29
  "src/utils/TimeUtils.js": {
30
- "bytes": 2155,
30
+ "bytes": 2242,
31
31
  "imports": [
32
32
  {
33
33
  "path": "src/i18n/i18n.js",
@@ -38,7 +38,7 @@
38
38
  "format": "esm"
39
39
  },
40
40
  "src/icons/Icons.js": {
41
- "bytes": 12356,
41
+ "bytes": 12539,
42
42
  "imports": [],
43
43
  "format": "esm"
44
44
  },
@@ -69,7 +69,7 @@
69
69
  "format": "esm"
70
70
  },
71
71
  "src/controls/CaptionManager.js": {
72
- "bytes": 7219,
72
+ "bytes": 7467,
73
73
  "imports": [
74
74
  {
75
75
  "path": "src/utils/DOMUtils.js",
@@ -85,12 +85,12 @@
85
85
  "format": "esm"
86
86
  },
87
87
  "src/controls/KeyboardManager.js": {
88
- "bytes": 6553,
88
+ "bytes": 6786,
89
89
  "imports": [],
90
90
  "format": "esm"
91
91
  },
92
92
  "src/controls/TranscriptManager.js": {
93
- "bytes": 23405,
93
+ "bytes": 24133,
94
94
  "imports": [
95
95
  {
96
96
  "path": "src/utils/DOMUtils.js",
@@ -116,22 +116,22 @@
116
116
  "format": "esm"
117
117
  },
118
118
  "src/renderers/HTML5Renderer.js": {
119
- "bytes": 8362,
119
+ "bytes": 8660,
120
120
  "imports": [],
121
121
  "format": "esm"
122
122
  },
123
123
  "src/renderers/YouTubeRenderer.js": {
124
- "bytes": 6912,
124
+ "bytes": 7186,
125
125
  "imports": [],
126
126
  "format": "esm"
127
127
  },
128
128
  "src/renderers/VimeoRenderer.js": {
129
- "bytes": 6442,
129
+ "bytes": 6699,
130
130
  "imports": [],
131
131
  "format": "esm"
132
132
  },
133
133
  "src/renderers/HLSRenderer.js": {
134
- "bytes": 8455,
134
+ "bytes": 8757,
135
135
  "imports": [
136
136
  {
137
137
  "path": "src/renderers/HTML5Renderer.js",
@@ -142,7 +142,7 @@
142
142
  "format": "esm"
143
143
  },
144
144
  "src/core/Player.js": {
145
- "bytes": 35845,
145
+ "bytes": 39618,
146
146
  "imports": [
147
147
  {
148
148
  "path": "src/utils/EventEmitter.js",
@@ -224,7 +224,7 @@
224
224
  "format": "esm"
225
225
  },
226
226
  "src/index.js": {
227
- "bytes": 2706,
227
+ "bytes": 2801,
228
228
  "imports": [
229
229
  {
230
230
  "path": "src/core/Player.js",
@@ -284,7 +284,7 @@
284
284
  "bytesInOutput": 12461
285
285
  },
286
286
  "src/core/Player.js": {
287
- "bytesInOutput": 16746
287
+ "bytesInOutput": 18100
288
288
  },
289
289
  "src/renderers/YouTubeRenderer.js": {
290
290
  "bytesInOutput": 4140
@@ -302,7 +302,7 @@
302
302
  "bytesInOutput": 1000
303
303
  }
304
304
  },
305
- "bytes": 128430
305
+ "bytes": 129784
306
306
  }
307
307
  }
308
308
  }
package/dist/vidply.js CHANGED
@@ -4332,6 +4332,8 @@ var VidPly = (() => {
4332
4332
  playbackSpeed: 1,
4333
4333
  preload: "metadata",
4334
4334
  startTime: 0,
4335
+ playsInline: true,
4336
+ // Enable inline playback on iOS (prevents native fullscreen)
4335
4337
  // Controls
4336
4338
  controls: true,
4337
4339
  hideControlsDelay: 3e3,
@@ -4547,6 +4549,11 @@ var VidPly = (() => {
4547
4549
  this.element.setAttribute("tabindex", "-1");
4548
4550
  this.element.style.width = "100%";
4549
4551
  this.element.style.height = "100%";
4552
+ if (this.element.tagName === "VIDEO" && this.options.playsInline) {
4553
+ this.element.setAttribute("playsinline", "");
4554
+ this.element.setAttribute("webkit-playsinline", "");
4555
+ this.element.playsInline = true;
4556
+ }
4550
4557
  if (this.options.width) {
4551
4558
  this.container.style.width = typeof this.options.width === "number" ? `${this.options.width}px` : this.options.width;
4552
4559
  }
@@ -5082,6 +5089,25 @@ var VidPly = (() => {
5082
5089
  }
5083
5090
  this.orientationQuery = orientationQuery;
5084
5091
  }
5092
+ this.fullscreenChangeHandler = () => {
5093
+ const isFullscreen = !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement);
5094
+ if (this.state.fullscreen !== isFullscreen) {
5095
+ this.state.fullscreen = isFullscreen;
5096
+ if (isFullscreen) {
5097
+ this.container.classList.add(`${this.options.classPrefix}-fullscreen`);
5098
+ } else {
5099
+ this.container.classList.remove(`${this.options.classPrefix}-fullscreen`);
5100
+ }
5101
+ this.emit("fullscreenchange", isFullscreen);
5102
+ if (this.controlBar) {
5103
+ this.controlBar.updateFullscreenButton();
5104
+ }
5105
+ }
5106
+ };
5107
+ document.addEventListener("fullscreenchange", this.fullscreenChangeHandler);
5108
+ document.addEventListener("webkitfullscreenchange", this.fullscreenChangeHandler);
5109
+ document.addEventListener("mozfullscreenchange", this.fullscreenChangeHandler);
5110
+ document.addEventListener("MSFullscreenChange", this.fullscreenChangeHandler);
5085
5111
  }
5086
5112
  // Cleanup
5087
5113
  destroy() {
@@ -5123,6 +5149,13 @@ var VidPly = (() => {
5123
5149
  this.orientationQuery = null;
5124
5150
  this.orientationHandler = null;
5125
5151
  }
5152
+ if (this.fullscreenChangeHandler) {
5153
+ document.removeEventListener("fullscreenchange", this.fullscreenChangeHandler);
5154
+ document.removeEventListener("webkitfullscreenchange", this.fullscreenChangeHandler);
5155
+ document.removeEventListener("mozfullscreenchange", this.fullscreenChangeHandler);
5156
+ document.removeEventListener("MSFullscreenChange", this.fullscreenChangeHandler);
5157
+ this.fullscreenChangeHandler = null;
5158
+ }
5126
5159
  if (this.container && this.container.parentNode) {
5127
5160
  this.container.parentNode.insertBefore(this.element, this.container);
5128
5161
  this.container.parentNode.removeChild(this.container);