react-iiif-vault 1.0.6 → 1.0.8
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/dist/bundle/cjs/index.js +1 -1
- package/dist/bundle/cjs/index.js.map +1 -1
- package/dist/bundle/esm/index.mjs +19 -18
- package/dist/bundle/esm/index.mjs.map +1 -1
- package/dist/canvas-panel/cjs/canvas-panel.js +2 -2
- package/dist/canvas-panel/cjs/canvas-panel.js.map +1 -1
- package/dist/canvas-panel/esm/canvas-panel.mjs +226 -225
- package/dist/canvas-panel/esm/canvas-panel.mjs.map +1 -1
- package/dist/index.umd.js +43 -43
- package/dist/index.umd.js.map +1 -1
- package/dist/react17/cjs/index.js +1 -1
- package/dist/react17/cjs/index.js.map +1 -1
- package/dist/react17/esm/index.mjs +19 -18
- package/dist/react17/esm/index.mjs.map +1 -1
- package/dist/utils/cjs/utils.js +1 -1
- package/dist/utils/cjs/utils.js.map +1 -1
- package/dist/utils/esm/utils.mjs +101 -100
- package/dist/utils/esm/utils.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1217,23 +1217,24 @@ function On(e, t) {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
const kn = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;
|
|
1219
1219
|
function Fn(e, t) {
|
|
1220
|
-
var
|
|
1221
|
-
const n = t.items.filter((
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
if (n.length > 1)
|
|
1220
|
+
var s;
|
|
1221
|
+
const n = t.items.filter((c) => c.type === "video");
|
|
1222
|
+
let r = !1;
|
|
1223
|
+
if (e.duration || (r = !0), n.length > 1)
|
|
1225
1224
|
return E("Only one video source supported");
|
|
1226
|
-
const
|
|
1227
|
-
(
|
|
1225
|
+
const i = (s = n[0]) == null ? void 0 : s.resource, o = !!(i.service || []).find(
|
|
1226
|
+
(c) => (c.profile || "").includes("youtube.com")
|
|
1228
1227
|
);
|
|
1229
|
-
if (!r)
|
|
1228
|
+
if (!o && r)
|
|
1229
|
+
return E("Video does not have duration");
|
|
1230
|
+
if (!i)
|
|
1230
1231
|
return E("Unknown video");
|
|
1231
|
-
if ((!
|
|
1232
|
+
if ((!i.format || i.format === "text/html") && !o)
|
|
1232
1233
|
return E("Video does not have format");
|
|
1233
|
-
const
|
|
1234
|
+
const a = {
|
|
1234
1235
|
annotationId: t.items[0].annotationId,
|
|
1235
1236
|
duration: e.duration,
|
|
1236
|
-
url:
|
|
1237
|
+
url: i.id,
|
|
1237
1238
|
type: "Video",
|
|
1238
1239
|
items: [],
|
|
1239
1240
|
target: {
|
|
@@ -1243,7 +1244,7 @@ function Fn(e, t) {
|
|
|
1243
1244
|
endTime: e.duration
|
|
1244
1245
|
}
|
|
1245
1246
|
},
|
|
1246
|
-
format:
|
|
1247
|
+
format: i.format,
|
|
1247
1248
|
selector: {
|
|
1248
1249
|
type: "TemporalSelector",
|
|
1249
1250
|
temporal: {
|
|
@@ -1252,16 +1253,16 @@ function Fn(e, t) {
|
|
|
1252
1253
|
}
|
|
1253
1254
|
}
|
|
1254
1255
|
};
|
|
1255
|
-
if (
|
|
1256
|
-
|
|
1257
|
-
const
|
|
1258
|
-
if (!
|
|
1256
|
+
if (o) {
|
|
1257
|
+
a.type = "VideoYouTube";
|
|
1258
|
+
const c = i.id.match(kn);
|
|
1259
|
+
if (!c[1])
|
|
1259
1260
|
return E("Video is not known youtube video");
|
|
1260
|
-
|
|
1261
|
+
a.youTubeId = c[1];
|
|
1261
1262
|
}
|
|
1262
1263
|
return {
|
|
1263
1264
|
type: "media",
|
|
1264
|
-
media:
|
|
1265
|
+
media: a,
|
|
1265
1266
|
annotations: {
|
|
1266
1267
|
pages: []
|
|
1267
1268
|
}
|