videojs-mobile-ui 0.8.0 → 0.9.0-beta.3

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,34 +1,3 @@
1
- <a name="0.8.0"></a>
2
- # [0.8.0](https://github.com/mister-ben/videojs-mobile-ui/compare/v0.5.3...v0.8.0) (2022-04-13)
3
-
4
- ### Features
5
-
6
- * Add disable options (#33) ([59e5f89](https://github.com/mister-ben/videojs-mobile-ui/commit/59e5f89)), closes [#33](https://github.com/mister-ben/videojs-mobile-ui/issues/33)
7
- * Add option to lock to landscape when entering fullscreen (#49) ([26c58d4](https://github.com/mister-ben/videojs-mobile-ui/commit/26c58d4)), closes [#49](https://github.com/mister-ben/videojs-mobile-ui/issues/49)
8
-
9
- ### Bug Fixes
10
-
11
- * Detect angle correctly where no window.orientation (#17) ([c85ac35](https://github.com/mister-ben/videojs-mobile-ui/commit/c85ac35)), closes [#17](https://github.com/mister-ben/videojs-mobile-ui/issues/17)
12
- * Fix typo in iOS orientation (#27) ([7e05afb](https://github.com/mister-ben/videojs-mobile-ui/commit/7e05afb)), closes [#27](https://github.com/mister-ben/videojs-mobile-ui/issues/27)
13
- * orientation string (#37) ([177f326](https://github.com/mister-ben/videojs-mobile-ui/commit/177f326)), closes [#37](https://github.com/mister-ben/videojs-mobile-ui/issues/37)
14
- * Remove event listeners on player dispose (#21) ([25c8fb1](https://github.com/mister-ben/videojs-mobile-ui/commit/25c8fb1)), closes [#21](https://github.com/mister-ben/videojs-mobile-ui/issues/21)
15
- * Split orientation string ([0eebd64](https://github.com/mister-ben/videojs-mobile-ui/commit/0eebd64))
16
-
17
- ### Chores
18
-
19
- * **deps-dev:** bump karma from 6.3.14 to 6.3.16 (#46) ([7bd42f1](https://github.com/mister-ben/videojs-mobile-ui/commit/7bd42f1)), closes [#46](https://github.com/mister-ben/videojs-mobile-ui/issues/46)
20
- * **deps-dev:** bump karma from 6.3.2 to 6.3.14 (#44) ([ddff196](https://github.com/mister-ben/videojs-mobile-ui/commit/ddff196)), closes [#44](https://github.com/mister-ben/videojs-mobile-ui/issues/44)
21
- * **deps:** bump engine.io from 4.1.1 to 4.1.2 (#39) ([5031c93](https://github.com/mister-ben/videojs-mobile-ui/commit/5031c93)), closes [#39](https://github.com/mister-ben/videojs-mobile-ui/issues/39)
22
- * **deps:** bump follow-redirects from 1.14.0 to 1.14.7 (#41) ([6fcbb49](https://github.com/mister-ben/videojs-mobile-ui/commit/6fcbb49)), closes [#41](https://github.com/mister-ben/videojs-mobile-ui/issues/41)
23
- * **deps:** bump follow-redirects from 1.14.7 to 1.14.8 (#45) ([cf20418](https://github.com/mister-ben/videojs-mobile-ui/commit/cf20418)), closes [#45](https://github.com/mister-ben/videojs-mobile-ui/issues/45)
24
- * **deps:** bump log4js from 6.3.0 to 6.4.0 (#42) ([f9c69ff](https://github.com/mister-ben/videojs-mobile-ui/commit/f9c69ff)), closes [#42](https://github.com/mister-ben/videojs-mobile-ui/issues/42)
25
- * **deps:** bump minimist from 1.2.5 to 1.2.6 (#50) ([6faea79](https://github.com/mister-ben/videojs-mobile-ui/commit/6faea79)), closes [#50](https://github.com/mister-ben/videojs-mobile-ui/issues/50)
26
- * **deps:** bump nanoid from 3.1.22 to 3.2.0 (#43) ([70e3440](https://github.com/mister-ben/videojs-mobile-ui/commit/70e3440)), closes [#43](https://github.com/mister-ben/videojs-mobile-ui/issues/43)
27
- * **deps:** bump shelljs from 0.8.4 to 0.8.5 (#40) ([bf57915](https://github.com/mister-ben/videojs-mobile-ui/commit/bf57915)), closes [#40](https://github.com/mister-ben/videojs-mobile-ui/issues/40)
28
- * make video.js a peer dependency (#51) ([1e1ae5d](https://github.com/mister-ben/videojs-mobile-ui/commit/1e1ae5d)), closes [#51](https://github.com/mister-ben/videojs-mobile-ui/issues/51)
29
- * update dependencies ([6fb5a7b](https://github.com/mister-ben/videojs-mobile-ui/commit/6fb5a7b))
30
- * Update to Node 14 / Generator 8 (#16) ([660dc86](https://github.com/mister-ben/videojs-mobile-ui/commit/660dc86)), closes [#16](https://github.com/mister-ben/videojs-mobile-ui/issues/16)
31
-
32
1
  <a name="0.7.0"></a>
33
2
  # [0.7.0](https://github.com/mister-ben/videojs-mobile-ui/compare/v0.6.1...v0.7.0) (2021-11-09)
34
3
 
package/README.md CHANGED
@@ -1,44 +1,58 @@
1
1
  # videojs-mobile-ui
2
2
 
3
- Mobile UI for Video.js.
3
+ > [!WARNING]
4
+ > This branch is a backport for Video.js v7.
5
+ > See the master branch for v8.
4
6
 
5
- Touch controls:
7
+ A more native mobile user experience for Video.js.
6
8
 
7
- - Double-tap the left side of the player to rewind ten seconds
8
- - Double-tap the right side of the player to fast-forward ten seconds
9
- - Single-tap the screen to show a play/pause toggle
9
+ **videojs-mobile-ui** augments the standard Video.js experience into a touch-optimized, mobile-first interface. It adds the intuitive gestures and smart behaviors users expect from top-tier video apps to your browser-based player.
10
10
 
11
- Fullscreen control:
11
+ ## Key Features
12
12
 
13
- - Rotate to landscape to enter Fullscreen
14
- - Lock to fullscreen on rotate
15
- - Always lock to landscape when entering fullscreen (works even when device rotation is disabled/non-functional)
13
+ ### 👆 Touch Controls
16
14
 
17
- ## Table of Contents
15
+ Double-tap to Seek: Just like popular video apps, users can double-tap the left or right side of the video to rewind or fast-forward.
18
16
 
19
- <!-- START doctoc generated TOC please keep comment here to allow auto update -->
20
- <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
21
- ## Installation
17
+ Large play/pause overlay: A large, screen-wide touch zone allows for easy Play/Pause toggling without hunting for tiny buttons.
22
18
 
23
- - [Installation](#installation)
24
- - [Plugin Options](#plugin-options)
25
- - [Default options](#default-options)
26
- - [Options](#options)
27
- - [Usage](#usage)
28
- - [`<script>` Tag](#script-tag)
29
- - [Browserify/CommonJS](#browserifycommonjs)
30
- - [RequireJS/AMD](#requirejsamd)
31
- - [License](#license)
32
-
33
- <!-- END doctoc generated TOC please keep comment here to allow auto update -->
34
- ## Installation
19
+ ### 📱 Fullscreen Orientation:
35
20
 
36
- ```sh
37
- npm install --save videojs-mobile-ui
38
- ```
21
+ Rotate to Watch: Automatically enter fullscreen when the user rotates their phone to landscape.
22
+
23
+ Orientation Lock: Keeps the video fullscreen and locked to landscape mode even if the user tilts their phone back slightly, preventing accidental exits (works on supported devices).
24
+
25
+ ### 🚀 Swipe Gestures (Optional)
26
+
27
+ Enable modern swipe gestures to control the viewing mode.
28
+
29
+ Swipe Up to enter fullscreen with a smooth zoom-in effect.
30
+
31
+ Swipe Down to exit fullscreen naturally.
32
+
33
+ ### 🎨 Configuration Options
34
+
35
+ Visual indicators show exactly how many seconds are being skipped during a seek.
36
+
37
+ Adjust seek times and tap sensitivity to match your specific content needs.
38
+
39
+ ## Compatibility Notes
40
+
41
+ - iOS Safari does not support orientation lock. The fullscreen video on iOS is native and not influenced by this plugin.
42
+ - Android Firefox has native rotate and lock behaviour when an element containing a video is made fullscreen, which will override this plugin.
39
43
 
40
44
  ## Plugin Options
41
45
 
46
+ Newer functionality is opt-in, to not force new features on existing players. Things you might want to add:
47
+
48
+ - `fullscreen.swipeToFullscreen`, to enter fullscreen by swiping up on the video.
49
+ - `fullscreen.swipeFromFullscreen`, to exit fullscreen by swiping down on the video (except iPhone).
50
+ - `touchControls.disableOnEnd`, to disable the touch controls at the end of the video. Useful if you have any sort of endcard displayed at the end of the video that might otherwise conflict.
51
+
52
+ The [demo] page lets you try out the configuration options.
53
+
54
+ ![QR code link to demo page][demo-qr]
55
+
42
56
  ### Default options
43
57
 
44
58
  ```js
@@ -48,32 +62,70 @@ npm install --save videojs-mobile-ui
48
62
  exitOnRotate: true,
49
63
  lockOnRotate: true,
50
64
  lockToLandscapeOnEnter: false,
51
- iOS: false,
65
+ swipeToFullscreen: false,
66
+ swipeFromFullscreen: false,
52
67
  disabled: false
53
68
  },
54
69
  touchControls: {
55
70
  seekSeconds: 10,
56
71
  tapTimeout: 300,
57
72
  disableOnEnd: false,
58
- disabled: false,
73
+ disabled: false
59
74
  }
60
75
  };
61
76
  ```
62
77
 
63
78
  ### Options
64
79
 
65
- - *fullscreen.enterOnRotate* `boolean` Whether to go fullscreen when rotating to landscape
66
- - *fullscreen.exitOnRotate* `boolean` Whether to leave fullscreen when rotating to portrait (if not locked)
67
- - *fullscreen.lockOnRotate* `boolean` Whether to lock to fullscreen when rotating to landscape
68
- - *fullscreen.lockToLandscapeOnEnter* `boolean` Whether to lock to landscape when entering fullscreen (works even when device rotation is disabled/non-functional)
69
- - *fullscreen.iOS* `boolean` Whether to use fake fullscreen on iOS (needed for controls to work)
70
- - *fullscreen.disabled* `boolean` If true no fullscreen handling except the *deprecated* iOS fullwindow hack
71
- - *touchControls.seekSeconds* `int` Seconds to seek when double-tapping
72
- - *touchControls.tapTimeout* `int` Milliseconds to consider a double-tap
73
- - *touchControls.disableOnEnd* `boolean` Whether to disable touch controls when the video has ended, e.g. if an endscreen is used. Automatically disables if the endscreen plugin is present when this plugin initialises
74
- - *touchControls.disableOnEnd* `boolean` If true no touch controls are added.
80
+ - **`fullscreen`** {Object}
81
+ Options for fullscreen behaviours.
82
+ - **`fullscreen.enterOnRotate`** {boolean}
83
+ If the device is rotated, enter fullscreen.
84
+ Default `true`.
85
+ - **`fullscreen.exitOnRotate`** {boolean}
86
+ If the device is rotated, exit fullscreen, unless `lockOnRotate` is used.
87
+ Default `true`.
88
+ - **`fullscreen.lockOnRotate`** {boolean}
89
+ When going fullscreen in response to rotation (`enterOnRotate`), also lock the orientation (not supported by iOS).
90
+ Default `true`.
91
+ - **`fullscreen.lockToLandscapeOnEnter`** {boolean}
92
+ When fullscreen is entered by any means, lock the orientation (not supported by iOS).
93
+ Default `false`.
94
+ - **`fullscreen.swipeToFullscreen`** {boolean}
95
+ Swipe up to enter fullscreen.
96
+ Default `false`.
97
+ - **`fullscreen.swipeFromFullscreen`** {boolean}
98
+ Swipe down to exit fullscreen.
99
+ Won't do anything on iOS native fullscreen, which has its own swipe down exit gesture.
100
+ Default `false`.
101
+ - **`fullscreen.disabled`** {boolean}
102
+ All fullscreen functionality provided by this plugin disabled.
103
+ Default `false`.
104
+ - **`touchControls`** {Object}
105
+ Options for tap overlay.
106
+ - **`touchControls.seekSeconds`** {number}
107
+ Increment to seek in seconds.
108
+ Default `10`.
109
+ - **`touchControls.tapTimeout`** {number}
110
+ Timeout to consider multiple taps as double rather than two single.
111
+ Default `300`.
112
+ - **`touchControls.disableOnEnd`** {boolean}
113
+ Disable the touch overlay when the video ends.
114
+ Useful if an end screen overlay is used to avoid conflict.
115
+ Default `false`.
116
+ - **`touchControls.disabled`** {boolean}
117
+ All tap overlay functionality provided by this plugin disabled.
118
+ Default `false`.
119
+
120
+ ## Installation
121
+
122
+ Version 1.x requires video.js 8.x as a peer dependency. Lower video.js versions are not supported.
75
123
 
76
- ## Usage
124
+ Version 0.x works with Video.js 7. To install the latest release of 0.x, use the `latest7` tag:
125
+
126
+ ```sh
127
+ npm install videojs-mobile-ui@latest7
128
+ ```
77
129
 
78
130
  To include videojs-mobile-ui on your website or web application, use any of the following methods.
79
131
 
@@ -86,16 +138,23 @@ This is the simplest case. Get the script in whatever way you prefer and include
86
138
  <script src="//path/to/video.min.js"></script>
87
139
  <script src="//path/to/videojs-mobile-ui.min.js"></script>
88
140
  <script>
89
- var player = videojs('my-video');
90
-
91
- player.mobileUi();
141
+ const player = videojs('my-video');
142
+ const pluginOptions = {
143
+ {
144
+ fullscreen: {
145
+ swipeToFullscreen: true
146
+ }
147
+ }
148
+ };
149
+
150
+ player.mobileUi(pluginOptions);
92
151
  </script>
93
152
  ```
94
153
 
95
154
  The release versions will be available on jdselivr, unpkg etc.
96
155
 
97
- * https://cdn.jsdelivr.net/npm/videojs-mobile-ui/dist/videojs-mobile-ui.min.js
98
- * https://cdn.jsdelivr.net/npm/videojs-mobile-ui/dist/videojs-mobile-ui.css
156
+ - https://cdn.jsdelivr.net/npm/videojs-mobile-ui/dist/videojs-mobile-ui.min.js
157
+ - https://cdn.jsdelivr.net/npm/videojs-mobile-ui/dist/videojs-mobile-ui.css
99
158
 
100
159
  ### Browserify/CommonJS
101
160
 
@@ -114,7 +173,7 @@ var player = videojs('my-video');
114
173
  player.mobileUi();
115
174
  ```
116
175
 
117
- Also include the CSS.
176
+ Also include the CSS!
118
177
 
119
178
  ### RequireJS/AMD
120
179
 
@@ -128,7 +187,7 @@ require(['video.js', 'videojs-mobile-ui'], function(videojs) {
128
187
  });
129
188
  ```
130
189
 
131
- Also include the CSS.
190
+ Also include the CSS!
132
191
 
133
192
  ### Import
134
193
 
@@ -144,5 +203,6 @@ import 'videojs-mobile-ui';
144
203
 
145
204
  MIT. Copyright (c) mister-ben &lt;git@misterben.me&gt;
146
205
 
147
-
148
- [videojs]: http://videojs.com/
206
+ [videojs]: http://videojs.org/
207
+ [demo]: https://videojs-mobile-ui.netlify.app
208
+ [demo-qr]: /demo-qr.svg