@vidispine/vdt-materialui 26.1.0-pre.2 → 26.1.0-pre.4

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 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),o=require("clsx"),i=require("@material-ui/core"),r=["image/apng","image/bmp","image/gif","image/jpeg","image/x-icon","image/png","image/svg+xml"],g=()=>({root:{width:"100%",display:"flex",justifyContent:"center"},img:{display:"block",margin:"auto",maxWidth:"100%",maxHeight:"70vh"}});function n({classes:e,className:a,previewSource:m={}}){const{src:s}=m;return t.jsx(i.Box,{className:o(e.root,a),children:t.jsx("img",{className:e.img,src:s,alt:""})})}const l=i.withStyles(g,{name:"VdtItemImagePlayer"})(n);exports.ALLOWED_MIME_TYPES=r;exports.default=l;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),g=require("clsx"),i=require("@material-ui/core"),o=["image/apng","image/bmp","image/gif","image/jpeg","image/x-icon","image/png","image/svg+xml","image/webp"],r=()=>({root:{width:"100%",display:"flex",justifyContent:"center"},img:{display:"block",margin:"auto",maxWidth:"100%",maxHeight:"70vh"}});function n({classes:e,className:a,previewSource:m={}}){const{src:s}=m;return t.jsx(i.Box,{className:g(e.root,a),children:t.jsx("img",{className:e.img,src:s,alt:""})})}const l=i.withStyles(r,{name:"VdtItemImagePlayer"})(n);exports.ALLOWED_MIME_TYPES=o;exports.default=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),g=require("react"),L=require("clsx"),u=require("@material-ui/core"),ne=require("@material-ui/lab"),m=require("@vidispine/vdt-js"),$=require("../ItemAudioPlayer.js"),F=require("../ItemImagePlayer.js"),q=require("../ItemVideoPlayer.js"),oe=[...q.ALLOWED_MIME_TYPES,...F.ALLOWED_MIME_TYPES,...$.ALLOWED_MIME_TYPES],_="IMAGE",j="AUDIO",A="VIDEO",ae="DOCUMENT",se="BINARY",ie=e=>e.height?e.fieldOrder?`${e.tag} (${e.height}${e.fieldOrder[0]})`:`${e.tag} (${e.height}x${e.width})`:e.audioFormat?e.containerFormat!==e.audioFormat?`${e.tag} (${e.audioFormat} - ${e.containerFormat})`:`${e.tag} (${e.audioFormat})`:e.tag.join(", "),ce=e=>{const s=i=>i.split(":").reduce((o,c)=>60*o+Number(c));if(e.timeCode)return Math.floor(e.timeCode.toSeconds());if(e.duration)return s(e.duration)},le=u.withStyles({},{name:"VdtSourceSelection"})(({value:e,onChange:s,options:i,previewSourceText:o="Preview Source"})=>{const c=i.find(l=>l.label===e.label);return t.jsxs(u.FormControl,{variant:"standard",fullWidth:!0,children:[t.jsx(u.InputLabel,{children:o}),t.jsx(u.Select,{value:c,onChange:s,children:i.map(l=>t.jsx(u.MenuItem,{value:l,children:l.label},l.src))})]})}),ue=u.withStyles({},{name:"VdtLoadingPlayer"})(e=>t.jsx(ne.Skeleton,{variant:"rect",width:"100%",height:520,...e})),de=u.withStyles(e=>({root:{backgroundColor:e.palette.divider,width:"100%",height:520,display:"flex",justifyContent:"center",alignItems:"center"},label:{...e.typography.button}}),{name:"VdtNoPreviewPlayer"})(({className:e,classes:s,label:i="No Previews"})=>t.jsx("div",{className:L(s.root,e),children:t.jsx("div",{className:s.label,children:i})})),fe=()=>({root:{}});function Se({className:e,classes:s={},itemId:i,videoEl:o,itemType:c,isLoading:l,subtitleGroup:T="stl_subtitle",subtitleField:V="stl_text",sampleRate:Y="PAL",allowedMimeTypes:x=oe,additionalMimeTypes:y=[],LoadingPlayerComponent:C=ue,NoPreviewPlayerComponent:W=de,ItemImagePlayerComponent:M=F.default,ItemAudioPlayerComponent:P=$.default,ItemVideoPlayerComponent:v=q.default,ItemBinaryPlayerComponent:b,onReady:I,onCinema:p,onScreenshot:U,width:w="100%",sourceTag:S="original",SourceSelectionComponent:D=le,videoPlayerProps:B={},audioPlayerProps:R={},shapeToLabel:O=ie,ItemVideoPlayerProps:k={},ItemBinaryPlayerProps:G={},LoadingPlayerProps:J={},NoPreviewPlayerProps:z={},...H}){const[d,K]=g.useState(),n=g.useMemo(()=>m.filterShapeSource(c,{allowedMimeTypes:[...x,...y]}).map(f=>({...f,label:O(f.shape)})),[c,x,y,O]),a=g.useMemo(()=>{if(d)return m.getShapeMediaType(d.shape);if(n&&n.length>0)return m.getShapeMediaType(n[0].shape)},[d,n]),Q=({target:{value:h}})=>{const{src:f,shape:Z,type:ee}=h;if(a===A||a===j){const r=o&&o.current&&o.current.player&&o.current.player.videojs;if(!r||r.currentSrc()===f)return;const te=r.paused(),re=r.currentTime(),E=Math.floor(r.duration()),N=ce(Z);r.preload==="none"&&(r.preload="metadata"),E<=N+2&&E>=N-2?(r.addClass("vjs-has-started"),r.bigPlayButton.hide(),r.poster(""),r.one("loadedmetadata",()=>{r.currentTime(re),te||r.play()})):r.one("loadeddata",()=>{r.bigPlayButton.show()}),r.pause(),r.src({src:f,type:ee.replace("x-","")})}K(h)},X=l||a===void 0||n.length===0;return t.jsx("div",{className:L(s.root,e,"VdtItemPlayer-root"),children:X?t.jsx(t.Fragment,{children:l?t.jsx(C,{...J}):t.jsx(W,{...z})}):t.jsxs(t.Fragment,{children:[(a===_||a===j||a===ae)&&t.jsxs(t.Fragment,{children:[M&&a===_&&t.jsx(M,{previewSource:d||n[0],videoEl:o,...H}),P&&a===j&&t.jsx(P,{videoEl:o,onReady:I,width:w,sourceTag:S,previewSources:n,audioPlayerProps:R}),D&&n.length>1&&t.jsx(D,{options:n,value:d||n[0],onChange:Q})]}),b&&a===se&&t.jsx(b,{itemId:i,itemType:c,source:d||(n==null?void 0:n[0]),sourceTag:S,previewSources:n,...G}),v&&a===A&&t.jsx(v,{videoEl:o,itemType:c,subtitleGroup:T,subtitleField:V,sampleRate:Y,onReady:I,onCinema:p,onScreenshot:U,width:w,sourceTag:S,previewSources:n,videoPlayerProps:B,...k})]})})}exports.default=Se;exports.styles=fe;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("react"),L=require("clsx"),l=require("@material-ui/core"),ae=require("@material-ui/lab"),g=require("@vidispine/vdt-js"),$=require("../ItemAudioPlayer.js"),T=require("../ItemImagePlayer.js"),q=require("../ItemVideoPlayer.js"),oe=[...q.ALLOWED_MIME_TYPES,...T.ALLOWED_MIME_TYPES,...$.ALLOWED_MIME_TYPES],A="IMAGE",x="AUDIO",F="VIDEO",se="DOCUMENT",ie="BINARY",ue=e=>e.height?e.fieldOrder?`${e.tag} (${e.height}${e.fieldOrder[0]})`:`${e.tag} (${e.height}x${e.width})`:e.audioFormat?e.containerFormat!==e.audioFormat?`${e.tag} (${e.audioFormat} - ${e.containerFormat})`:`${e.tag} (${e.audioFormat})`:e.tag.join(", "),ce=e=>{const i=u=>u.split(":").reduce((a,o)=>60*a+Number(o));if(e.timeCode)return Math.floor(e.timeCode.toSeconds());if(e.duration)return i(e.duration)},le=l.withStyles({},{name:"VdtSourceSelection"})(({value:e,onChange:i,options:u,previewSourceText:a="Preview Source"})=>{const o=u.find(c=>c.label===e.label);return t.jsxs(l.FormControl,{variant:"standard",fullWidth:!0,children:[t.jsx(l.InputLabel,{children:a}),t.jsx(l.Select,{value:o,onChange:i,children:u.map(c=>t.jsx(l.MenuItem,{value:c,children:c.label},c.src))})]})}),de=l.withStyles({},{name:"VdtLoadingPlayer"})(e=>t.jsx(ae.Skeleton,{variant:"rect",width:"100%",height:520,...e})),fe=l.withStyles(e=>({root:{backgroundColor:e.palette.divider,width:"100%",height:520,display:"flex",justifyContent:"center",alignItems:"center"},label:{...e.typography.button}}),{name:"VdtNoPreviewPlayer"})(({className:e,classes:i,label:u="No Previews"})=>t.jsx("div",{className:L(i.root,e),children:t.jsx("div",{className:i.label,children:u})})),Se=()=>({root:{}});function he({className:e,classes:i={},itemId:u,videoEl:a,itemType:o,isLoading:c,subtitleGroup:p="stl_subtitle",subtitleField:V="stl_text",sampleRate:C="PAL",allowedMimeTypes:M=oe,additionalMimeTypes:y=[],LoadingPlayerComponent:Y=de,NoPreviewPlayerComponent:U=fe,ItemImagePlayerComponent:P=T.default,ItemAudioPlayerComponent:v=$.default,ItemVideoPlayerComponent:b=q.default,ItemBinaryPlayerComponent:I,onReady:w,onCinema:W,onScreenshot:B,width:D="100%",sourceTag:m="original",SourceSelectionComponent:O=le,videoPlayerProps:R={},audioPlayerProps:k={},shapeToLabel:E=ue,ItemVideoPlayerProps:G={},ItemBinaryPlayerProps:J={},LoadingPlayerProps:z={},NoPreviewPlayerProps:H={},...K}){const[d,Q]=h.useState(),n=h.useMemo(()=>g.filterShapeSource(o,{allowedMimeTypes:[...M,...y]}).map(S=>({...S,label:E(S.shape)})),[o,M,y,E]),j=h.useMemo(()=>{const{metadata:f}=o;return f?g.parseMetadataType(f,{flat:!0}).mediaType[0].toUpperCase():""},[o]),s=h.useMemo(()=>{if(j)return j;if(d)return g.getShapeMediaType(d.shape);if(n&&n.length>0)return g.getShapeMediaType(n[0].shape)},[d,n,j]),X=({target:{value:f}})=>{const{src:S,shape:ee,type:te}=f;if(s===F||s===x){const r=a&&a.current&&a.current.player&&a.current.player.videojs;if(!r||r.currentSrc()===S)return;const re=r.paused(),ne=r.currentTime(),N=Math.floor(r.duration()),_=ce(ee);r.preload==="none"&&(r.preload="metadata"),N<=_+2&&N>=_-2?(r.addClass("vjs-has-started"),r.bigPlayButton.hide(),r.poster(""),r.one("loadedmetadata",()=>{r.currentTime(ne),re||r.play()})):r.one("loadeddata",()=>{r.bigPlayButton.show()}),r.pause(),r.src({src:S,type:te.replace("x-","")})}Q(f)},Z=c||s===void 0||n.length===0;return t.jsx("div",{className:L(i.root,e,"VdtItemPlayer-root"),children:Z?t.jsx(t.Fragment,{children:c?t.jsx(Y,{...z}):t.jsx(U,{...H})}):t.jsxs(t.Fragment,{children:[(s===A||s===x||s===se)&&t.jsxs(t.Fragment,{children:[P&&s===A&&t.jsx(P,{previewSource:d||n[0],videoEl:a,...K}),v&&s===x&&t.jsx(v,{videoEl:a,onReady:w,width:D,sourceTag:m,previewSources:n,audioPlayerProps:k}),O&&n.length>1&&t.jsx(O,{options:n,value:d||n[0],onChange:X})]}),I&&s===ie&&t.jsx(I,{itemId:u,itemType:o,source:d||(n==null?void 0:n[0]),sourceTag:m,previewSources:n,...J}),b&&s===F&&t.jsx(b,{videoEl:a,itemType:o,subtitleGroup:p,subtitleField:V,sampleRate:C,onReady:w,onCinema:W,onScreenshot:B,width:D,sourceTag:m,previewSources:n,videoPlayerProps:R,...G})]})})}exports.default=he;exports.styles=Se;
@@ -1,6 +1,6 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
- import o from "clsx";
3
- import { withStyles as g, Box as r } from "@material-ui/core";
2
+ import g from "clsx";
3
+ import { withStyles as o, Box as r } from "@material-ui/core";
4
4
  const x = [
5
5
  "image/apng",
6
6
  "image/bmp",
@@ -8,7 +8,8 @@ const x = [
8
8
  "image/jpeg",
9
9
  "image/x-icon",
10
10
  "image/png",
11
- "image/svg+xml"
11
+ "image/svg+xml",
12
+ "image/webp"
12
13
  ], n = () => ({
13
14
  root: {
14
15
  width: "100%",
@@ -24,9 +25,9 @@ const x = [
24
25
  });
25
26
  function s({ classes: e, className: t, previewSource: a = {} }) {
26
27
  const { src: i } = a;
27
- return /* @__PURE__ */ m(r, { className: o(e.root, t), children: /* @__PURE__ */ m("img", { className: e.img, src: i, alt: "" }) });
28
+ return /* @__PURE__ */ m(r, { className: g(e.root, t), children: /* @__PURE__ */ m("img", { className: e.img, src: i, alt: "" }) });
28
29
  }
29
- const f = g(n, { name: "VdtItemImagePlayer" })(s);
30
+ const f = o(n, { name: "VdtItemImagePlayer" })(s);
30
31
  export {
31
32
  x as ALLOWED_MIME_TYPES,
32
33
  f as default
@@ -1,31 +1,31 @@
1
- import { jsxs as g, jsx as o, Fragment as S } from "react/jsx-runtime";
2
- import { useState as et, useMemo as w } from "react";
1
+ import { jsxs as E, jsx as o, Fragment as h } from "react/jsx-runtime";
2
+ import { useState as ot, useMemo as g } from "react";
3
3
  import Y from "clsx";
4
- import { withStyles as M, FormControl as ot, InputLabel as nt, Select as at, MenuItem as it } from "@material-ui/core";
4
+ import { withStyles as P, FormControl as at, InputLabel as nt, Select as it, MenuItem as ct } from "@material-ui/core";
5
5
  import { Skeleton as lt } from "@material-ui/lab";
6
- import { filterShapeSource as ct, getShapeMediaType as N } from "@vidispine/vdt-js";
7
- import ut, { ALLOWED_MIME_TYPES as dt } from "../ItemAudioPlayer.js";
8
- import st, { ALLOWED_MIME_TYPES as mt } from "../ItemImagePlayer.js";
9
- import ft, { ALLOWED_MIME_TYPES as St } from "../ItemVideoPlayer.js";
10
- const ht = [...St, ...mt, ...dt], p = "IMAGE", h = "AUDIO", T = "VIDEO", gt = "DOCUMENT", Mt = "BINARY", Et = (t) => t.height ? t.fieldOrder ? `${t.tag} (${t.height}${t.fieldOrder[0]})` : `${t.tag} (${t.height}x${t.width})` : t.audioFormat ? t.containerFormat !== t.audioFormat ? `${t.tag} (${t.audioFormat} - ${t.containerFormat})` : `${t.tag} (${t.audioFormat})` : t.tag.join(", "), Pt = (t) => {
11
- const i = (l) => l.split(":").reduce((n, c) => 60 * n + Number(c));
6
+ import { filterShapeSource as ut, parseMetadataType as dt, getShapeMediaType as N } from "@vidispine/vdt-js";
7
+ import st, { ALLOWED_MIME_TYPES as mt } from "../ItemAudioPlayer.js";
8
+ import ft, { ALLOWED_MIME_TYPES as St } from "../ItemImagePlayer.js";
9
+ import ht, { ALLOWED_MIME_TYPES as gt } from "../ItemVideoPlayer.js";
10
+ const Mt = [...gt, ...St, ...mt], T = "IMAGE", M = "AUDIO", F = "VIDEO", Et = "DOCUMENT", Pt = "BINARY", It = (t) => t.height ? t.fieldOrder ? `${t.tag} (${t.height}${t.fieldOrder[0]})` : `${t.tag} (${t.height}x${t.width})` : t.audioFormat ? t.containerFormat !== t.audioFormat ? `${t.tag} (${t.audioFormat} - ${t.containerFormat})` : `${t.tag} (${t.audioFormat})` : t.tag.join(", "), yt = (t) => {
11
+ const c = (l) => l.split(":").reduce((a, n) => 60 * a + Number(n));
12
12
  if (t.timeCode)
13
13
  return Math.floor(t.timeCode.toSeconds());
14
14
  if (t.duration)
15
- return i(t.duration);
16
- }, It = M(
15
+ return c(t.duration);
16
+ }, Lt = P(
17
17
  {},
18
18
  { name: "VdtSourceSelection" }
19
- )(({ value: t, onChange: i, options: l, previewSourceText: n = "Preview Source" }) => {
20
- const c = l.find((u) => u.label === t.label);
21
- return /* @__PURE__ */ g(ot, { variant: "standard", fullWidth: !0, children: [
22
- /* @__PURE__ */ o(nt, { children: n }),
23
- /* @__PURE__ */ o(at, { value: c, onChange: i, children: l.map((u) => /* @__PURE__ */ o(it, { value: u, children: u.label }, u.src)) })
19
+ )(({ value: t, onChange: c, options: l, previewSourceText: a = "Preview Source" }) => {
20
+ const n = l.find((u) => u.label === t.label);
21
+ return /* @__PURE__ */ E(at, { variant: "standard", fullWidth: !0, children: [
22
+ /* @__PURE__ */ o(nt, { children: a }),
23
+ /* @__PURE__ */ o(it, { value: n, onChange: c, children: l.map((u) => /* @__PURE__ */ o(ct, { value: u, children: u.label }, u.src)) })
24
24
  ] });
25
- }), Lt = M(
25
+ }), Dt = P(
26
26
  {},
27
27
  { name: "VdtLoadingPlayer" }
28
- )((t) => /* @__PURE__ */ o(lt, { variant: "rect", width: "100%", height: 520, ...t })), yt = M(
28
+ )((t) => /* @__PURE__ */ o(lt, { variant: "rect", width: "100%", height: 520, ...t })), _t = P(
29
29
  (t) => ({
30
30
  root: {
31
31
  backgroundColor: t.palette.divider,
@@ -40,133 +40,138 @@ const ht = [...St, ...mt, ...dt], p = "IMAGE", h = "AUDIO", T = "VIDEO", gt = "D
40
40
  }
41
41
  }),
42
42
  { name: "VdtNoPreviewPlayer" }
43
- )(({ className: t, classes: i, label: l = "No Previews" }) => /* @__PURE__ */ o("div", { className: Y(i.root, t), children: /* @__PURE__ */ o("div", { className: i.label, children: l }) })), pt = () => ({
43
+ )(({ className: t, classes: c, label: l = "No Previews" }) => /* @__PURE__ */ o("div", { className: Y(c.root, t), children: /* @__PURE__ */ o("div", { className: c.label, children: l }) })), Ft = () => ({
44
44
  root: {}
45
45
  });
46
- function Tt({
46
+ function Yt({
47
47
  className: t,
48
- classes: i = {},
48
+ classes: c = {},
49
49
  itemId: l,
50
- videoEl: n,
51
- itemType: c,
50
+ videoEl: a,
51
+ itemType: n,
52
52
  isLoading: u,
53
53
  subtitleGroup: x = "stl_subtitle",
54
- subtitleField: F = "stl_text",
55
- sampleRate: W = "PAL",
56
- allowedMimeTypes: E = ht,
57
- additionalMimeTypes: P = [],
54
+ subtitleField: W = "stl_text",
55
+ sampleRate: V = "PAL",
56
+ allowedMimeTypes: I = Mt,
57
+ additionalMimeTypes: y = [],
58
58
  // extends the default set
59
- LoadingPlayerComponent: V = Lt,
60
- NoPreviewPlayerComponent: j = yt,
61
- ItemImagePlayerComponent: I = st,
62
- ItemAudioPlayerComponent: L = ut,
63
- ItemVideoPlayerComponent: y = ft,
64
- ItemBinaryPlayerComponent: D,
65
- onReady: _,
66
- onCinema: C,
67
- onScreenshot: U,
68
- width: O = "100%",
69
- sourceTag: m = "original",
70
- SourceSelectionComponent: v = It,
71
- videoPlayerProps: B = {},
72
- audioPlayerProps: k = {},
73
- shapeToLabel: A = Et,
74
- ItemVideoPlayerProps: G = {},
75
- ItemBinaryPlayerProps: R = {},
76
- LoadingPlayerProps: q = {},
77
- NoPreviewPlayerProps: z = {},
78
- ...H
59
+ LoadingPlayerComponent: j = Dt,
60
+ NoPreviewPlayerComponent: C = _t,
61
+ ItemImagePlayerComponent: L = ft,
62
+ ItemAudioPlayerComponent: D = st,
63
+ ItemVideoPlayerComponent: _ = ht,
64
+ ItemBinaryPlayerComponent: p,
65
+ onReady: O,
66
+ onCinema: U,
67
+ onScreenshot: B,
68
+ width: v = "100%",
69
+ sourceTag: f = "original",
70
+ SourceSelectionComponent: A = Lt,
71
+ videoPlayerProps: k = {},
72
+ audioPlayerProps: G = {},
73
+ shapeToLabel: $ = It,
74
+ ItemVideoPlayerProps: R = {},
75
+ ItemBinaryPlayerProps: q = {},
76
+ LoadingPlayerProps: z = {},
77
+ NoPreviewPlayerProps: H = {},
78
+ ...J
79
79
  }) {
80
- const [d, J] = et(), e = w(() => ct(c, {
81
- allowedMimeTypes: [...E, ...P]
82
- }).map((s) => ({
83
- ...s,
84
- label: A(s.shape)
85
- })), [c, E, P, A]), a = w(() => {
80
+ const [d, K] = ot(), e = g(() => ut(n, {
81
+ allowedMimeTypes: [...I, ...y]
82
+ }).map((m) => ({
83
+ ...m,
84
+ label: $(m.shape)
85
+ })), [n, I, y, $]), S = g(() => {
86
+ const { metadata: s } = n;
87
+ return s ? dt(s, { flat: !0 }).mediaType[0].toUpperCase() : "";
88
+ }, [n]), i = g(() => {
89
+ if (S)
90
+ return S;
86
91
  if (d)
87
92
  return N(d.shape);
88
93
  if (e && e.length > 0)
89
94
  return N(e[0].shape);
90
- }, [d, e]), K = ({ target: { value: f } }) => {
91
- const { src: s, shape: X, type: Z } = f;
92
- if (a === T || a === h) {
93
- const r = n && n.current && n.current.player && n.current.player.videojs;
94
- if (!r || r.currentSrc() === s)
95
+ }, [d, e, S]), Q = ({ target: { value: s } }) => {
96
+ const { src: m, shape: Z, type: tt } = s;
97
+ if (i === F || i === M) {
98
+ const r = a && a.current && a.current.player && a.current.player.videojs;
99
+ if (!r || r.currentSrc() === m)
95
100
  return;
96
- const tt = r.paused(), rt = r.currentTime(), $ = Math.floor(r.duration()), b = Pt(X);
97
- r.preload === "none" && (r.preload = "metadata"), $ <= b + 2 && $ >= b - 2 ? (r.addClass("vjs-has-started"), r.bigPlayButton.hide(), r.poster(""), r.one("loadedmetadata", () => {
98
- r.currentTime(rt), tt || r.play();
101
+ const rt = r.paused(), et = r.currentTime(), b = Math.floor(r.duration()), w = yt(Z);
102
+ r.preload === "none" && (r.preload = "metadata"), b <= w + 2 && b >= w - 2 ? (r.addClass("vjs-has-started"), r.bigPlayButton.hide(), r.poster(""), r.one("loadedmetadata", () => {
103
+ r.currentTime(et), rt || r.play();
99
104
  })) : r.one("loadeddata", () => {
100
105
  r.bigPlayButton.show();
101
- }), r.pause(), r.src({ src: s, type: Z.replace("x-", "") });
106
+ }), r.pause(), r.src({ src: m, type: tt.replace("x-", "") });
102
107
  }
103
- J(f);
104
- }, Q = u || a === void 0 || e.length === 0;
105
- return /* @__PURE__ */ o("div", { className: Y(i.root, t, "VdtItemPlayer-root"), children: Q ? (
108
+ K(s);
109
+ }, X = u || i === void 0 || e.length === 0;
110
+ return /* @__PURE__ */ o("div", { className: Y(c.root, t, "VdtItemPlayer-root"), children: X ? (
106
111
  // eslint-disable-next-line react/jsx-no-useless-fragment
107
- /* @__PURE__ */ o(S, { children: u ? /* @__PURE__ */ o(V, { ...q }) : /* @__PURE__ */ o(j, { ...z }) })
108
- ) : /* @__PURE__ */ g(S, { children: [
109
- (a === p || a === h || a === gt) && /* @__PURE__ */ g(S, { children: [
110
- I && a === p && /* @__PURE__ */ o(
111
- I,
112
+ /* @__PURE__ */ o(h, { children: u ? /* @__PURE__ */ o(j, { ...z }) : /* @__PURE__ */ o(C, { ...H }) })
113
+ ) : /* @__PURE__ */ E(h, { children: [
114
+ (i === T || i === M || i === Et) && /* @__PURE__ */ E(h, { children: [
115
+ L && i === T && /* @__PURE__ */ o(
116
+ L,
112
117
  {
113
118
  previewSource: d || e[0],
114
- videoEl: n,
115
- ...H
119
+ videoEl: a,
120
+ ...J
116
121
  }
117
122
  ),
118
- L && a === h && /* @__PURE__ */ o(
119
- L,
123
+ D && i === M && /* @__PURE__ */ o(
124
+ D,
120
125
  {
121
- videoEl: n,
122
- onReady: _,
123
- width: O,
124
- sourceTag: m,
126
+ videoEl: a,
127
+ onReady: O,
128
+ width: v,
129
+ sourceTag: f,
125
130
  previewSources: e,
126
- audioPlayerProps: k
131
+ audioPlayerProps: G
127
132
  }
128
133
  ),
129
- v && e.length > 1 && /* @__PURE__ */ o(
130
- v,
134
+ A && e.length > 1 && /* @__PURE__ */ o(
135
+ A,
131
136
  {
132
137
  options: e,
133
138
  value: d || e[0],
134
- onChange: K
139
+ onChange: Q
135
140
  }
136
141
  )
137
142
  ] }),
138
- D && a === Mt && /* @__PURE__ */ o(
139
- D,
143
+ p && i === Pt && /* @__PURE__ */ o(
144
+ p,
140
145
  {
141
146
  itemId: l,
142
- itemType: c,
147
+ itemType: n,
143
148
  source: d || (e == null ? void 0 : e[0]),
144
- sourceTag: m,
149
+ sourceTag: f,
145
150
  previewSources: e,
146
- ...R
151
+ ...q
147
152
  }
148
153
  ),
149
- y && a === T && /* @__PURE__ */ o(
150
- y,
154
+ _ && i === F && /* @__PURE__ */ o(
155
+ _,
151
156
  {
152
- videoEl: n,
153
- itemType: c,
157
+ videoEl: a,
158
+ itemType: n,
154
159
  subtitleGroup: x,
155
- subtitleField: F,
156
- sampleRate: W,
157
- onReady: _,
158
- onCinema: C,
159
- onScreenshot: U,
160
- width: O,
161
- sourceTag: m,
160
+ subtitleField: W,
161
+ sampleRate: V,
162
+ onReady: O,
163
+ onCinema: U,
164
+ onScreenshot: B,
165
+ width: v,
166
+ sourceTag: f,
162
167
  previewSources: e,
163
- videoPlayerProps: B,
164
- ...G
168
+ videoPlayerProps: k,
169
+ ...R
165
170
  }
166
171
  )
167
172
  ] }) });
168
173
  }
169
174
  export {
170
- Tt as default,
171
- pt as styles
175
+ Yt as default,
176
+ Ft as styles
172
177
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vidispine/vdt-materialui",
3
- "version": "26.1.0-pre.2",
3
+ "version": "26.1.0-pre.4",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -36,11 +36,11 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@babel/runtime": "7.26.10",
39
- "@vidispine/proptypes": "26.1.0-pre.2",
40
- "@vidispine/vdt-api": "26.1.0-pre.2",
41
- "@vidispine/vdt-js": "26.1.0-pre.2",
42
- "@vidispine/vdt-react": "26.1.0-pre.2",
43
- "@vidispine/vdt-videojs-react": "26.1.0-pre.2",
39
+ "@vidispine/proptypes": "26.1.0-pre.4",
40
+ "@vidispine/vdt-api": "26.1.0-pre.4",
41
+ "@vidispine/vdt-js": "26.1.0-pre.4",
42
+ "@vidispine/vdt-react": "26.1.0-pre.4",
43
+ "@vidispine/vdt-videojs-react": "26.1.0-pre.4",
44
44
  "clsx": "1.2.1",
45
45
  "filesize": "10.1.0",
46
46
  "final-form": "4.20.10",
@@ -74,11 +74,11 @@
74
74
  "@material-ui/icons": "4.11.3",
75
75
  "@material-ui/lab": "4.0.0-alpha.61",
76
76
  "@types/jest": "29.5.11",
77
- "@vidispine/eslint-config-mdx": "26.1.0-pre.2",
78
- "@vidispine/eslint-config-react": "26.1.0-pre.2",
79
- "@vidispine/eslint-config-storybook": "26.1.0-pre.2",
80
- "@vidispine/prettier-config": "26.1.0-pre.2",
81
- "@vidispine/proptypes": "26.1.0-pre.2",
77
+ "@vidispine/eslint-config-mdx": "26.1.0-pre.4",
78
+ "@vidispine/eslint-config-react": "26.1.0-pre.4",
79
+ "@vidispine/eslint-config-storybook": "26.1.0-pre.4",
80
+ "@vidispine/prettier-config": "26.1.0-pre.4",
81
+ "@vidispine/proptypes": "26.1.0-pre.4",
82
82
  "@vitejs/plugin-react": "4.2.1",
83
83
  "@wojtekmaj/enzyme-adapter-react-17": "0.8.0",
84
84
  "axios": "1.7.7",