@wix/video 1.72.0 → 1.79.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/README.md CHANGED
@@ -17,18 +17,20 @@ function Example() {
17
17
  uri: "video-base-uri",
18
18
  name: "My Video",
19
19
  sources: [/* video sources */],
20
- hasAudio: true
21
- }}
22
- poster={{
20
+ hasAudio: true,
21
+ poster: {
23
22
  uri: "poster-image-uri",
24
23
  width: 1920,
25
24
  height: 1080
25
+ }
26
26
  }}
27
27
  muted={true}
28
28
  loop={true}
29
29
  autoplay={true}
30
30
  videoRef={videoRef}
31
31
  qualityPolicy="proportional"
32
+ focalPoint={{ x: 50, y: 50 }}
33
+ onError={(error) => console.error('Video error:', error)}
32
34
  />
33
35
  );
34
36
  }
@@ -52,26 +54,29 @@ or:
52
54
  | --------- | ---- | ------- | ----------- |
53
55
  | id | string | - | Required unique identifier for the video element |
54
56
  | videoMedia | object | - | Video source information (see details below) |
55
- | poster | object | - | Poster image that displays before video plays (Image props) |
56
- | alt | string | '' | Alternate text for the video for accessibility |
57
57
  | muted | boolean | - | Whether the video's audio is muted |
58
58
  | loop | boolean | - | Whether the video should loop when it reaches the end |
59
59
  | autoplay | boolean | - | Whether the video should start playing automatically when loaded |
60
60
  | playbackRate | number | 1 | Playback speed of the video |
61
61
  | posterEffect | 'fade' | - | Effect to apply when transitioning from poster to video |
62
- | videoRef | React.RefObject<HTMLVideoElement> | - | React ref to access the underlying video element |
63
- | qualityPolicy | 'proportional' \| 'adaptive' \| 'highest' | Video quality selection strategy: `'proportional'` - dynamically selects quality based on container size, `'adaptive'` - uses adaptive sources (HLS/DASH), `'highest'` - always uses the highest resolution available |
62
+ | videoRef | React.RefObject\<HTMLVideoElement\> | - | React ref to access the underlying video element |
63
+ | qualityPolicy | 'proportional' \| 'adaptive' \| 'highest' | 'proportional' | Video quality selection strategy: `'proportional'` - dynamically selects quality based on container size, `'adaptive'` - uses adaptive sources (HLS/DASH), `'highest'` - always uses the highest resolution available |
64
+ | focalPoint | { x: number; y: number } | - | Focal point for video positioning (values typically 0-100) |
65
+ | motionPart | string | - | Optional identifier for motion/animation part integration |
66
+ | onError | (error: Error) => void | - | Callback function invoked when a video playback error occurs |
64
67
 
65
68
  ### videoMedia Object
66
69
 
67
70
  | Property | Type | Required | Description |
68
71
  | -------- | ---- | -------- | ----------- |
69
72
  | uri | string | Yes | Base URI for the video |
70
- | name | string | No | Name of the video |
73
+ | name | string | No | Name of the video (also used as alt text for the poster) |
74
+ | poster | ImageMedia | No | Poster image that displays before video plays (see @wix/image for ImageMedia type) |
71
75
  | sources | VideoSource[] | No | Array of video sources with different qualities (see below) |
72
76
  | adaptiveSources | AdaptiveVideoSource[] | No | Array of adaptive video sources (HLS/DASH) |
73
77
  | hasAudio | boolean | No | Whether the video has audio |
74
78
  | fps | number | No | Frames per second |
79
+ | duration | number | No | Video duration in seconds (used to skip adaptive streaming for short videos < 40s) |
75
80
 
76
81
  ### VideoSource Object
77
82
 
@@ -94,9 +99,11 @@ or:
94
99
  - Automatic quality selection based on container size
95
100
  - Supports poster images with transition effects
96
101
  - Custom playback rate
97
- - Accessibility support through alt text
102
+ - Focal point positioning for video framing
98
103
  - Responsive scaling and positioning
99
104
  - Support for adaptive streaming (HLS/DASH)
105
+ - Error handling via callback
106
+ - Reduced motion preference support
100
107
 
101
108
  ## Technical Details
102
109
 
@@ -361,4 +361,4 @@
361
361
 
362
362
 
363
363
 
364
- window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="main.d8a321d6.iframe.bundle.js"></script></body></html>
364
+ window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="main.87c66cdb.iframe.bundle.js"></script></body></html>