@cliff-studio/sanity-plugin-bunny-input 1.0.8 → 1.0.9
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/_chunks-es/index.js +2 -2
- package/dist/_chunks-es/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api.js +7 -5
package/dist/_chunks-es/index.js
CHANGED
|
@@ -18493,8 +18493,8 @@ function getThumbnailUrl(cdnHostname, videoId) {
|
|
|
18493
18493
|
function getPlaybackUrl(cdnHostname, videoId) {
|
|
18494
18494
|
return `https://${cdnHostname}/${videoId}/playlist.m3u8`;
|
|
18495
18495
|
}
|
|
18496
|
-
function getMp4Url(cdnHostname, videoId, availableResolutions =
|
|
18497
|
-
const parsedResolutions = (
|
|
18496
|
+
function getMp4Url(cdnHostname, videoId, availableResolutions = "") {
|
|
18497
|
+
const parsedResolutions = (availableResolutions || "").split(",").map((s) => Number.parseInt(String(s.trim()).replace(/p$/i, ""), 10)).filter((n) => Number.isFinite(n)), bestResolution = parsedResolutions.length ? Math.max(...parsedResolutions) : 720;
|
|
18498
18498
|
return `https://${cdnHostname}/${videoId}/play_${bestResolution}p.mp4`;
|
|
18499
18499
|
}
|
|
18500
18500
|
function createHeaders(config, includeJsonContentType = !1, useDirectApi = !1) {
|