UNPKG

@ktt45678/vidstack

Version:

UI component library for building high-quality, accessible video and audio experiences on the web.

2 lines (1 loc) 1.53 kB
import{k as p}from"./vidstack-BC0sXP__.js";import{i as t}from"./vidstack-B1PqmCkk.js";const m=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx|flac)($|\?)/i,c=new Set(["audio/mpeg","audio/ogg","audio/3gp","audio/mp3","audio/webm","audio/flac"]),u=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,d=new Set(["video/mp4","video/webm","video/3gp","video/ogg","video/avi","video/mpeg"]),S=/\.(m3u8)($|\?)/i,l=/\.(mpd)($|\?)/i,g=new Set(["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"]),f=new Set(["application/dash+xml","application/xml","video/dash+xml","video/xml","video/dash"]);function r({src:e,type:i}){return t(e)?m.test(e)||c.has(i)||e.startsWith("blob:")&&i==="audio/object":i==="audio/object"}function o(e){return t(e.src)?u.test(e.src)||d.has(e.type)||e.src.startsWith("blob:")&&e.type==="video/object"||a(e)&&p():e.type==="video/object"}function a({src:e,type:i}){return t(e)&&S.test(e)||g.has(i)}function v({src:e,type:i}){return n(e)||t(e)&&l.test(e)||f.has(i)}function b(e){return t(e.src)&&(r(e)||o(e)||a(e))}function E(e){return typeof window.MediaStream<"u"&&e instanceof window.MediaStream}function n(e){return typeof e=="object"&&"protocol"in e&&e.protocol==="DASH"}function h(e,i=2){return Number(e.toFixed(i))}function w(e){return String(e).split(".")[1]?.length??0}function D(e,i,s){return Math.max(e,Math.min(s,i))}export{D as a,o as b,b as c,v as d,a as e,n as f,w as g,E as h,r as i,h as r};