├── player ├── defaultposter.jpg ├── plyr-hls.js ├── index.html ├── plyr.css └── plyr.min.js ├── -media ├── loading-animation.gif └── fav2.svg ├── push-all.txt ├── oplayer ├── index.html ├── oplayer.css └── oplayer.js ├── search ├── data │ └── getanimelist.py ├── search.js └── index.html ├── README.md ├── index.html ├── style.css └── script.js /player/defaultposter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuronekony4n/astream/HEAD/player/defaultposter.jpg -------------------------------------------------------------------------------- /-media/loading-animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuronekony4n/astream/HEAD/-media/loading-animation.gif -------------------------------------------------------------------------------- /push-all.txt: -------------------------------------------------------------------------------- 1 | # Sometimes I forget how to do this LOL 2 | 3 | git add . 4 | git commit -m "yes" 5 | git push -u origin master -------------------------------------------------------------------------------- /oplayer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | OPlayer - Start streaming now using OPlayer 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /search/data/getanimelist.py: -------------------------------------------------------------------------------- 1 | # Run this for updating the anime.json 2 | # change for last pagination from gogoanime anime list page 3 | 4 | import requests 5 | import json 6 | import time 7 | 8 | url_template = "https://animoasa.glitch.me/animelist/{}" 9 | start_num = 1 10 | end_num = 91 11 | animelist = [] 12 | 13 | for num in range(start_num, end_num + 1): 14 | url = url_template.format(num) 15 | print("Getting data for page ", num) 16 | response = requests.get(url) 17 | data = response.json() 18 | animelist.extend(data) 19 | 20 | with open('anime.json', 'w') as f: 21 | json.dump(animelist, f) 22 | 23 | with open('anime.json', 'r') as f: 24 | count = json.load(f) 25 | 26 | num_objects = len(count) 27 | 28 | print("Done! Saved as anime.json") 29 | print("Total Anime:", num_objects) 30 | time.sleep(1000) 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ASTREAM 2 | 3 | Basic Anime streaming web. It uses consumet API under-the-hood for everything from searching to streaming. It uses `gogoanime` as the stream provider. 4 | 5 | It written in only HTML, CSS and JS. 6 | 7 | 8 | 9 | --- 10 | ## Hosting 11 | Because is only a static website, you have a lot of free forever option for hosting. Use github page or cloudflare. 12 | 13 | --- 14 | ## Support 15 | It's not like i'm gonna use the money for the server or something.. only donate me if you appreciate this work 16 | 17 | 18 | 19 | --- 20 | That's all, Bye 👋👋👋 -------------------------------------------------------------------------------- /search/search.js: -------------------------------------------------------------------------------- 1 | const searchInput = document.getElementById("search"); 2 | const animeList = document.getElementById("resultContainer"); 3 | const animecount = document.getElementById("animecount"); 4 | 5 | const searchanime = async (searchBox) => { 6 | const res = await fetch("/search/data/anime.json"); 7 | const animedata = await res.json(); 8 | 9 | let fits = animedata.filter((anime) => { 10 | const regex = new RegExp(`^${searchBox}`, "gi"); 11 | return ( 12 | anime.name.match(regex)); 13 | }); 14 | 15 | if (searchBox.length === 0) { 16 | fits = []; 17 | animeList.innerHTML = ""; 18 | } 19 | 20 | outputHtml(fits); 21 | }; 22 | 23 | const outputHtml = (fits) => { 24 | if (fits.length > 0) { 25 | const animeFits = fits 26 | .map( 27 | (fit) => 28 | `
29 | ${fit.name} 30 |
` 31 | ) 32 | .join(""); 33 | animeList.innerHTML = animeFits; 34 | } 35 | }; 36 | 37 | searchInput.addEventListener("input", () => searchanime(search.value)); 38 | 39 | fetch('/search/data/anime.json') 40 | .then(response => response.json()) 41 | .then(data => { 42 | const count = Object.keys(data).length; 43 | console.log('Number of objects:', count); 44 | animecount.innerText = count; 45 | }) 46 | .catch(error => console.error('Error fetching data:', error)); 47 | -------------------------------------------------------------------------------- /search/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | fast search - astream 9 | 10 | 11 | 12 | 13 | 14 |
15 |

Fast Search

16 | 20 |
21 |

22 | Total anime titles: 23 | counting.. | Last updated July, 9 2023.

24 | If any anime has been updated after this date, it will not be visible. If you are unable to find the anime you are 25 | looking for, please use the main search.

26 | 27 | Tip: Try japanese name!
Use "Shingeki no Kyojin" instead of "Attack on Titan". 28 |

29 | 30 |
31 | 32 | 38 | 39 |
40 |
41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /-media/fav2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /player/plyr-hls.js: -------------------------------------------------------------------------------- 1 | document.addEventListener("DOMContentLoaded", () => { 2 | const video = document.querySelector("video"); 3 | const source = video.getElementsByTagName("source")[0].src; 4 | 5 | // For more options see: https://github.com/sampotts/plyr/#options 6 | // captions.update is required for captions to work with hls.js 7 | const defaultOptions = { 8 | controls: ['play-large', 'rewind', 'play', 'progress', 'current-time', 'duration', 'fast-forward', 'mute', 'volume', 'captions', 'settings', 'pip', 'fullscreen'], 9 | settings: ['captions', 'quality', 'speed', 'loop'], 10 | ratio: "16:9", 11 | tooltips: { 12 | controls: true, 13 | seek: true, 14 | }, 15 | autoplay: true, 16 | }; 17 | 18 | if (Hls.isSupported()) { 19 | // For more Hls.js options, see https://github.com/dailymotion/hls.js 20 | const hls = new Hls(); 21 | hls.loadSource(source); 22 | 23 | // From the m3u8 playlist, hls parses the manifest and returns 24 | // all available video qualities. This is important, in this approach, 25 | // we will have one source on the Plyr player. 26 | hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) { 27 | 28 | // Transform available levels into an array of integers (height values). 29 | const availableQualities = hls.levels.map((l) => l.height) 30 | 31 | // Add new qualities to option 32 | defaultOptions.quality = { 33 | default: availableQualities[0], 34 | options: availableQualities, 35 | // this ensures Plyr to use Hls to update quality level 36 | forced: true, 37 | onChange: (e) => updateQuality(e), 38 | } 39 | 40 | // Initialize here 41 | const player = new Plyr(video, defaultOptions); 42 | }); 43 | hls.attachMedia(video); 44 | window.hls = hls; 45 | } else { 46 | // default options with no quality update in case Hls is not supported 47 | const player = new Plyr(video, defaultOptions); 48 | } 49 | 50 | function updateQuality(newQuality) { 51 | window.hls.levels.forEach((level, levelIndex) => { 52 | if (level.height === newQuality) { 53 | console.log("Found quality match with " + newQuality); 54 | window.hls.currentLevel = levelIndex; 55 | } 56 | }); 57 | } 58 | }); -------------------------------------------------------------------------------- /player/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | video player by willydev 10 | 11 | 73 | 74 | 75 | 76 | 77 |
78 | 80 | 82 |
83 | 84 | 94 | 95 | 96 | 97 | 98 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /oplayer/oplayer.css: -------------------------------------------------------------------------------- 1 | body, 2 | html { 3 | margin: 0; 4 | padding: 0; 5 | width: 100%; 6 | width: 100svw; 7 | height: 100vh; 8 | height: 100svh; 9 | font-family: Arial, Helvetica, sans-serif; 10 | } 11 | 12 | @media (min-width: 640px) { 13 | * { 14 | user-select: none !important; 15 | -webkit-user-select: none !important; 16 | -khtml-user-select: none !important; 17 | -moz-user-select: none !important; 18 | -ms-user-select: none !important; 19 | } 20 | } 21 | 22 | a, 23 | button, 24 | img { 25 | -webkit-tap-highlight-color: rgba(255, 255, 255, 0) !important; 26 | -webkit-tap-highlight-color: transparent !important; 27 | } 28 | 29 | button { 30 | border-radius: 0.35rem !important; 31 | } 32 | 33 | .spinner { 34 | animation: spinner 0.9s infinite linear; 35 | } 36 | 37 | @keyframes spinner { 38 | 0% { 39 | transform: rotate(0deg); 40 | } 41 | 42 | 100% { 43 | transform: rotate(360deg); 44 | } 45 | } 46 | 47 | #oplayer { 48 | width: 100% !important; 49 | height: 100% !important; 50 | } 51 | 52 | video { 53 | height: 100% !important; 54 | max-width: 100%; 55 | object-position: center; 56 | object-fit: contain !important; 57 | } 58 | 59 | /* overriding */ 60 | .css-1ftojuw { 61 | --primary-color: white !important; 62 | } 63 | 64 | .css-1xk8bpn { 65 | width: calc(100% + 5px); 66 | margin-left: -2px; 67 | } 68 | 69 | .css-1gyrt30[aria-checked='true'] .css-l3w6ir { 70 | background-color: white !important; 71 | } 72 | 73 | #oplayer .css-l3w6ir::before { 74 | background-color: black; 75 | } 76 | 77 | #oplayer [aria-label='Setting'], 78 | #oplayer .playlist, 79 | #oplayer .css-fy6n4p { 80 | border-radius: 1rem; 81 | background-color: rgba(0, 0, 0, 0.75); 82 | /* backdrop-filter: blur(5px); */ 83 | } 84 | 85 | #oplayer [role='menu'] { 86 | padding: 0.5rem; 87 | min-width: 18rem; 88 | } 89 | 90 | @media (min-width: 640px) { 91 | [role='menu'] { 92 | min-width: 20rem; 93 | } 94 | } 95 | 96 | @media (min-width: 1280px) { 97 | [role='menu'] { 98 | min-width: 22rem; 99 | } 100 | } 101 | 102 | [role='menuitem'] { 103 | border-radius: 0.7rem; 104 | overflow: hidden; 105 | height: 2.8rem; 106 | } 107 | 108 | [role='menuitem'] div { 109 | height: 100%; 110 | } 111 | 112 | #oplayer [role='menuitemradio'] { 113 | border-radius: 0.5rem; 114 | overflow: hidden; 115 | justify-content: start !important; 116 | gap: 1rem !important; 117 | height: 2.8rem; 118 | font-size: 0.85rem !important; 119 | } 120 | 121 | [role='menuitemradio'] svg { 122 | order: -9999 !important; 123 | -ms-flex-order: -9999 !important; 124 | display: block !important; 125 | opacity: 0; 126 | } 127 | 128 | [role='menuitemradio'][aria-checked='true'] svg { 129 | opacity: 1 !important; 130 | } 131 | 132 | [aria-label='Play'][type='button'] { 133 | background: transparent !important; 134 | } 135 | 136 | [aria-label='Play'][type='button']::before { 137 | content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' fill='none'/%3E%3Cpath fill='white' fill-rule='evenodd' d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10' clip-rule='evenodd' opacity='0.4'/%3E%3Cpath fill='white' d='m15.414 13.059l-4.72 2.787C9.934 16.294 9 15.71 9 14.786V9.214c0-.924.934-1.507 1.694-1.059l4.72 2.787c.781.462.781 1.656 0 2.118'/%3E%3C/svg%3E"); 138 | width: 4rem; 139 | height: 4rem; 140 | display: block; 141 | /* filter: drop-shadow(0 10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1)); */ 142 | position: absolute; 143 | top: 50%; 144 | left: 50%; 145 | transform: translate(-50%, -50%); 146 | flex-shrink: 0; 147 | } 148 | 149 | @media (min-width: 1280px) { 150 | [aria-label='Play'][type='button']::before { 151 | width: 5rem; 152 | height: 5rem; 153 | } 154 | } 155 | 156 | @media (max-width: 640px) { 157 | [aria-label='Screenshot'] { 158 | display: none !important; 159 | } 160 | } 161 | 162 | #oplayer .playlist-list-item { 163 | margin: 0 0.5rem 0.5rem; 164 | border-radius: 0.7rem; 165 | border: none; 166 | } 167 | 168 | #oplayer .playlist-head { 169 | border-bottom: none; 170 | background: transparent; 171 | } 172 | 173 | .playlist-list-item-thumb, 174 | .playlist-list-item-thumb img { 175 | border-radius: 0.5rem; 176 | } 177 | 178 | .playlist-back { 179 | border-radius: 0.35rem !important; 180 | } 181 | 182 | .css-1y9tj12 { 183 | padding-top: 0.5em; 184 | } -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | astream - watch anime 9 | 10 | 11 | 12 | 13 | 14 | 15 |

this service is no longer work! find an alternative at everythingmore.com

16 |
17 |
18 |
19 |

Watch History

20 | 21 |
22 |
    23 | History empty 24 |
25 | 26 |

27 | The watch history feature can only save up to 10 lists and it is stored locally, meaning it can only be 28 | accessed on the current browser and not on any other device. If you wish to delete the watch history, 29 | you can click on Clear History, but please note that it is a permanent 30 | action and cannot be undone. 31 |

32 |
33 |
34 | 35 |
36 | 37 |
39 | 42 |
43 | 44 | 80 | 81 | 82 | 83 |
84 |
85 | 86 | 89 |
90 | 91 | 117 | 118 | 121 | 122 |
123 |
124 | Dukung website ini dengan cara berdonasi mulai 125 | dari Rp1000! 126 | DONASI 127 |
128 | 129 | 137 |
138 |
139 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | * { 2 | font-family: Open sans, Helvetica, sans-serif; 3 | margin: 0; 4 | } 5 | 6 | body { 7 | background-color: #111; 8 | } 9 | 10 | .container { 11 | max-width: 768px; 12 | margin: 0 auto; 13 | display: flex; 14 | flex-direction: column; 15 | background: #222; 16 | } 17 | 18 | .video-container { 19 | background-color: #000; 20 | width: 100%; 21 | height: 0; 22 | padding-bottom: 56.25%; 23 | position: relative; 24 | } 25 | 26 | #player { 27 | position: absolute; 28 | top: 0; 29 | left: 0; 30 | width: 100%; 31 | height: 100%; 32 | } 33 | 34 | #videoTitle { 35 | font-weight: bold; 36 | display: block; 37 | font-size: 1.5rem; 38 | width: 100%; 39 | margin-bottom: 10px; 40 | color: #fff; 41 | } 42 | 43 | #videoDescription { 44 | margin: 15px 0px 15px 0px; 45 | font-size: 0.9rem; 46 | color: #999999; 47 | } 48 | 49 | #animeInfoContainer { 50 | background-color: #222222; 51 | padding: 0px 20px 0px 20px; 52 | } 53 | 54 | #animeInfoContainer span[id=subordub] { 55 | text-transform: uppercase; 56 | } 57 | 58 | #animeInfoContainer span[id=status] { 59 | background-color: coral; 60 | } 61 | 62 | #animeInfoContainer span { 63 | background-color: #333333; 64 | color: #fff; 65 | border-radius: 20px; 66 | padding: 5px 10px; 67 | margin-right: 2px; 68 | font-size: 0.8rem; 69 | font-weight: bold; 70 | } 71 | 72 | 73 | .container-search { 74 | display: flex; 75 | align-items: center; 76 | background-color: #222222; 77 | padding: 10px; 78 | flex-direction: row; 79 | justify-content: center; 80 | gap: 0.5rem; 81 | } 82 | 83 | .search-input { 84 | background-color: #333333; 85 | border: none; 86 | color: white; 87 | padding: 10px 20px; 88 | font-size: 1rem; 89 | flex: 1; 90 | border-radius: 5px; 91 | 92 | } 93 | 94 | .search-button { 95 | background-color: #32B4FE; 96 | color: white; 97 | border: none; 98 | padding: 10px 10px; 99 | cursor: pointer; 100 | border-radius: 5px; 101 | } 102 | 103 | .home-button { 104 | background-color: coral; 105 | color: white; 106 | border: none; 107 | padding: 10px 10px; 108 | cursor: pointer; 109 | border-radius: 5px; 110 | } 111 | 112 | .container-search svg { 113 | transform: scale(1.3); 114 | } 115 | 116 | .errorLine { 117 | display: flex; 118 | color: #fff; 119 | font-size: 0.7rem; 120 | padding: 5px 10px; 121 | background-color: #111; 122 | justify-content: center; 123 | } 124 | 125 | .errorLine a { 126 | color: #ccc; 127 | margin-left: 5px; 128 | } 129 | 130 | .select-container { 131 | display: flex; 132 | align-items: center; 133 | color: #fff; 134 | margin-bottom: 20px; 135 | } 136 | 137 | .left-text { 138 | margin-right: 10px; 139 | text-transform: uppercase; 140 | font-size: 0.9em; 141 | font-weight: bold; 142 | } 143 | 144 | #selectElement { 145 | padding: 10px 20px; 146 | border-radius: 25px; 147 | background-color: #333; 148 | color: #fff; 149 | border: none; 150 | outline: none; 151 | appearance: none; 152 | flex-grow: 1; 153 | margin-right: 10px; 154 | } 155 | 156 | #episodeButton { 157 | padding: 10px 20px; 158 | background-color: #32B4FE; 159 | color: #fff; 160 | border-radius: 25px; 161 | border: none; 162 | outline: none; 163 | cursor: pointer; 164 | font-weight: bold; 165 | text-transform: uppercase; 166 | } 167 | 168 | .container-sresult { 169 | padding: 10px 20px; 170 | display: flex; 171 | justify-content: center; 172 | align-items: center; 173 | flex-direction: column; 174 | } 175 | 176 | #animeContainer { 177 | display: grid; 178 | gap: 0.4rem; 179 | grid-template-columns: repeat(4, 24.333%); 180 | } 181 | 182 | #animeContainer>a { 183 | background-color: #1d1d1d; 184 | display: flex; 185 | color: #fff; 186 | align-items: center; 187 | flex-direction: column; 188 | border-radius: 0.2rem; 189 | text-decoration: none; 190 | cursor: pointer; 191 | } 192 | 193 | #animeContainer>a>img { 194 | width: 100%; 195 | height: 15rem; 196 | object-fit: cover; 197 | border-top-left-radius: 0.2rem; 198 | border-top-right-radius: 0.2rem; 199 | } 200 | 201 | #animeContainer>a>.label { 202 | display: flex; 203 | flex-direction: column; 204 | align-self: flex-start; 205 | overflow: hidden; 206 | padding: 0.75rem; 207 | } 208 | 209 | #animeContainer>a>.label> :is(.name, .url) { 210 | width: 100%; 211 | overflow: hidden; 212 | } 213 | 214 | #animeContainer>a>.label>.name { 215 | font-size: 0.8rem; 216 | color: #fff; 217 | 218 | -webkit-box-orient: vertical; 219 | display: block; 220 | display: -webkit-box; 221 | overflow: hidden !important; 222 | text-overflow: ellipsis; 223 | -webkit-line-clamp: 3; 224 | } 225 | 226 | #animeContainer>a>.label>.eps { 227 | font-size: 0.7rem; 228 | color: #ccc; 229 | } 230 | 231 | 232 | .fastsearchrow { 233 | display: flex; 234 | border-bottom: 1px solid #444; 235 | padding: 10px 30px; 236 | vertical-align: top; 237 | cursor: pointer; 238 | background-color: #222222; 239 | } 240 | 241 | .fastsearchrow a { 242 | color: #fff; 243 | text-decoration: none; 244 | } 245 | 246 | .fastsearchnotif { 247 | padding: 10px 50px 20px 50px; 248 | color: #999999; 249 | font-size: 0.8rem; 250 | justify-content: center; 251 | align-items: center; 252 | text-align: center; 253 | } 254 | 255 | h1.titleBig { 256 | color: #fff; 257 | display: flex; 258 | justify-content: center; 259 | margin: 50px 20px 40px 20px; 260 | text-align: center; 261 | } 262 | 263 | #resultContainer .row:nth-child(even), .fastsearchrow:nth-child(even) { 264 | background-color: #111; 265 | } 266 | 267 | #qualityContainer { 268 | display: inline; 269 | width: 100%; 270 | margin-bottom: 10px; 271 | } 272 | 273 | #qualityContainer span { 274 | padding: 0px; 275 | margin-right: 10px; 276 | background: none; 277 | text-transform: uppercase; 278 | font-size: 0.9em; 279 | font-weight: bold; 280 | } 281 | 282 | .pill-button { 283 | background-color: #333; 284 | color: #fff; 285 | border: none; 286 | padding: 5px 15px; 287 | font-size: 0.8rem; 288 | margin-right: 5px; 289 | margin-bottom: 10px; 290 | border-radius: 25px; 291 | cursor: pointer; 292 | display: inline-block; 293 | } 294 | 295 | #downloadButton { 296 | background-color: rgb(70, 79, 60); 297 | color: rgb(255, 255, 255); 298 | text-decoration: none; 299 | border: none; 300 | padding: 5px 15px; 301 | font-size: 0.8rem; 302 | margin-right: 5px; 303 | margin-bottom: 10px; 304 | border-radius: 25px; 305 | cursor: pointer; 306 | display: inline; 307 | } 308 | 309 | #serverSelect { 310 | display: inline; 311 | } 312 | 313 | #mainLoading { 314 | width: 100%; 315 | background-color: #222; 316 | display: flex; 317 | align-items: center; 318 | justify-content: center; 319 | padding: 10px 0px 20px 0px; 320 | } 321 | 322 | .modern-footer { 323 | background-color: #333; 324 | color: #fff; 325 | text-align: center; 326 | padding: 20px 0; 327 | font-size: 0.7rem; 328 | } 329 | 330 | .notif { 331 | background-color: #2E3829; 332 | color: #fff; 333 | text-align: center; 334 | padding: 10px 10px; 335 | font-size: 0.7rem; 336 | border-top: 1px solid #6A9169; 337 | border-bottom: 1px solid #6A9169; 338 | } 339 | 340 | .notif a { 341 | text-decoration: none; 342 | background-color: #6A9169; 343 | color: #2E3829; 344 | padding: 0px 5px; 345 | border-radius: 5px; 346 | margin-left: 5px; 347 | font-weight: bold; 348 | } 349 | 350 | .modern-footer .footer { 351 | display: flex; 352 | justify-content: center; 353 | align-items: center; 354 | height: 100%; 355 | } 356 | 357 | .footer a { 358 | color: #fff; 359 | text-decoration: none; 360 | font-weight: bold; 361 | margin: 0px 5px; 362 | cursor: pointer; 363 | } 364 | 365 | .counterDiv { 366 | background-color: rgb(16, 12, 12); 367 | display: flex; 368 | justify-content: center; 369 | align-items: center; 370 | height: 100%; 371 | margin: 0 auto; 372 | width: 100%; 373 | padding: 10px 0px 0px 0px; 374 | } 375 | 376 | .counterDiv img { 377 | filter: invert(); 378 | transform: scale(0.3); 379 | } 380 | 381 | .recent-button { 382 | background-color: #1d1d1d; 383 | color: #fff; 384 | font-weight: bold; 385 | border: 0; 386 | width: 100%; 387 | padding: 20px 20px; 388 | border-radius: 5px; 389 | margin-top: -10px; 390 | } 391 | 392 | img { 393 | display: none; 394 | } 395 | 396 | .container img { 397 | display: block !important; 398 | } 399 | 400 | .app-container { 401 | display: flex; 402 | flex-direction: column; 403 | justify-content: center; 404 | align-items: center; 405 | padding: 40px 20px 20px 20px; 406 | background-color: #222222; 407 | color: #fff; 408 | 409 | } 410 | 411 | .app-container a { 412 | display: block; 413 | background-color: #32B4FE; 414 | padding: 5px 10px; 415 | border-radius: 5px; 416 | color: #fff; 417 | text-decoration: none; 418 | font-weight: bold; 419 | margin: 10px 0px 0px 0px; 420 | } 421 | 422 | .app-container a#windows { 423 | background-color: #6A9169; 424 | } 425 | 426 | .app-container a:hover { 427 | opacity: 0.9; 428 | } 429 | 430 | .app-container span { 431 | margin: 20px 30px 0px 30px; 432 | color: #999999; 433 | font-size: 12px; 434 | text-align: center; 435 | } 436 | 437 | .extraBtn { 438 | display: flex; 439 | justify-content: space-around; 440 | gap: 0.4rem; 441 | margin-bottom: 1rem; 442 | } 443 | 444 | .extraBtn button { 445 | flex: 1; 446 | padding: 0.3rem; 447 | background-color: #333; 448 | color: #fff; 449 | border: 0; 450 | border-radius: 30px; 451 | height: 30px; 452 | cursor: pointer; 453 | } 454 | 455 | #dim { 456 | position: absolute; 457 | display: flex; 458 | justify-content: center; 459 | align-items: center; 460 | width: 100%; 461 | height: 100vh; 462 | z-index: 1; 463 | background-color: rgba(0, 0, 0, .8); 464 | } 465 | 466 | 467 | .history { 468 | position: absolute; 469 | background-color: #222; 470 | max-width: 480px; 471 | margin: 0px 20px; 472 | padding: 10px 20px; 473 | border-radius: 10px; 474 | color: #fff; 475 | box-shadow: 3px 3px 3px #111; 476 | } 477 | 478 | .historyHead { 479 | display: flex; 480 | margin-bottom: 10px; 481 | } 482 | 483 | .historyHead h3 { 484 | flex: 1; 485 | } 486 | 487 | .historyHead button { 488 | background-color: #6A9169; 489 | color: #fff; 490 | border: 0; 491 | padding: 5px 10px; 492 | border-radius: 5px; 493 | } 494 | 495 | .historyList { 496 | list-style: '- '; 497 | padding-left: 20px; 498 | } 499 | 500 | .historyList .date { 501 | color: #8B8B8B; 502 | font-size: small; 503 | } 504 | 505 | .historyList a { 506 | color: #ccc; 507 | text-decoration: none; 508 | } 509 | 510 | 511 | .historyList a:hover { 512 | color: #fff; 513 | } 514 | 515 | p.historyDetail { 516 | color: #b7b7b7; 517 | padding: 10px 0px; 518 | font-size: small; 519 | } 520 | 521 | p.historyDetail a { 522 | color: #fff; 523 | cursor: pointer; 524 | } 525 | 526 | 527 | @media screen and (max-width: 768px) { 528 | .video-title { 529 | font-size: 1rem; 530 | } 531 | 532 | #animeContainer { 533 | display: grid; 534 | gap: 0.5rem; 535 | grid-template-columns: repeat(2, 49.555%); 536 | 537 | } 538 | 539 | #animeContainer>a { 540 | display: flex; 541 | gap: 0.5rem; 542 | padding-right: 0rem; 543 | flex-direction: column; 544 | } 545 | 546 | #animeContainer>a>img { 547 | width: 100%; 548 | object-fit: cover; 549 | border-radius: 0.2rem; 550 | border-bottom-right-radius: 0px; 551 | border-bottom-left-radius: 0px; 552 | } 553 | 554 | 555 | #animeContainer>a>.label { 556 | display: flex; 557 | flex-direction: column; 558 | align-self: flex-start; 559 | overflow: hidden; 560 | padding: 0px 0px 10px 10px; 561 | } 562 | } 563 | 564 | #watchingContainer { 565 | font-size: 20px; 566 | position: absolute; 567 | background-color: black; 568 | color: white; 569 | padding: 10px; 570 | z-index: 1; 571 | display: none; 572 | left: 50%; 573 | transform: translateX(-50%); 574 | 575 | } -------------------------------------------------------------------------------- /script.js: -------------------------------------------------------------------------------- 1 | const queryInput = document.getElementById("queryInput"); 2 | const homeBtn = document.getElementById("homeBtn"); 3 | const searchBtn = document.getElementById("searchBtn"); 4 | const recentBtn = document.getElementById("recentBtn"); 5 | const resultContainer = document.getElementById("animeContainer"); 6 | const sresultContainer = document.querySelector(".container-sresult"); 7 | 8 | const animeInfoContainer = document.getElementById("animeInfoContainer"); 9 | const watchContainer = document.getElementById("qualityContainer"); 10 | const mainLoading = document.getElementById("mainLoading"); 11 | const pageTitle = document.getElementById("title"); 12 | const videoPlayer = document.getElementById("player") 13 | const watchBtn = document.getElementById("episodeButton"); 14 | 15 | var dataTitle; 16 | var dataEpisode; 17 | var dataURL; 18 | 19 | const apiEndpoint = "api.consumet.org"; 20 | 21 | // Randomly set player iframes to these video onLoad 22 | var youtubeLinks = [ 23 | "https://www.youtube.com/embed/3yOVIxOHiaw", 24 | "https://www.youtube.com/embed/nfAPAvGGH4g", 25 | "https://www.youtube.com/embed/S7W135mNveI", 26 | "https://www.youtube.com/embed/X1M69l7ZGlw", 27 | "https://www.youtube.com/embed/IUtFAblCT1o", 28 | "https://www.youtube.com/embed/Wi6tTATXnaw", 29 | "https://www.youtube.com/embed/5xkzzO5nNow", 30 | "https://www.youtube.com/embed/PgAswqBtrUk", 31 | "https://www.youtube.com/embed/uwwU55zBYlQ" 32 | ]; 33 | var randomLink = youtubeLinks[Math.floor(Math.random() * youtubeLinks.length)]; 34 | videoPlayer.src = randomLink; 35 | 36 | // Check URL parameters 37 | function updateUrl(newUrl) { 38 | window.history.pushState({}, '', newUrl); 39 | } 40 | 41 | // Check if the site is visited using android app 42 | const urlParams = new URLSearchParams(window.location.search); 43 | let appParam = urlParams.get('app'); 44 | if (appParam == 'true') { 45 | const playerContainer = document.getElementById("playerContainer"); 46 | playerContainer.style.display = "none"; 47 | 48 | const footerContainer = document.getElementById("footerContainer"); 49 | footerContainer.style.display = "none"; 50 | } 51 | 52 | // Detect if searchBtn is clicked 53 | searchBtn.addEventListener("click", async function () { 54 | animeInfoContainer.style.display = `none`; 55 | sresultContainer.style.display = `flex`; 56 | resultContainer.style.display = `grid`; 57 | mainLoading.style.display = "flex"; 58 | pageTitle.innerHTML = `astream - watch anime` 59 | recentBtn.style.display = "none"; 60 | resultContainer.innerHTML = ""; 61 | 62 | updateUrl(`/`); 63 | 64 | const query = queryInput.value; 65 | const res = await fetch(`https://${apiEndpoint}/anime/gogoanime/${query}?page=1`); 66 | const data = await res.json(); 67 | displayResults(data.results); 68 | }); 69 | 70 | // Confirm search by using an ENTER button 71 | async function getSearchByEnter(event) { 72 | if (event.keyCode === 13) { 73 | animeInfoContainer.style.display = `none`; 74 | sresultContainer.style.display = `flex`; 75 | resultContainer.style.display = `grid`; 76 | mainLoading.style.display = "flex"; 77 | pageTitle.innerHTML = `astream - watch anime` 78 | recentBtn.style.display = "none"; 79 | resultContainer.innerHTML = ""; 80 | 81 | updateUrl(`/`); 82 | 83 | const query = queryInput.value; 84 | const res = await fetch(`https://${apiEndpoint}/anime/gogoanime/${query}?page=1`); 85 | const data = await res.json(); 86 | displayResults(data.results); 87 | } 88 | } 89 | 90 | // Detect if homeBtn is clicked 91 | homeBtn.addEventListener("click", function () { 92 | if (appParam == 'true') { 93 | window.location.href = "/?app=true"; 94 | } else { 95 | window.location.href = "/"; 96 | } 97 | }); 98 | 99 | 100 | // Detect if recentBtn is clicked 101 | recentBtn.addEventListener("click", async function () { 102 | sresultContainer.style.display = `flex`; 103 | resultContainer.style.display = `grid`; 104 | mainLoading.style.display = "flex"; 105 | recentBtn.style.display = "none"; 106 | 107 | const res = await fetch(`https://${apiEndpoint}/anime/gogoanime/recent-episodes`); 108 | const data = await res.json(); 109 | displayRecent(data.results); 110 | }); 111 | 112 | 113 | // Display Recent Result 114 | function displayRecent(results) { 115 | sresultContainer.style.display = `flex`; 116 | resultContainer.innerHTML = ""; 117 | mainLoading.style.display = "none"; 118 | 119 | results.forEach(result => { 120 | const resultDiv = document.createElement("a"); 121 | subType = `
SUB
`; 122 | episodeNumber = `${result.episodeNumber}`; 123 | if (!episodeNumber.length) { 124 | episodeNumber = '???'; 125 | } 126 | 127 | resultDiv.innerHTML = ` 128 | 129 |
130 | ${result.title.replace("(Dub)", "")} 131 | Episode ${episodeNumber} (Subbed) 132 |
133 | `; 134 | 135 | resultDiv.addEventListener("click", async function () { 136 | mainLoading.style.display = "flex"; 137 | resultContainer.style.display = `none`; 138 | 139 | updateUrl(`/?anime=${result.id}`); 140 | dataURL = `${result.id}` 141 | 142 | const res = await fetch(`https://${apiEndpoint}/anime/gogoanime/info/${result.id}`); 143 | const data = await res.json(); 144 | displayAnimeInfo(data); 145 | }); 146 | resultContainer.appendChild(resultDiv); 147 | }); 148 | } 149 | 150 | // Display Search Result 151 | function displayResults(results) { 152 | resultContainer.innerHTML = ""; 153 | sresultContainer.style.display = `flex`; 154 | mainLoading.style.display = "none"; 155 | 156 | results.forEach(result => { 157 | const resultDiv = document.createElement("a"); 158 | subType = `
${result.subOrDub}
`; 159 | releaseDate = `${result.releaseDate.replace("Released: ", "")}`; 160 | if (!releaseDate.length) { 161 | releaseDate = '???'; 162 | } 163 | resultDiv.innerHTML = ` 164 | 165 |
166 | ${result.title.replace("(Dub)", "")} 167 | Year ${releaseDate} (${result.subOrDub.charAt(0).toUpperCase() + result.subOrDub.slice(1)}bed) 168 |
169 | `; 170 | 171 | resultDiv.addEventListener("click", async function () { 172 | mainLoading.style.display = "flex"; 173 | resultContainer.style.display = `none`; 174 | 175 | updateUrl(`/?anime=${result.id}`); 176 | dataURL = `${result.id}` 177 | 178 | const res = await fetch(`https://${apiEndpoint}/anime/gogoanime/info/${result.id}`); 179 | const data = await res.json(); 180 | displayAnimeInfo(data); 181 | }); 182 | resultContainer.appendChild(resultDiv); 183 | }); 184 | } 185 | 186 | //Check if theres Anime Parameters 187 | let animeParam = urlParams.get('anime'); 188 | fetchAnimeInfo() 189 | async function fetchAnimeInfo() { 190 | if (typeof animeParam !== 'undefined' && animeParam !== null) { 191 | recentBtn.style.display = "none"; 192 | mainLoading.style.display = "flex"; 193 | 194 | dataURL = `${animeParam}` 195 | 196 | const res = await fetch(`https://${apiEndpoint}/anime/gogoanime/info/${animeParam}`); 197 | const data = await res.json(); 198 | displayAnimeInfo(data); 199 | } 200 | } 201 | 202 | 203 | // Display Anime Info 204 | function displayAnimeInfo(data) { 205 | animeInfoContainer.style.display = `block`; 206 | resultContainer.style.display = `none`; 207 | sresultContainer.style.display = `none`; 208 | watchContainer.style.display = "none"; 209 | mainLoading.style.display = "none"; 210 | 211 | const title = document.getElementById("videoTitle"); 212 | title.innerHTML = `${data.title}`; 213 | dataTitle = `${data.title}`; 214 | pageTitle.innerHTML = `${data.title.toLowerCase()} - astream` 215 | 216 | const status = document.getElementById("status"); 217 | status.innerHTML = `${data.status}`; 218 | 219 | const subordub = document.getElementById("subordub"); 220 | subordub.innerHTML = `${data.subOrDub}`; 221 | 222 | const type = document.getElementById("type"); 223 | type.innerHTML = `${data.type}`; 224 | 225 | const description = document.getElementById("videoDescription"); 226 | description.innerHTML = `${data.description.replace("\n", "

")}`; 227 | 228 | const episodeSelect = document.getElementById("selectElement"); 229 | episodeSelect.innerHTML = ""; 230 | 231 | data.episodes.sort((a, b) => b.number - a.number); 232 | data.episodes.forEach((episode) => { 233 | const option = document.createElement("option"); 234 | option.value = episode.id; 235 | option.innerHTML = `Episode ${episode.number}`; 236 | episodeSelect.appendChild(option); 237 | }); 238 | 239 | watchBtn.addEventListener("click", async function () { 240 | const serverSelect = document.getElementById("serverSelect"); 241 | serverSelect.innerHTML = ""; 242 | watchContainer.style.display = "none"; 243 | mainLoading.style.display = "flex"; 244 | 245 | var selectElement = document.getElementById("selectElement"); 246 | var selectedOption = selectElement.options[selectElement.selectedIndex]; 247 | dataEpisode = selectedOption.innerText; 248 | addHistory(); 249 | 250 | const episodeId = document.getElementById("selectElement").value; 251 | const res = await fetch(`https://${apiEndpoint}/anime/gogoanime/watch/${episodeId}`); 252 | const episodeData = await res.json(); 253 | displayWatchInfo(episodeData); 254 | }); 255 | } 256 | 257 | // Display Episode List 258 | function displayWatchInfo(episodeData) { 259 | watchContainer.style.display = "block"; 260 | mainLoading.style.display = "none"; 261 | 262 | const download_button = document.getElementById("downloadButton"); 263 | download_button.href = episodeData.download; 264 | 265 | const serverSelect = document.getElementById("serverSelect"); 266 | serverSelect.innerHTML = ""; 267 | episodeData.sources.forEach((stream) => { 268 | const option = document.createElement("button"); 269 | option.value = stream.url; 270 | option.className = "pill-button"; 271 | let streamquality = stream.quality.replace("default", "auto"); 272 | option.innerHTML = `${streamquality}`; 273 | serverSelect.appendChild(option); 274 | }); 275 | 276 | const resoBtn = document.querySelectorAll(".pill-button"); 277 | for (let i = 0; i < resoBtn.length; i++) { 278 | resoBtn[i].addEventListener("click", function () { 279 | const serverUrl = this.value; 280 | let proxyweb = 'https://cute-cyan-millipede-coat.cyclic.app/' 281 | // let selectedServer = serverUrl.replace('https://', ''); 282 | // selectedServer = selectedServer.replace('http://', ''); 283 | let selectedServer = serverUrl; 284 | 285 | if (appParam == 'true') { 286 | updateUrl(`?playInApp=${selectedServer}`); 287 | } else { 288 | videoPlayer.src = `/player/?url=${selectedServer}`; 289 | } 290 | }); 291 | }; 292 | } 293 | 294 | // Donate Alert 295 | const spanElement = document.getElementById("spanDonate"); 296 | let contentDonate = [ 297 | "Support this website by making a donation starting from 1$!DONATE", 298 | "Dukung website ini dengan cara berdonasi mulai dari Rp1000!DONASI" 299 | ]; 300 | let indexDonate = 0; 301 | setInterval(function () { 302 | spanElement.innerHTML = contentDonate[indexDonate]; 303 | indexDonate = (indexDonate + 1) % contentDonate.length; 304 | }, 5000); 305 | 306 | // Format unicode date to a readable one (** hours ago) 307 | function getTimeDifference(date) { 308 | const currentDate = new Date(); 309 | const timestamp = new Date(date); 310 | const difference = currentDate - timestamp; 311 | 312 | const seconds = Math.floor(difference / 1000); 313 | const minutes = Math.floor(seconds / 60); 314 | const hours = Math.floor(minutes / 60); 315 | const days = Math.floor(hours / 24); 316 | const weeks = Math.floor(days / 7); 317 | const months = Math.floor(days / 30); 318 | const years = Math.floor(days / 365); 319 | 320 | let output; 321 | if (seconds < 60) { 322 | output = `${seconds} second${seconds === 1 ? '' : 's'} ago`; 323 | } else if (minutes < 60) { 324 | output = `${minutes} minute${minutes === 1 ? '' : 's'} ago`; 325 | } else if (hours < 24) { 326 | output = `${hours} hour${hours === 1 ? '' : 's'} ago`; 327 | } else if (days < 7) { 328 | output = `${days} day${days === 1 ? '' : 's'} ago`; 329 | } else if (weeks < 4) { 330 | output = `${weeks} week${weeks === 1 ? '' : 's'} ago`; 331 | } else if (months < 12) { 332 | output = `${months} month${months === 1 ? '' : 's'} ago`; 333 | } else { 334 | output = `${years} year${years === 1 ? '' : 's'} ago`; 335 | } 336 | 337 | return output; 338 | } 339 | 340 | // Eps Button Navigation 341 | const epsSelect = document.getElementById('selectElement'); 342 | function firstEps() { 343 | epsSelect.selectedIndex = epsSelect.options.length - 1; 344 | } 345 | function prevEps() { 346 | if (epsSelect.selectedIndex < epsSelect.options.length - 1) { 347 | epsSelect.selectedIndex++; 348 | } 349 | } 350 | function nextEps() { 351 | if (epsSelect.selectedIndex > 0) { 352 | epsSelect.selectedIndex--; 353 | } 354 | } 355 | function lastEps() { 356 | epsSelect.selectedIndex = 0; 357 | } 358 | 359 | // Hiding the Dim 360 | function closeHistory() { 361 | let dimDiv = document.getElementById('dim'); 362 | dimDiv.style.display = 'none'; 363 | } 364 | closeHistory() 365 | 366 | function showHistory() { 367 | let dimDiv = document.getElementById('dim'); 368 | dimDiv.style.display = 'flex'; 369 | historyReload(); 370 | window.scrollTo({ 371 | top: 0, 372 | behavior: 'smooth' 373 | }); 374 | 375 | } 376 | 377 | 378 | // Adding a History 379 | function addHistory() { 380 | let newDate = new Date(); 381 | 382 | const notes = { 383 | date: newDate, 384 | title: dataTitle + ' ' + dataEpisode, 385 | url: dataURL 386 | } 387 | 388 | let local = JSON.parse(localStorage.getItem('history')); 389 | 390 | if (local == null) { 391 | const arr = []; 392 | arr.push(notes); 393 | localStorage.setItem('history', JSON.stringify(arr)) 394 | } else { 395 | // Check if the number of items in the array is already 50 396 | if (local.length >= 10) { 397 | // Remove the oldest item from the array 398 | local.shift(); 399 | } 400 | local.push(notes); 401 | localStorage.setItem('history', JSON.stringify(local)) 402 | } 403 | } 404 | 405 | // Reloading the history data 406 | const historyLists = document.getElementById('historyList'); 407 | var timedifference; 408 | function historyReload() { 409 | let array = JSON.parse(localStorage.getItem('history')); 410 | 411 | if (array != null) { 412 | historyLists.innerHTML = ""; 413 | for (let i = array.length - 1; i >= 0; i--) { 414 | timedifference = getTimeDifference(array[i].date) 415 | historyLists.innerHTML += ` 416 |
  • 417 | ${array[i].title} 418 | - ${timedifference} 419 |
  • ` 420 | } 421 | } else { 422 | historyLists.innerHTML = "History empty" 423 | } 424 | } 425 | 426 | historyReload(); 427 | 428 | // Clear History 429 | function clearHistory() { 430 | localStorage.removeItem('history'); 431 | historyReload(); 432 | } -------------------------------------------------------------------------------- /oplayer/oplayer.js: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | ; (function () { 3 | var danmakuScriptCdn = 'https://cdn.jsdelivr.net/npm/@oplayer/danmaku@latest/dist/index.min.js' 4 | 5 | var query = document.location.search.substring(1) 6 | var src, poster, subtitle, danmaku, watermark 7 | var playlist = [], 8 | deps = [], 9 | m3u = false, 10 | p = undefined, 11 | title = 'Watxh', 12 | txt = '' 13 | 14 | var _query = decodeURIComponent(query || '') 15 | if (_query.startsWith('http')) { 16 | // ?https://xx.com= 有时候会自动带上 “=” 17 | src = _query.endsWith('=') ? _query.substring(0, _query.length - 1) : query 18 | } else if (_query.endsWith('=')) { 19 | src = atob(_query) 20 | } else { 21 | var search = new URLSearchParams(document.location.search) 22 | src = safeDecodeURIComponent(search.get('src')) 23 | playlist = JSON.parse(safeDecodeURIComponent(search.get('playlist')) || '[]') 24 | poster = safeDecodeURIComponent(search.get('poster')) 25 | title = safeDecodeURIComponent(search.get('title')) || '❤OPlayer' 26 | danmaku = safeDecodeURIComponent(search.get('danmaku')) 27 | m3u = safeDecodeURIComponent(search.get('m3u')) 28 | p = search.has('p') ? search.get('p') : undefined 29 | p == '' ? (p = undefined) : (p = +p) 30 | txt = safeDecodeURIComponent(search.get('txt')) 31 | 32 | subtitle = search.get('subtitle') 33 | ? { 34 | source: [ 35 | { 36 | name: 'Default', 37 | default: true, 38 | src: decodeURIComponent(search.get('subtitle')) 39 | } 40 | ] 41 | } 42 | : undefined 43 | 44 | watermark = search.get('watermark') 45 | ? { 46 | src: decodeURIComponent(search.get('watermark')), 47 | style: { 48 | position: 'absolute', 49 | top: '10px', 50 | right: '10px', 51 | maxWidth: '200px', 52 | height: 'auto' 53 | } 54 | } 55 | : undefined 56 | } 57 | 58 | if (title && title != '❤OPlayer') document.title = title 59 | 60 | if (/m3u(#|\?|$)/i.test(src) || m3u) { 61 | playlist = [{ title: '-', src: typeof m3u == 'string' ? m3u : src, poster }] 62 | m3u = true 63 | src = undefined 64 | deps.push(['https://cdn.jsdelivr.net/npm/m3u8-parser@7.1.0/dist/m3u8-parser.min.js']) 65 | } 66 | 67 | if (txt) { 68 | fetch(txt) 69 | .then((r) => r.text()) 70 | .then((text) => { 71 | playlist = text.split('\n').map((line) => { 72 | const [title, src] = line.split(',') 73 | return { title, src: src } 74 | }) 75 | }) 76 | .then(applyPlaylist) 77 | .catch((e) => { 78 | player.emit('error', e) 79 | }) 80 | } 81 | 82 | var player = OPlayer.make('#oplayer', { 83 | source: { src, poster, title: title }, 84 | playbackRate: localStorage.getItem('@oplayer/UserPreferences/speed') || 1, 85 | volume: localStorage.getItem('@oplayer/UserPreferences/volume') || 1 86 | }) 87 | .use([ 88 | OUI({ 89 | theme: { 90 | watermark, 91 | controller: { 92 | header: { back: 'fullscreen' }, 93 | slideToSeek: 'always' 94 | } 95 | }, 96 | 97 | subtitle, 98 | pictureInPicture: true, 99 | keyboard: { global: true }, 100 | errorBuilder(e, t, builder) { 101 | builder({ 102 | ...e, 103 | message: 104 | (e.message ? `${e.message}\n\n` : '') + 105 | (e.code ? `ErrorCode:${e.code} \n\n` : '') + 106 | 'Open an issues https://github.com/shiyiya/oplayer/issues/new/choose' 107 | }) 108 | }, 109 | 110 | icons: { 111 | play: ` `, 112 | // play: ``, 113 | // pause: ``, 114 | volume: [ 115 | ``, 116 | `` 117 | ], 118 | fullscreen: [ 119 | ``, 120 | `` 121 | ], 122 | pip: [ 123 | ``, 124 | `` 125 | ], 126 | setting: ``, 127 | screenshot: ``, 128 | playbackRate: ``, 129 | loop: ``, 130 | loadingIndicator: ``, 131 | chromecast: `` 132 | } 133 | }), 134 | OHls({ 135 | forceHLS: true, 136 | library: 'https://cdn.jsdelivr.net/npm/hls.js@0.14.17/dist/hls.min.js' 137 | }), 138 | ODash({ library: 'https://cdn.dashjs.org/latest/dash.all.min.js' }), 139 | OMpegts({ library: 'https://cdn.jsdelivr.net/npm/mpegts.js/dist/mpegts.min.js' }), 140 | OTorrent({ library: 'https://cdn.jsdelivr.net/npm/webtorrent@0.98.18/webtorrent.min.js' }), 141 | new OPlugin.AirPlay(), 142 | new OPlugin.Chromecast() 143 | ]) 144 | .create() 145 | .on((e) => { 146 | if (e.type != 'timeupdate' || e.type != 'progress') { 147 | console.log(e) 148 | } 149 | }) 150 | 151 | if (danmaku || playlist.some((it) => it.danmaku)) { 152 | deps.push([ 153 | danmakuScriptCdn, 154 | () => { 155 | player.applyPlugin(ODanmaku({ source: danmaku })) 156 | } 157 | ]) 158 | } 159 | 160 | loadScripts(deps.map(([s]) => s)).then(() => { 161 | if (isNaN(p) || typeof p != 'number') { 162 | player.once('playlistchange', () => { 163 | setTimeout(() => { 164 | player.context.playlist.showUI() 165 | }) 166 | }) 167 | } 168 | 169 | try { 170 | deps.map(([_, fn]) => fn && fn()) 171 | } catch (error) { } 172 | 173 | applyPlaylist() 174 | }) 175 | 176 | function applyPlaylist() { 177 | if (playlist.length) { 178 | player.applyPlugin( 179 | new OPlugin.Playlist({ 180 | initialIndex: p, 181 | autoHide: false, 182 | sources: playlist, 183 | m3uList: m3u 184 | ? { 185 | sourceFormat(info) { 186 | try { 187 | const chunk = info.title.substring(3).split('" ') 188 | const titleWith = /group-title="(.+",.+)/.exec(info.title) 189 | const posterWith = /tvg-logo="(.+)"/.exec(info.title) 190 | return { 191 | src: info.uri, 192 | format: 'm3u8', 193 | title: titleWith ? titleWith[1] : /group-title="(.+)"/.exec(info.title)[1], 194 | poster: posterWith && posterWith[1] 195 | } 196 | } catch (error) { 197 | return { src: info.uri, title: info.title, format: 'm3u8' } 198 | } 199 | } 200 | } 201 | : false 202 | }) 203 | ) 204 | } 205 | } 206 | 207 | player.on('ratechange', () => { 208 | if (!player.isSourceChanging) 209 | localStorage.setItem('@oplayer/UserPreferences/speed', player.playbackRate.toString()) 210 | }) 211 | 212 | player.on('volumechange', () => { 213 | localStorage.setItem('@oplayer/UserPreferences/volume', player.volume.toString()) 214 | }) 215 | 216 | function keepTime(e) { 217 | document.title = e.payload.title 218 | var prevTime = localStorage.getItem(e.payload.src) 219 | if (prevTime) { 220 | player.once('loadedmetadata', () => { 221 | player.seek(prevTime - 1) 222 | }) 223 | } 224 | } 225 | player.on('videosourcechange', keepTime) 226 | if (src) { 227 | keepTime({ payload: { src, title } }) 228 | } 229 | 230 | player.on('timeupdate', () => { 231 | localStorage.setItem(player.options.source.src, player.currentTime.toString()) 232 | }) 233 | 234 | new Promise(() => { 235 | // https://stackoverflow.com/questions/6370690/media-queries-how-to-target-desktop-tablet-and-mobile 236 | var $op = document.querySelector('#oplayer') 237 | // not in iframe 238 | if (window.self == window.top && $op.clientWidth > 761) { 239 | $op.firstElementChild.children[1].style.fontSize = $op.clientWidth > 1024 ? '24px' : '22px' 240 | } 241 | }) 242 | 243 | function loadScripts(scripts) { 244 | return Promise.all( 245 | scripts.map((s) => { 246 | return new Promise((r, f) => { 247 | var t = document.body.appendChild(document.createElement('script')) 248 | t.src = s 249 | t.onload = r 250 | t.onerror = f 251 | }) 252 | }) 253 | ) 254 | } 255 | 256 | function safeDecodeURIComponent(uri) { 257 | return uri ? decodeURIComponent(uri) : undefined 258 | } 259 | })() 260 | -------------------------------------------------------------------------------- /player/plyr.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @keyframes plyr-progress { 4 | to { 5 | background-position: 25px 0; 6 | background-position: var(--plyr-progress-loading-size, 25px) 0 7 | } 8 | } 9 | 10 | @keyframes plyr-popup { 11 | 0% { 12 | opacity: .5; 13 | transform: translateY(10px) 14 | } 15 | 16 | to { 17 | opacity: 1; 18 | transform: translateY(0) 19 | } 20 | } 21 | 22 | @keyframes plyr-fade-in { 23 | 0% { 24 | opacity: 0 25 | } 26 | 27 | to { 28 | opacity: 1 29 | } 30 | } 31 | 32 | .plyr { 33 | -moz-osx-font-smoothing: grayscale; 34 | -webkit-font-smoothing: antialiased; 35 | align-items: center; 36 | direction: ltr; 37 | display: flex; 38 | flex-direction: column; 39 | font-family: inherit; 40 | font-family: var(--plyr-font-family, inherit); 41 | font-variant-numeric: tabular-nums; 42 | font-weight: 400; 43 | font-weight: var(--plyr-font-weight-regular, 400); 44 | line-height: 1.7; 45 | line-height: var(--plyr-line-height, 1.7); 46 | max-width: 100%; 47 | min-width: 200px; 48 | position: relative; 49 | text-shadow: none; 50 | transition: box-shadow .3s ease; 51 | z-index: 0 52 | } 53 | 54 | .plyr audio, .plyr iframe, .plyr video { 55 | display: block; 56 | height: 100%; 57 | width: 100% 58 | } 59 | 60 | .plyr button { 61 | font: inherit; 62 | line-height: inherit; 63 | width: auto 64 | } 65 | 66 | .plyr:focus { 67 | outline: 0 68 | } 69 | 70 | .plyr--full-ui { 71 | box-sizing: border-box 72 | } 73 | 74 | .plyr--full-ui *, .plyr--full-ui :after, .plyr--full-ui :before { 75 | box-sizing: inherit 76 | } 77 | 78 | .plyr--full-ui a, .plyr--full-ui button, .plyr--full-ui input, .plyr--full-ui label { 79 | touch-action: manipulation 80 | } 81 | 82 | .plyr__badge { 83 | background: #4a5464; 84 | background: var(--plyr-badge-background, #4a5464); 85 | border-radius: 2px; 86 | border-radius: var(--plyr-badge-border-radius, 2px); 87 | color: #fff; 88 | color: var(--plyr-badge-text-color, #fff); 89 | font-size: 9px; 90 | font-size: var(--plyr-font-size-badge, 9px); 91 | line-height: 1; 92 | padding: 3px 4px 93 | } 94 | 95 | .plyr--full-ui ::-webkit-media-text-track-container { 96 | display: none 97 | } 98 | 99 | .plyr__captions { 100 | animation: plyr-fade-in .3s ease; 101 | bottom: 0; 102 | display: none; 103 | font-size: 13px; 104 | font-size: var(--plyr-font-size-small, 13px); 105 | left: 0; 106 | padding: 10px; 107 | padding: var(--plyr-control-spacing, 10px); 108 | position: absolute; 109 | text-align: center; 110 | transition: transform .4s ease-in-out; 111 | width: 100% 112 | } 113 | 114 | .plyr__captions span:empty { 115 | display: none 116 | } 117 | 118 | @media (min-width:480px) { 119 | .plyr__captions { 120 | font-size: 15px; 121 | font-size: var(--plyr-font-size-base, 15px); 122 | padding: 20px; 123 | padding: calc(var(--plyr-control-spacing, 10px)*2) 124 | } 125 | } 126 | 127 | @media (min-width:768px) { 128 | .plyr__captions { 129 | font-size: 18px; 130 | font-size: var(--plyr-font-size-large, 18px) 131 | } 132 | } 133 | 134 | .plyr--captions-active .plyr__captions { 135 | display: block 136 | } 137 | 138 | .plyr:not(.plyr--hide-controls) .plyr__controls:not(:empty)~.plyr__captions { 139 | transform: translateY(-40px); 140 | transform: translateY(calc(var(--plyr-control-spacing, 10px)*-4)) 141 | } 142 | 143 | .plyr__caption { 144 | background: rgba(0, 0, 0, .8); 145 | background: var(--plyr-captions-background, rgba(0, 0, 0, .8)); 146 | border-radius: 2px; 147 | -webkit-box-decoration-break: clone; 148 | box-decoration-break: clone; 149 | color: #fff; 150 | color: var(--plyr-captions-text-color, #fff); 151 | line-height: 185%; 152 | padding: .2em .5em; 153 | white-space: pre-wrap 154 | } 155 | 156 | .plyr__caption div { 157 | display: inline 158 | } 159 | 160 | .plyr__control { 161 | background: transparent; 162 | border: 0; 163 | border-radius: 3px; 164 | border-radius: var(--plyr-control-radius, 3px); 165 | color: inherit; 166 | cursor: pointer; 167 | flex-shrink: 0; 168 | overflow: visible; 169 | padding: 7px; 170 | padding: calc(var(--plyr-control-spacing, 10px)*.7); 171 | position: relative; 172 | transition: all .3s ease 173 | } 174 | 175 | .plyr__control svg { 176 | fill: currentColor; 177 | display: block; 178 | height: 18px; 179 | height: var(--plyr-control-icon-size, 18px); 180 | pointer-events: none; 181 | width: 18px; 182 | width: var(--plyr-control-icon-size, 18px) 183 | } 184 | 185 | .plyr__control:focus { 186 | outline: 0 187 | } 188 | 189 | .plyr__control.plyr__tab-focus { 190 | outline: 3px dotted #00b2ff; 191 | outline: var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, #00b2ff))) dotted 3px; 192 | outline-offset: 2px 193 | } 194 | 195 | a.plyr__control { 196 | text-decoration: none 197 | } 198 | 199 | .plyr__control.plyr__control--pressed .icon--not-pressed, .plyr__control.plyr__control--pressed .label--not-pressed, .plyr__control:not(.plyr__control--pressed) .icon--pressed, .plyr__control:not(.plyr__control--pressed) .label--pressed, a.plyr__control:after, a.plyr__control:before { 200 | display: none 201 | } 202 | 203 | .plyr--full-ui ::-webkit-media-controls { 204 | display: none 205 | } 206 | 207 | .plyr__controls { 208 | align-items: center; 209 | display: flex; 210 | justify-content: flex-end; 211 | text-align: center 212 | } 213 | 214 | .plyr__controls .plyr__progress__container { 215 | flex: 1; 216 | min-width: 0 217 | } 218 | 219 | .plyr__controls .plyr__controls__item { 220 | margin-left: 2.5px; 221 | margin-left: calc(var(--plyr-control-spacing, 10px)/4) 222 | } 223 | 224 | .plyr__controls .plyr__controls__item:first-child { 225 | margin-left: 0; 226 | margin-right: auto 227 | } 228 | 229 | .plyr__controls .plyr__controls__item.plyr__progress__container { 230 | padding-left: 2.5px; 231 | padding-left: calc(var(--plyr-control-spacing, 10px)/4) 232 | } 233 | 234 | .plyr__controls .plyr__controls__item.plyr__time { 235 | padding: 0 5px; 236 | padding: 0 calc(var(--plyr-control-spacing, 10px)/2) 237 | } 238 | 239 | .plyr__controls .plyr__controls__item.plyr__progress__container:first-child, .plyr__controls .plyr__controls__item.plyr__time+.plyr__time, .plyr__controls .plyr__controls__item.plyr__time:first-child { 240 | padding-left: 0 241 | } 242 | 243 | .plyr [data-plyr=airplay], .plyr [data-plyr=captions], .plyr [data-plyr=fullscreen], .plyr [data-plyr=pip], .plyr__controls:empty { 244 | display: none 245 | } 246 | 247 | .plyr--airplay-supported [data-plyr=airplay], .plyr--captions-enabled [data-plyr=captions], .plyr--fullscreen-enabled [data-plyr=fullscreen], .plyr--pip-supported [data-plyr=pip] { 248 | display: inline-block 249 | } 250 | 251 | .plyr__menu { 252 | display: flex; 253 | position: relative 254 | } 255 | 256 | .plyr__menu .plyr__control svg { 257 | transition: transform .3s ease 258 | } 259 | 260 | .plyr__menu .plyr__control[aria-expanded=true] svg { 261 | transform: rotate(90deg) 262 | } 263 | 264 | .plyr__menu .plyr__control[aria-expanded=true] .plyr__tooltip { 265 | display: none 266 | } 267 | 268 | .plyr__menu__container { 269 | animation: plyr-popup .2s ease; 270 | background: hsla(0, 0%, 100%, .9); 271 | background: var(--plyr-menu-background, hsla(0, 0%, 100%, .9)); 272 | border-radius: 4px; 273 | border-radius: var(--plyr-menu-radius, 4px); 274 | bottom: 100%; 275 | box-shadow: 0 1px 2px rgba(0, 0, 0, .15); 276 | box-shadow: var(--plyr-menu-shadow, 0 1px 2px rgba(0, 0, 0, .15)); 277 | color: #4a5464; 278 | color: var(--plyr-menu-color, #4a5464); 279 | font-size: 15px; 280 | font-size: var(--plyr-font-size-base, 15px); 281 | margin-bottom: 10px; 282 | position: absolute; 283 | right: -3px; 284 | text-align: left; 285 | white-space: nowrap; 286 | z-index: 3 287 | } 288 | 289 | .plyr__menu__container>div { 290 | overflow: hidden; 291 | transition: height .35s cubic-bezier(.4, 0, .2, 1), width .35s cubic-bezier(.4, 0, .2, 1) 292 | } 293 | 294 | .plyr__menu__container:after { 295 | border: 4px solid transparent; 296 | border-top-color: hsla(0, 0%, 100%, .9); 297 | border: var(--plyr-menu-arrow-size, 4px) solid transparent; 298 | border-top-color: var(--plyr-menu-background, hsla(0, 0%, 100%, .9)); 299 | content: ""; 300 | height: 0; 301 | position: absolute; 302 | right: 14px; 303 | right: calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7 - var(--plyr-menu-arrow-size, 4px)/2); 304 | top: 100%; 305 | width: 0 306 | } 307 | 308 | .plyr__menu__container [role=menu] { 309 | padding: 7px; 310 | padding: calc(var(--plyr-control-spacing, 10px)*.7) 311 | } 312 | 313 | .plyr__menu__container [role=menuitem], .plyr__menu__container [role=menuitemradio] { 314 | margin-top: 2px 315 | } 316 | 317 | .plyr__menu__container [role=menuitem]:first-child, .plyr__menu__container [role=menuitemradio]:first-child { 318 | margin-top: 0 319 | } 320 | 321 | .plyr__menu__container .plyr__control { 322 | align-items: center; 323 | color: #4a5464; 324 | color: var(--plyr-menu-color, #4a5464); 325 | display: flex; 326 | font-size: 13px; 327 | font-size: var(--plyr-font-size-menu, var(--plyr-font-size-small, 13px)); 328 | padding: 4.66667px 10.5px; 329 | padding: calc(var(--plyr-control-spacing, 10px)*.7/1.5) calc(var(--plyr-control-spacing, 10px)*.7*1.5); 330 | -webkit-user-select: none; 331 | user-select: none; 332 | width: 100% 333 | } 334 | 335 | .plyr__menu__container .plyr__control>span { 336 | align-items: inherit; 337 | display: flex; 338 | width: 100% 339 | } 340 | 341 | .plyr__menu__container .plyr__control:after { 342 | border: 4px solid transparent; 343 | border: var(--plyr-menu-item-arrow-size, 4px) solid transparent; 344 | content: ""; 345 | position: absolute; 346 | top: 50%; 347 | transform: translateY(-50%) 348 | } 349 | 350 | .plyr__menu__container .plyr__control--forward { 351 | padding-right: 28px; 352 | padding-right: calc(var(--plyr-control-spacing, 10px)*.7*4) 353 | } 354 | 355 | .plyr__menu__container .plyr__control--forward:after { 356 | border-left-color: #728197; 357 | border-left-color: var(--plyr-menu-arrow-color, #728197); 358 | right: 6.5px; 359 | right: calc(var(--plyr-control-spacing, 10px)*.7*1.5 - var(--plyr-menu-item-arrow-size, 4px)) 360 | } 361 | 362 | .plyr__menu__container .plyr__control--forward.plyr__tab-focus:after, .plyr__menu__container .plyr__control--forward:hover:after { 363 | border-left-color: currentColor 364 | } 365 | 366 | .plyr__menu__container .plyr__control--back { 367 | font-weight: 400; 368 | font-weight: var(--plyr-font-weight-regular, 400); 369 | margin: 7px; 370 | margin: calc(var(--plyr-control-spacing, 10px)*.7); 371 | margin-bottom: 3.5px; 372 | margin-bottom: calc(var(--plyr-control-spacing, 10px)*.7/2); 373 | padding-left: 28px; 374 | padding-left: calc(var(--plyr-control-spacing, 10px)*.7*4); 375 | position: relative; 376 | width: calc(100% - 14px); 377 | width: calc(100% - var(--plyr-control-spacing, 10px)*.7*2) 378 | } 379 | 380 | .plyr__menu__container .plyr__control--back:after { 381 | border-right-color: #728197; 382 | border-right-color: var(--plyr-menu-arrow-color, #728197); 383 | left: 6.5px; 384 | left: calc(var(--plyr-control-spacing, 10px)*.7*1.5 - var(--plyr-menu-item-arrow-size, 4px)) 385 | } 386 | 387 | .plyr__menu__container .plyr__control--back:before { 388 | background: #dcdfe5; 389 | background: var(--plyr-menu-back-border-color, #dcdfe5); 390 | box-shadow: 0 1px 0 #fff; 391 | box-shadow: 0 1px 0 var(--plyr-menu-back-border-shadow-color, #fff); 392 | content: ""; 393 | height: 1px; 394 | left: 0; 395 | margin-top: 3.5px; 396 | margin-top: calc(var(--plyr-control-spacing, 10px)*.7/2); 397 | overflow: hidden; 398 | position: absolute; 399 | right: 0; 400 | top: 100% 401 | } 402 | 403 | .plyr__menu__container .plyr__control--back.plyr__tab-focus:after, .plyr__menu__container .plyr__control--back:hover:after { 404 | border-right-color: currentColor 405 | } 406 | 407 | .plyr__menu__container .plyr__control[role=menuitemradio] { 408 | padding-left: 7px; 409 | padding-left: calc(var(--plyr-control-spacing, 10px)*.7) 410 | } 411 | 412 | .plyr__menu__container .plyr__control[role=menuitemradio]:after, .plyr__menu__container .plyr__control[role=menuitemradio]:before { 413 | border-radius: 100% 414 | } 415 | 416 | .plyr__menu__container .plyr__control[role=menuitemradio]:before { 417 | background: rgba(0, 0, 0, .1); 418 | content: ""; 419 | display: block; 420 | flex-shrink: 0; 421 | height: 16px; 422 | margin-right: 10px; 423 | margin-right: var(--plyr-control-spacing, 10px); 424 | transition: all .3s ease; 425 | width: 16px 426 | } 427 | 428 | .plyr__menu__container .plyr__control[role=menuitemradio]:after { 429 | background: #fff; 430 | border: 0; 431 | height: 6px; 432 | left: 12px; 433 | opacity: 0; 434 | top: 50%; 435 | transform: translateY(-50%) scale(0); 436 | transition: transform .3s ease, opacity .3s ease; 437 | width: 6px 438 | } 439 | 440 | .plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:before { 441 | background: #00b2ff; 442 | background: var(--plyr-control-toggle-checked-background, var(--plyr-color-main, var(--plyr-color-main, #00b2ff))) 443 | } 444 | 445 | .plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:after { 446 | opacity: 1; 447 | transform: translateY(-50%) scale(1) 448 | } 449 | 450 | .plyr__menu__container .plyr__control[role=menuitemradio].plyr__tab-focus:before, .plyr__menu__container .plyr__control[role=menuitemradio]:hover:before { 451 | background: rgba(35, 40, 47, .1) 452 | } 453 | 454 | .plyr__menu__container .plyr__menu__value { 455 | align-items: center; 456 | display: flex; 457 | margin-left: auto; 458 | margin-right: -5px; 459 | margin-right: calc(var(--plyr-control-spacing, 10px)*.7*-1 - -2px); 460 | overflow: hidden; 461 | padding-left: 24.5px; 462 | padding-left: calc(var(--plyr-control-spacing, 10px)*.7*3.5); 463 | pointer-events: none 464 | } 465 | 466 | .plyr--full-ui input[type=range] { 467 | -webkit-appearance: none; 468 | appearance: none; 469 | background: transparent; 470 | border: 0; 471 | border-radius: 26px; 472 | border-radius: calc(var(--plyr-range-thumb-height, 13px)*2); 473 | color: #00b2ff; 474 | color: var(--plyr-range-fill-background, var(--plyr-color-main, var(--plyr-color-main, #00b2ff))); 475 | display: block; 476 | height: 19px; 477 | height: calc(var(--plyr-range-thumb-active-shadow-width, 3px)*2 + var(--plyr-range-thumb-height, 13px)); 478 | margin: 0; 479 | min-width: 0; 480 | padding: 0; 481 | transition: box-shadow .3s ease; 482 | width: 100% 483 | } 484 | 485 | .plyr--full-ui input[type=range]::-webkit-slider-runnable-track { 486 | background: transparent; 487 | background-image: linear-gradient(90deg, currentColor 0, transparent 0); 488 | background-image: linear-gradient(to right, currentColor var(--value, 0), transparent var(--value, 0)); 489 | border: 0; 490 | border-radius: 2.5px; 491 | border-radius: calc(var(--plyr-range-track-height, 5px)/2); 492 | height: 5px; 493 | height: var(--plyr-range-track-height, 5px); 494 | -webkit-transition: box-shadow .3s ease; 495 | transition: box-shadow .3s ease; 496 | -webkit-user-select: none; 497 | user-select: none 498 | } 499 | 500 | .plyr--full-ui input[type=range]::-webkit-slider-thumb { 501 | -webkit-appearance: none; 502 | appearance: none; 503 | background: #fff; 504 | background: var(--plyr-range-thumb-background, #fff); 505 | border: 0; 506 | border-radius: 100%; 507 | box-shadow: 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2); 508 | box-shadow: var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2)); 509 | height: 13px; 510 | height: var(--plyr-range-thumb-height, 13px); 511 | margin-top: -4px; 512 | margin-top: calc((var(--plyr-range-thumb-height, 13px) - var(--plyr-range-track-height, 5px))/2*-1); 513 | position: relative; 514 | -webkit-transition: all .2s ease; 515 | transition: all .2s ease; 516 | width: 13px; 517 | width: var(--plyr-range-thumb-height, 13px) 518 | } 519 | 520 | .plyr--full-ui input[type=range]::-moz-range-track { 521 | background: transparent; 522 | border: 0; 523 | border-radius: 2.5px; 524 | border-radius: calc(var(--plyr-range-track-height, 5px)/2); 525 | height: 5px; 526 | height: var(--plyr-range-track-height, 5px); 527 | -moz-transition: box-shadow .3s ease; 528 | transition: box-shadow .3s ease; 529 | user-select: none 530 | } 531 | 532 | .plyr--full-ui input[type=range]::-moz-range-thumb { 533 | background: #fff; 534 | background: var(--plyr-range-thumb-background, #fff); 535 | border: 0; 536 | border-radius: 100%; 537 | box-shadow: 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2); 538 | box-shadow: var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2)); 539 | height: 13px; 540 | height: var(--plyr-range-thumb-height, 13px); 541 | position: relative; 542 | -moz-transition: all .2s ease; 543 | transition: all .2s ease; 544 | width: 13px; 545 | width: var(--plyr-range-thumb-height, 13px) 546 | } 547 | 548 | .plyr--full-ui input[type=range]::-moz-range-progress { 549 | background: currentColor; 550 | border-radius: 2.5px; 551 | border-radius: calc(var(--plyr-range-track-height, 5px)/2); 552 | height: 5px; 553 | height: var(--plyr-range-track-height, 5px) 554 | } 555 | 556 | .plyr--full-ui input[type=range]::-ms-track { 557 | color: transparent 558 | } 559 | 560 | .plyr--full-ui input[type=range]::-ms-fill-upper, .plyr--full-ui input[type=range]::-ms-track { 561 | background: transparent; 562 | border: 0; 563 | border-radius: 2.5px; 564 | border-radius: calc(var(--plyr-range-track-height, 5px)/2); 565 | height: 5px; 566 | height: var(--plyr-range-track-height, 5px); 567 | -ms-transition: box-shadow .3s ease; 568 | transition: box-shadow .3s ease; 569 | user-select: none 570 | } 571 | 572 | .plyr--full-ui input[type=range]::-ms-fill-lower { 573 | background: transparent; 574 | background: currentColor; 575 | border: 0; 576 | border-radius: 2.5px; 577 | border-radius: calc(var(--plyr-range-track-height, 5px)/2); 578 | height: 5px; 579 | height: var(--plyr-range-track-height, 5px); 580 | -ms-transition: box-shadow .3s ease; 581 | transition: box-shadow .3s ease; 582 | user-select: none 583 | } 584 | 585 | .plyr--full-ui input[type=range]::-ms-thumb { 586 | background: #fff; 587 | background: var(--plyr-range-thumb-background, #fff); 588 | border: 0; 589 | border-radius: 100%; 590 | box-shadow: 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2); 591 | box-shadow: var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2)); 592 | height: 13px; 593 | height: var(--plyr-range-thumb-height, 13px); 594 | margin-top: 0; 595 | position: relative; 596 | -ms-transition: all .2s ease; 597 | transition: all .2s ease; 598 | width: 13px; 599 | width: var(--plyr-range-thumb-height, 13px) 600 | } 601 | 602 | .plyr--full-ui input[type=range]::-ms-tooltip { 603 | display: none 604 | } 605 | 606 | .plyr--full-ui input[type=range]::-moz-focus-outer { 607 | border: 0 608 | } 609 | 610 | .plyr--full-ui input[type=range]:focus { 611 | outline: 0 612 | } 613 | 614 | .plyr--full-ui input[type=range].plyr__tab-focus::-webkit-slider-runnable-track { 615 | outline: 3px dotted #00b2ff; 616 | outline: var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, #00b2ff))) dotted 3px; 617 | outline-offset: 2px 618 | } 619 | 620 | .plyr--full-ui input[type=range].plyr__tab-focus::-moz-range-track { 621 | outline: 3px dotted #00b2ff; 622 | outline: var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, #00b2ff))) dotted 3px; 623 | outline-offset: 2px 624 | } 625 | 626 | .plyr--full-ui input[type=range].plyr__tab-focus::-ms-track { 627 | outline: 3px dotted #00b2ff; 628 | outline: var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, #00b2ff))) dotted 3px; 629 | outline-offset: 2px 630 | } 631 | 632 | .plyr__poster { 633 | background-color: #000; 634 | background-color: var(--plyr-video-background, var(--plyr-video-background, #000)); 635 | background-position: 50% 50%; 636 | background-repeat: no-repeat; 637 | background-size: contain; 638 | height: 100%; 639 | left: 0; 640 | opacity: 0; 641 | position: absolute; 642 | top: 0; 643 | transition: opacity .2s ease; 644 | width: 100%; 645 | z-index: 1 646 | } 647 | 648 | .plyr--stopped.plyr__poster-enabled .plyr__poster { 649 | opacity: 1 650 | } 651 | 652 | .plyr--youtube.plyr--paused.plyr__poster-enabled:not(.plyr--stopped) .plyr__poster { 653 | display: none 654 | } 655 | 656 | .plyr__time { 657 | font-size: 13px; 658 | font-size: var(--plyr-font-size-time, var(--plyr-font-size-small, 13px)) 659 | } 660 | 661 | .plyr__time+.plyr__time:before { 662 | content: "⁄"; 663 | margin-right: 10px; 664 | margin-right: var(--plyr-control-spacing, 10px) 665 | } 666 | 667 | @media (max-width:767px) { 668 | .plyr__time+.plyr__time { 669 | display: none 670 | } 671 | } 672 | 673 | .plyr__tooltip { 674 | background: hsla(0, 0%, 100%, .9); 675 | background: var(--plyr-tooltip-background, hsla(0, 0%, 100%, .9)); 676 | border-radius: 5px; 677 | border-radius: var(--plyr-tooltip-radius, 5px); 678 | bottom: 100%; 679 | box-shadow: 0 1px 2px rgba(0, 0, 0, .15); 680 | box-shadow: var(--plyr-tooltip-shadow, 0 1px 2px rgba(0, 0, 0, .15)); 681 | color: #4a5464; 682 | color: var(--plyr-tooltip-color, #4a5464); 683 | font-size: 13px; 684 | font-size: var(--plyr-font-size-small, 13px); 685 | font-weight: 400; 686 | font-weight: var(--plyr-font-weight-regular, 400); 687 | left: 50%; 688 | line-height: 1.3; 689 | margin-bottom: 10px; 690 | margin-bottom: calc(var(--plyr-control-spacing, 10px)/2*2); 691 | opacity: 0; 692 | padding: 5px 7.5px; 693 | padding: calc(var(--plyr-control-spacing, 10px)/2) calc(var(--plyr-control-spacing, 10px)/2*1.5); 694 | pointer-events: none; 695 | position: absolute; 696 | transform: translate(-50%, 10px) scale(.8); 697 | transform-origin: 50% 100%; 698 | transition: transform .2s ease .1s, opacity .2s ease .1s; 699 | white-space: nowrap; 700 | z-index: 2 701 | } 702 | 703 | .plyr__tooltip:before { 704 | border-left: 4px solid transparent; 705 | border-left: var(--plyr-tooltip-arrow-size, 4px) solid transparent; 706 | border-right: 4px solid transparent; 707 | border-right: var(--plyr-tooltip-arrow-size, 4px) solid transparent; 708 | border-top: 4px solid hsla(0, 0%, 100%, .9); 709 | border-top: var(--plyr-tooltip-arrow-size, 4px) solid var(--plyr-tooltip-background, hsla(0, 0%, 100%, .9)); 710 | bottom: -4px; 711 | bottom: calc(var(--plyr-tooltip-arrow-size, 4px)*-1); 712 | content: ""; 713 | height: 0; 714 | left: 50%; 715 | position: absolute; 716 | transform: translateX(-50%); 717 | width: 0; 718 | z-index: 2 719 | } 720 | 721 | .plyr .plyr__control.plyr__tab-focus .plyr__tooltip, .plyr .plyr__control:hover .plyr__tooltip, .plyr__tooltip--visible { 722 | opacity: 1; 723 | transform: translate(-50%) scale(1) 724 | } 725 | 726 | .plyr .plyr__control:hover .plyr__tooltip { 727 | z-index: 3 728 | } 729 | 730 | .plyr__controls>.plyr__control:first-child .plyr__tooltip, .plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip { 731 | left: 0; 732 | transform: translateY(10px) scale(.8); 733 | transform-origin: 0 100% 734 | } 735 | 736 | .plyr__controls>.plyr__control:first-child .plyr__tooltip:before, .plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip:before { 737 | left: 16px; 738 | left: calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7) 739 | } 740 | 741 | .plyr__controls>.plyr__control:last-child .plyr__tooltip { 742 | left: auto; 743 | right: 0; 744 | transform: translateY(10px) scale(.8); 745 | transform-origin: 100% 100% 746 | } 747 | 748 | .plyr__controls>.plyr__control:last-child .plyr__tooltip:before { 749 | left: auto; 750 | right: 16px; 751 | right: calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7); 752 | transform: translateX(50%) 753 | } 754 | 755 | .plyr__controls>.plyr__control:first-child .plyr__tooltip--visible, .plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip--visible, .plyr__controls>.plyr__control:first-child+.plyr__control.plyr__tab-focus .plyr__tooltip, .plyr__controls>.plyr__control:first-child+.plyr__control:hover .plyr__tooltip, .plyr__controls>.plyr__control:first-child.plyr__tab-focus .plyr__tooltip, .plyr__controls>.plyr__control:first-child:hover .plyr__tooltip, .plyr__controls>.plyr__control:last-child .plyr__tooltip--visible, .plyr__controls>.plyr__control:last-child.plyr__tab-focus .plyr__tooltip, .plyr__controls>.plyr__control:last-child:hover .plyr__tooltip { 756 | transform: translate(0) scale(1) 757 | } 758 | 759 | .plyr__progress { 760 | left: 6.5px; 761 | left: calc(var(--plyr-range-thumb-height, 13px)*.5); 762 | margin-right: 13px; 763 | margin-right: var(--plyr-range-thumb-height, 13px); 764 | position: relative 765 | } 766 | 767 | .plyr__progress input[type=range], .plyr__progress__buffer { 768 | margin-left: -6.5px; 769 | margin-left: calc(var(--plyr-range-thumb-height, 13px)*-.5); 770 | margin-right: -6.5px; 771 | margin-right: calc(var(--plyr-range-thumb-height, 13px)*-.5); 772 | width: calc(100% + 13px); 773 | width: calc(100% + var(--plyr-range-thumb-height, 13px)) 774 | } 775 | 776 | .plyr__progress input[type=range] { 777 | position: relative; 778 | z-index: 2 779 | } 780 | 781 | .plyr__progress .plyr__tooltip { 782 | left: 0; 783 | max-width: 120px; 784 | overflow-wrap: break-word 785 | } 786 | 787 | .plyr__progress__buffer { 788 | -webkit-appearance: none; 789 | background: transparent; 790 | border: 0; 791 | border-radius: 100px; 792 | height: 5px; 793 | height: var(--plyr-range-track-height, 5px); 794 | left: 0; 795 | margin-top: -2.5px; 796 | margin-top: calc((var(--plyr-range-track-height, 5px)/2)*-1); 797 | padding: 0; 798 | position: absolute; 799 | top: 50% 800 | } 801 | 802 | .plyr__progress__buffer::-webkit-progress-bar { 803 | background: transparent 804 | } 805 | 806 | .plyr__progress__buffer::-webkit-progress-value { 807 | background: currentColor; 808 | border-radius: 100px; 809 | min-width: 5px; 810 | min-width: var(--plyr-range-track-height, 5px); 811 | -webkit-transition: width .2s ease; 812 | transition: width .2s ease 813 | } 814 | 815 | .plyr__progress__buffer::-moz-progress-bar { 816 | background: currentColor; 817 | border-radius: 100px; 818 | min-width: 5px; 819 | min-width: var(--plyr-range-track-height, 5px); 820 | -moz-transition: width .2s ease; 821 | transition: width .2s ease 822 | } 823 | 824 | .plyr__progress__buffer::-ms-fill { 825 | border-radius: 100px; 826 | -ms-transition: width .2s ease; 827 | transition: width .2s ease 828 | } 829 | 830 | .plyr--loading .plyr__progress__buffer { 831 | animation: plyr-progress 1s linear infinite; 832 | background-image: linear-gradient(-45deg, rgba(35, 40, 47, .6) 25%, transparent 0, transparent 50%, rgba(35, 40, 47, .6) 0, rgba(35, 40, 47, .6) 75%, transparent 0, transparent); 833 | background-image: linear-gradient(-45deg, var(--plyr-progress-loading-background, rgba(35, 40, 47, .6)) 25%, transparent 25%, transparent 50%, var(--plyr-progress-loading-background, rgba(35, 40, 47, .6)) 50%, var(--plyr-progress-loading-background, rgba(35, 40, 47, .6)) 75%, transparent 75%, transparent); 834 | background-repeat: repeat-x; 835 | background-size: 25px 25px; 836 | background-size: var(--plyr-progress-loading-size, 25px) var(--plyr-progress-loading-size, 25px); 837 | color: transparent 838 | } 839 | 840 | .plyr--video.plyr--loading .plyr__progress__buffer { 841 | background-color: hsla(0, 0%, 100%, .25); 842 | background-color: var(--plyr-video-progress-buffered-background, hsla(0, 0%, 100%, .25)) 843 | } 844 | 845 | .plyr--audio.plyr--loading .plyr__progress__buffer { 846 | background-color: rgba(193, 200, 209, .6); 847 | background-color: var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, .6)) 848 | } 849 | 850 | .plyr__progress__marker { 851 | background-color: #fff; 852 | background-color: var(--plyr-progress-marker-background, #fff); 853 | border-radius: 1px; 854 | height: 5px; 855 | height: var(--plyr-range-track-height, 5px); 856 | position: absolute; 857 | top: 50%; 858 | transform: translate(-50%, -50%); 859 | width: 3px; 860 | width: var(--plyr-progress-marker-width, 3px); 861 | z-index: 3 862 | } 863 | 864 | .plyr__volume { 865 | align-items: center; 866 | display: flex; 867 | max-width: 110px; 868 | min-width: 80px; 869 | position: relative; 870 | width: 20% 871 | } 872 | 873 | .plyr__volume input[type=range] { 874 | margin-left: 5px; 875 | margin-left: calc(var(--plyr-control-spacing, 10px)/2); 876 | margin-right: 5px; 877 | margin-right: calc(var(--plyr-control-spacing, 10px)/2); 878 | position: relative; 879 | z-index: 2 880 | } 881 | 882 | .plyr--is-ios .plyr__volume { 883 | min-width: 0; 884 | width: auto 885 | } 886 | 887 | .plyr--audio { 888 | display: block 889 | } 890 | 891 | .plyr--audio .plyr__controls { 892 | background: #fff; 893 | background: var(--plyr-audio-controls-background, #fff); 894 | border-radius: inherit; 895 | color: #4a5464; 896 | color: var(--plyr-audio-control-color, #4a5464); 897 | padding: 10px; 898 | padding: var(--plyr-control-spacing, 10px) 899 | } 900 | 901 | .plyr--audio .plyr__control.plyr__tab-focus, .plyr--audio .plyr__control:hover, .plyr--audio .plyr__control[aria-expanded=true] { 902 | background: #00b2ff; 903 | background: var(--plyr-audio-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, #00b2ff))); 904 | color: #fff; 905 | color: var(--plyr-audio-control-color-hover, #fff) 906 | } 907 | 908 | .plyr--full-ui.plyr--audio input[type=range]::-webkit-slider-runnable-track { 909 | background-color: rgba(193, 200, 209, .6); 910 | background-color: var(--plyr-audio-range-track-background, var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, .6))) 911 | } 912 | 913 | .plyr--full-ui.plyr--audio input[type=range]::-moz-range-track { 914 | background-color: rgba(193, 200, 209, .6); 915 | background-color: var(--plyr-audio-range-track-background, var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, .6))) 916 | } 917 | 918 | .plyr--full-ui.plyr--audio input[type=range]::-ms-track { 919 | background-color: rgba(193, 200, 209, .6); 920 | background-color: var(--plyr-audio-range-track-background, var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, .6))) 921 | } 922 | 923 | .plyr--full-ui.plyr--audio input[type=range]:active::-webkit-slider-thumb { 924 | box-shadow: 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2), 0 0 0 3px rgba(35, 40, 47, .1); 925 | box-shadow: var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(35, 40, 47, .1)) 926 | } 927 | 928 | .plyr--full-ui.plyr--audio input[type=range]:active::-moz-range-thumb { 929 | box-shadow: 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2), 0 0 0 3px rgba(35, 40, 47, .1); 930 | box-shadow: var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(35, 40, 47, .1)) 931 | } 932 | 933 | .plyr--full-ui.plyr--audio input[type=range]:active::-ms-thumb { 934 | box-shadow: 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2), 0 0 0 3px rgba(35, 40, 47, .1); 935 | box-shadow: var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(35, 40, 47, .1)) 936 | } 937 | 938 | .plyr--audio .plyr__progress__buffer { 939 | color: rgba(193, 200, 209, .6); 940 | color: var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, .6)) 941 | } 942 | 943 | .plyr--video { 944 | background: #000; 945 | background: var(--plyr-video-background, var(--plyr-video-background, #000)); 946 | overflow: hidden 947 | } 948 | 949 | .plyr--video.plyr--menu-open { 950 | overflow: visible 951 | } 952 | 953 | .plyr__video-wrapper { 954 | background: #000; 955 | background: var(--plyr-video-background, var(--plyr-video-background, #000)); 956 | height: 100%; 957 | margin: auto; 958 | overflow: hidden; 959 | position: relative; 960 | width: 100% 961 | } 962 | 963 | .plyr__video-embed, .plyr__video-wrapper--fixed-ratio { 964 | aspect-ratio: 16/9 965 | } 966 | 967 | @supports not (aspect-ratio:16/9) { 968 | .plyr__video-embed, .plyr__video-wrapper--fixed-ratio { 969 | height: 0; 970 | padding-bottom: 56.25%; 971 | position: relative 972 | } 973 | } 974 | 975 | .plyr__video-embed iframe, .plyr__video-wrapper--fixed-ratio video { 976 | border: 0; 977 | height: 100%; 978 | left: 0; 979 | position: absolute; 980 | top: 0; 981 | width: 100% 982 | } 983 | 984 | .plyr--full-ui .plyr__video-embed>.plyr__video-embed__container { 985 | padding-bottom: 240%; 986 | position: relative; 987 | transform: translateY(-38.28125%) 988 | } 989 | 990 | .plyr--video .plyr__controls { 991 | background: linear-gradient(transparent, rgba(0, 0, 0, .75)); 992 | background: var(--plyr-video-controls-background, linear-gradient(transparent, rgba(0, 0, 0, .75))); 993 | border-bottom-left-radius: inherit; 994 | border-bottom-right-radius: inherit; 995 | bottom: 0; 996 | color: #fff; 997 | color: var(--plyr-video-control-color, #fff); 998 | left: 0; 999 | padding: 5px; 1000 | padding: calc(var(--plyr-control-spacing, 10px)/2); 1001 | padding-top: 20px; 1002 | padding-top: calc(var(--plyr-control-spacing, 10px)*2); 1003 | position: absolute; 1004 | right: 0; 1005 | transition: opacity .4s ease-in-out, transform .4s ease-in-out; 1006 | z-index: 3 1007 | } 1008 | 1009 | @media (min-width:480px) { 1010 | .plyr--video .plyr__controls { 1011 | padding: 10px; 1012 | padding: var(--plyr-control-spacing, 10px); 1013 | padding-top: 35px; 1014 | padding-top: calc(var(--plyr-control-spacing, 10px)*3.5) 1015 | } 1016 | } 1017 | 1018 | .plyr--video.plyr--hide-controls .plyr__controls { 1019 | opacity: 0; 1020 | pointer-events: none; 1021 | transform: translateY(100%) 1022 | } 1023 | 1024 | .plyr--video .plyr__control.plyr__tab-focus, .plyr--video .plyr__control:hover, .plyr--video .plyr__control[aria-expanded=true] { 1025 | background: #00b2ff; 1026 | background: var(--plyr-video-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, #00b2ff))); 1027 | color: #fff; 1028 | color: var(--plyr-video-control-color-hover, #fff) 1029 | } 1030 | 1031 | .plyr__control--overlaid { 1032 | background: #00b2ff; 1033 | background: var(--plyr-video-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, #00b2ff))); 1034 | border: 0; 1035 | border-radius: 100%; 1036 | color: #fff; 1037 | color: var(--plyr-video-control-color, #fff); 1038 | display: none; 1039 | left: 50%; 1040 | opacity: .9; 1041 | padding: 15px; 1042 | padding: calc(var(--plyr-control-spacing, 10px)*1.5); 1043 | position: absolute; 1044 | top: 50%; 1045 | transform: translate(-50%, -50%); 1046 | transition: .3s; 1047 | z-index: 2 1048 | } 1049 | 1050 | .plyr__control--overlaid svg { 1051 | left: 2px; 1052 | position: relative 1053 | } 1054 | 1055 | .plyr__control--overlaid:focus, .plyr__control--overlaid:hover { 1056 | opacity: 1 1057 | } 1058 | 1059 | .plyr--playing .plyr__control--overlaid { 1060 | opacity: 0; 1061 | visibility: hidden 1062 | } 1063 | 1064 | .plyr--full-ui.plyr--video .plyr__control--overlaid { 1065 | display: block 1066 | } 1067 | 1068 | .plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track { 1069 | background-color: hsla(0, 0%, 100%, .25); 1070 | background-color: var(--plyr-video-range-track-background, var(--plyr-video-progress-buffered-background, hsla(0, 0%, 100%, .25))) 1071 | } 1072 | 1073 | .plyr--full-ui.plyr--video input[type=range]::-moz-range-track { 1074 | background-color: hsla(0, 0%, 100%, .25); 1075 | background-color: var(--plyr-video-range-track-background, var(--plyr-video-progress-buffered-background, hsla(0, 0%, 100%, .25))) 1076 | } 1077 | 1078 | .plyr--full-ui.plyr--video input[type=range]::-ms-track { 1079 | background-color: hsla(0, 0%, 100%, .25); 1080 | background-color: var(--plyr-video-range-track-background, var(--plyr-video-progress-buffered-background, hsla(0, 0%, 100%, .25))) 1081 | } 1082 | 1083 | .plyr--full-ui.plyr--video input[type=range]:active::-webkit-slider-thumb { 1084 | box-shadow: 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2), 0 0 0 3px hsla(0, 0%, 100%, .5); 1085 | box-shadow: var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, hsla(0, 0%, 100%, .5)) 1086 | } 1087 | 1088 | .plyr--full-ui.plyr--video input[type=range]:active::-moz-range-thumb { 1089 | box-shadow: 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2), 0 0 0 3px hsla(0, 0%, 100%, .5); 1090 | box-shadow: var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, hsla(0, 0%, 100%, .5)) 1091 | } 1092 | 1093 | .plyr--full-ui.plyr--video input[type=range]:active::-ms-thumb { 1094 | box-shadow: 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2), 0 0 0 3px hsla(0, 0%, 100%, .5); 1095 | box-shadow: var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, .15), 0 0 0 1px rgba(35, 40, 47, .2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, hsla(0, 0%, 100%, .5)) 1096 | } 1097 | 1098 | .plyr--video .plyr__progress__buffer { 1099 | color: hsla(0, 0%, 100%, .25); 1100 | color: var(--plyr-video-progress-buffered-background, hsla(0, 0%, 100%, .25)) 1101 | } 1102 | 1103 | .plyr:-webkit-full-screen { 1104 | background: #000; 1105 | border-radius: 0 !important; 1106 | height: 100%; 1107 | margin: 0; 1108 | width: 100% 1109 | } 1110 | 1111 | .plyr:fullscreen { 1112 | background: #000; 1113 | border-radius: 0 !important; 1114 | height: 100%; 1115 | margin: 0; 1116 | width: 100% 1117 | } 1118 | 1119 | .plyr:-webkit-full-screen video { 1120 | height: 100% 1121 | } 1122 | 1123 | .plyr:fullscreen video { 1124 | height: 100% 1125 | } 1126 | 1127 | .plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen { 1128 | display: block 1129 | } 1130 | 1131 | .plyr:fullscreen .plyr__control .icon--exit-fullscreen { 1132 | display: block 1133 | } 1134 | 1135 | .plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen+svg { 1136 | display: none 1137 | } 1138 | 1139 | .plyr:fullscreen .plyr__control .icon--exit-fullscreen+svg { 1140 | display: none 1141 | } 1142 | 1143 | .plyr:-webkit-full-screen.plyr--hide-controls { 1144 | cursor: none 1145 | } 1146 | 1147 | .plyr:fullscreen.plyr--hide-controls { 1148 | cursor: none 1149 | } 1150 | 1151 | @media (min-width:1024px) { 1152 | .plyr:-webkit-full-screen .plyr__captions { 1153 | font-size: 21px; 1154 | font-size: var(--plyr-font-size-xlarge, 21px) 1155 | } 1156 | 1157 | .plyr:fullscreen .plyr__captions { 1158 | font-size: 21px; 1159 | font-size: var(--plyr-font-size-xlarge, 21px) 1160 | } 1161 | } 1162 | 1163 | .plyr--fullscreen-fallback { 1164 | background: #000; 1165 | border-radius: 0 !important; 1166 | bottom: 0; 1167 | display: block; 1168 | height: 100%; 1169 | left: 0; 1170 | margin: 0; 1171 | position: fixed; 1172 | right: 0; 1173 | top: 0; 1174 | width: 100%; 1175 | z-index: 10000000 1176 | } 1177 | 1178 | .plyr--fullscreen-fallback video { 1179 | height: 100% 1180 | } 1181 | 1182 | .plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen { 1183 | display: block 1184 | } 1185 | 1186 | .plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen+svg { 1187 | display: none 1188 | } 1189 | 1190 | .plyr--fullscreen-fallback.plyr--hide-controls { 1191 | cursor: none 1192 | } 1193 | 1194 | @media (min-width:1024px) { 1195 | .plyr--fullscreen-fallback .plyr__captions { 1196 | font-size: 21px; 1197 | font-size: var(--plyr-font-size-xlarge, 21px) 1198 | } 1199 | } 1200 | 1201 | .plyr__ads { 1202 | border-radius: inherit; 1203 | bottom: 0; 1204 | cursor: pointer; 1205 | left: 0; 1206 | overflow: hidden; 1207 | position: absolute; 1208 | right: 0; 1209 | top: 0; 1210 | z-index: -1 1211 | } 1212 | 1213 | .plyr__ads>div, .plyr__ads>div iframe { 1214 | height: 100%; 1215 | position: absolute; 1216 | width: 100% 1217 | } 1218 | 1219 | .plyr__ads:after { 1220 | background: #23282f; 1221 | border-radius: 2px; 1222 | bottom: 10px; 1223 | bottom: var(--plyr-control-spacing, 10px); 1224 | color: #fff; 1225 | content: attr(data-badge-text); 1226 | font-size: 11px; 1227 | padding: 2px 6px; 1228 | pointer-events: none; 1229 | position: absolute; 1230 | right: 10px; 1231 | right: var(--plyr-control-spacing, 10px); 1232 | z-index: 3 1233 | } 1234 | 1235 | .plyr__ads:empty:after { 1236 | display: none 1237 | } 1238 | 1239 | .plyr__cues { 1240 | background: currentColor; 1241 | display: block; 1242 | height: 5px; 1243 | height: var(--plyr-range-track-height, 5px); 1244 | left: 0; 1245 | opacity: .8; 1246 | position: absolute; 1247 | top: 50%; 1248 | transform: translateY(-50%); 1249 | width: 3px; 1250 | z-index: 3 1251 | } 1252 | 1253 | .plyr__preview-thumb { 1254 | background-color: hsla(0, 0%, 100%, .9); 1255 | background-color: var(--plyr-tooltip-background, hsla(0, 0%, 100%, .9)); 1256 | border-radius: 5px; 1257 | border-radius: var(--plyr-tooltip-radius, 5px); 1258 | bottom: 100%; 1259 | box-shadow: 0 1px 2px rgba(0, 0, 0, .15); 1260 | box-shadow: var(--plyr-tooltip-shadow, 0 1px 2px rgba(0, 0, 0, .15)); 1261 | margin-bottom: 10px; 1262 | margin-bottom: calc(var(--plyr-control-spacing, 10px)/2*2); 1263 | opacity: 0; 1264 | padding: 3px; 1265 | pointer-events: none; 1266 | position: absolute; 1267 | transform: translateY(10px) scale(.8); 1268 | transform-origin: 50% 100%; 1269 | transition: transform .2s ease .1s, opacity .2s ease .1s; 1270 | z-index: 2 1271 | } 1272 | 1273 | .plyr__preview-thumb--is-shown { 1274 | opacity: 1; 1275 | transform: translate(0) scale(1) 1276 | } 1277 | 1278 | .plyr__preview-thumb:before { 1279 | border-left: 4px solid transparent; 1280 | border-left: var(--plyr-tooltip-arrow-size, 4px) solid transparent; 1281 | border-right: 4px solid transparent; 1282 | border-right: var(--plyr-tooltip-arrow-size, 4px) solid transparent; 1283 | border-top: 4px solid hsla(0, 0%, 100%, .9); 1284 | border-top: var(--plyr-tooltip-arrow-size, 4px) solid var(--plyr-tooltip-background, hsla(0, 0%, 100%, .9)); 1285 | bottom: -4px; 1286 | bottom: calc(var(--plyr-tooltip-arrow-size, 4px)*-1); 1287 | content: ""; 1288 | height: 0; 1289 | left: calc(50% + var(--preview-arrow-offset)); 1290 | position: absolute; 1291 | transform: translateX(-50%); 1292 | width: 0; 1293 | z-index: 2 1294 | } 1295 | 1296 | .plyr__preview-thumb__image-container { 1297 | background: #c1c8d1; 1298 | border-radius: 4px; 1299 | border-radius: calc(var(--plyr-tooltip-radius, 5px) - 1px); 1300 | overflow: hidden; 1301 | position: relative; 1302 | z-index: 0 1303 | } 1304 | 1305 | .plyr__preview-thumb__image-container img, .plyr__preview-thumb__image-container:after { 1306 | height: 100%; 1307 | left: 0; 1308 | position: absolute; 1309 | top: 0; 1310 | width: 100% 1311 | } 1312 | 1313 | .plyr__preview-thumb__image-container:after { 1314 | border-radius: inherit; 1315 | box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); 1316 | content: ""; 1317 | pointer-events: none 1318 | } 1319 | 1320 | .plyr__preview-thumb__image-container img { 1321 | max-height: none; 1322 | max-width: none 1323 | } 1324 | 1325 | .plyr__preview-thumb__time-container { 1326 | background: linear-gradient(transparent, rgba(0, 0, 0, .75)); 1327 | background: var(--plyr-video-controls-background, linear-gradient(transparent, rgba(0, 0, 0, .75))); 1328 | border-bottom-left-radius: 4px; 1329 | border-bottom-left-radius: calc(var(--plyr-tooltip-radius, 5px) - 1px); 1330 | border-bottom-right-radius: 4px; 1331 | border-bottom-right-radius: calc(var(--plyr-tooltip-radius, 5px) - 1px); 1332 | bottom: 0; 1333 | left: 0; 1334 | line-height: 1.1; 1335 | padding: 20px 6px 6px; 1336 | position: absolute; 1337 | right: 0; 1338 | z-index: 3 1339 | } 1340 | 1341 | .plyr__preview-thumb__time-container span { 1342 | color: #fff; 1343 | font-size: 13px; 1344 | font-size: var(--plyr-font-size-time, var(--plyr-font-size-small, 13px)) 1345 | } 1346 | 1347 | .plyr__preview-scrubbing { 1348 | bottom: 0; 1349 | filter: blur(1px); 1350 | height: 100%; 1351 | left: 0; 1352 | margin: auto; 1353 | opacity: 0; 1354 | overflow: hidden; 1355 | pointer-events: none; 1356 | position: absolute; 1357 | right: 0; 1358 | top: 0; 1359 | transition: opacity .3s ease; 1360 | width: 100%; 1361 | z-index: 1 1362 | } 1363 | 1364 | .plyr__preview-scrubbing--is-shown { 1365 | opacity: 1 1366 | } 1367 | 1368 | .plyr__preview-scrubbing img { 1369 | height: 100%; 1370 | left: 0; 1371 | max-height: none; 1372 | max-width: none; 1373 | -o-object-fit: contain; 1374 | object-fit: contain; 1375 | position: absolute; 1376 | top: 0; 1377 | width: 100% 1378 | } 1379 | 1380 | .plyr--no-transition { 1381 | transition: none !important 1382 | } 1383 | 1384 | .plyr__sr-only { 1385 | clip: rect(1px, 1px, 1px, 1px); 1386 | border: 0 !important; 1387 | height: 1px !important; 1388 | overflow: hidden; 1389 | padding: 0 !important; 1390 | position: absolute !important; 1391 | width: 1px !important 1392 | } 1393 | 1394 | .plyr [hidden] { 1395 | display: none !important 1396 | } -------------------------------------------------------------------------------- /player/plyr.min.js: -------------------------------------------------------------------------------- 1 | "object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):(e="undefined"!=typeof globalThis?globalThis:e||self).Plyr=t()}(this,(function(){"use strict";function e(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function t(e,t){for(var i=0;it){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}var T=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),b(t)?this.element=t:p(t)&&(this.element=document.querySelector(t)),b(this.element)&&v(this.element.rangeTouch)&&(this.config=n({},a,{},i),this.init())}return function(e,i,s){i&&t(e.prototype,i),s&&t(e,s)}(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!y(t))return null;var i,s=t.target,n=t.changedTouches[0],a=parseFloat(s.getAttribute("min"))||0,l=parseFloat(s.getAttribute("max"))||100,o=parseFloat(s.getAttribute("step"))||1,r=s.getBoundingClientRect(),c=100/r.width*(this.config.thumbWidth/2)/100;return 0>(i=100/r.width*(n.clientX-r.left))?i=0:100i?i-=(100-2*i)*c:50null!=e?e.constructor:null,C=(e,t)=>Boolean(e&&t&&e instanceof t),A=e=>null==e,S=e=>k(e)===Object,E=e=>k(e)===String,P=e=>"function"==typeof e,M=e=>Array.isArray(e),N=e=>C(e,NodeList),x=e=>A(e)||(E(e)||M(e)||N(e))&&!e.length||S(e)&&!Object.keys(e).length;var I=A,L=S,$=e=>k(e)===Number&&!Number.isNaN(e),_=E,O=e=>k(e)===Boolean,j=P,D=M,q=N,H=e=>null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument,R=e=>C(e,Event),F=e=>C(e,KeyboardEvent),V=e=>C(e,TextTrack)||!A(e)&&E(e.kind),B=e=>C(e,Promise)&&P(e.then),U=e=>{if(C(e,window.URL))return!0;if(!E(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!x(new URL(t).hostname)}catch(e){return!1}},W=x;const z=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find((t=>void 0!==e.style[t]));return!!_(i)&&t[i]})();function K(e,t){setTimeout((()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}const Y={isIE:Boolean(window.document.documentMode),isEdge:/Edge/g.test(navigator.userAgent),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),isIPhone:/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function Q(e,t){return t.split(".").reduce(((e,t)=>e&&e[t]),e)}function X(e={},...t){if(!t.length)return e;const i=t.shift();return L(i)?(Object.keys(i).forEach((t=>{L(i[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),X(e[t],i[t])):Object.assign(e,{[t]:i[t]})})),X(e,...t)):e}function J(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach(((e,i)=>{const s=i>0?t.cloneNode(!0):t,n=e.parentNode,a=e.nextSibling;s.appendChild(e),a?n.insertBefore(s,a):n.appendChild(s)}))}function G(e,t){H(e)&&!W(t)&&Object.entries(t).filter((([,e])=>!I(e))).forEach((([t,i])=>e.setAttribute(t,i)))}function Z(e,t,i){const s=document.createElement(e);return L(t)&&G(s,t),_(i)&&(s.innerText=i),s}function ee(e,t,i,s){H(t)&&t.appendChild(Z(e,i,s))}function te(e){q(e)||D(e)?Array.from(e).forEach(te):H(e)&&H(e.parentNode)&&e.parentNode.removeChild(e)}function ie(e){if(!H(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function se(e,t){return H(t)&&H(t.parentNode)&&H(e)?(t.parentNode.replaceChild(e,t),e):null}function ne(e,t){if(!_(e)||W(e))return{};const i={},s=X({},t);return e.split(",").forEach((e=>{const t=e.trim(),n=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),[l]=a,o=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":_(s.class)?i.class=`${s.class} ${n}`:i.class=n;break;case"#":i.id=t.replace("#","");break;case"[":i[l]=o}})),X(s,i)}function ae(e,t){if(!H(e))return;let i=t;O(i)||(i=!e.hidden),e.hidden=i}function le(e,t,i){if(q(e))return Array.from(e).map((e=>le(e,t,i)));if(H(e)){let s="toggle";return void 0!==i&&(s=i?"add":"remove"),e.classList[s](t),e.classList.contains(t)}return!1}function oe(e,t){return H(e)&&e.classList.contains(t)}function re(e,t){const{prototype:i}=Element;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function ce(e){return this.elements.container.querySelectorAll(e)}function he(e){return this.elements.container.querySelector(e)}function ue(e=null,t=!1){H(e)&&(e.focus({preventScroll:!0}),t&&le(e,this.config.classNames.tabFocus))}const de={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},me={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t,i){const s=Y.isIPhone&&i&&me.playsinline,n=me[e]||"html5"!==t;return{api:n,ui:n&&me.rangeInput&&("video"!==e||!Y.isIPhone||s)}},pip:!(Y.isIPhone||!j(Z("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||Z("video").disablePictureInPicture)),airplay:j(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(W(e))return!1;const[t]=e.split("/");let i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(de).includes(i)&&(i+=`; codecs="${de[e]}"`);try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==z,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},pe=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e})();function ge(e,t,i,s=!1,n=!0,a=!1){if(!e||!("addEventListener"in e)||W(t)||!j(i))return;const l=t.split(" ");let o=a;pe&&(o={passive:n,capture:a}),l.forEach((t=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:t,callback:i,options:o}),e[s?"addEventListener":"removeEventListener"](t,i,o)}))}function fe(e,t="",i,s=!0,n=!1){ge.call(this,e,t,i,!0,s,n)}function be(e,t="",i,s=!0,n=!1){ge.call(this,e,t,i,!1,s,n)}function ye(e,t="",i,s=!0,n=!1){const a=(...l)=>{be(e,t,a,s,n),i.apply(this,l)};ge.call(this,e,t,a,!0,s,n)}function ve(e,t="",i=!1,s={}){if(!H(e)||W(t))return;const n=new CustomEvent(t,{bubbles:i,detail:{...s,plyr:this}});e.dispatchEvent(n)}function we(){this&&this.eventListeners&&(this.eventListeners.forEach((e=>{const{element:t,type:i,callback:s,options:n}=e;t.removeEventListener(i,s,n)})),this.eventListeners=[])}function Te(){return new Promise((e=>this.ready?setTimeout(e,0):fe.call(this,this.elements.container,"ready",e))).then((()=>{}))}function ke(e){B(e)&&e.then(null,(()=>{}))}function Ce(e){return D(e)?e.filter(((t,i)=>e.indexOf(t)===i)):e}function Ae(e,t){return D(e)&&e.length?e.reduce(((e,i)=>Math.abs(i-t)({...e,[t/i]:[t,i]})),{});function Pe(e){if(!(D(e)||_(e)&&e.includes(":")))return!1;return(D(e)?e:e.split(":")).map(Number).every($)}function Me(e){if(!D(e)||!e.every($))return null;const[t,i]=e,s=(e,t)=>0===t?e:s(t,e%t),n=s(t,i);return[t/n,i/n]}function Ne(e){const t=e=>Pe(e)?e.split(":").map(Number):null;let i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!W(this.embed)&&D(this.embed.ratio)&&({ratio:i}=this.embed),null===i&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;i=[e,t]}return Me(i)}function xe(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=Ne.call(this,e);if(!D(i))return{};const[s,n]=Me(i),a=100/s*n;if(Se(`aspect-ratio: ${s}/${n}`)?t.style.aspectRatio=`${s}/${n}`:t.style.paddingBottom=`${a}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-a)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${i}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:a,ratio:i}}function Ie(e,t,i=.05){const s=e/t,n=Ae(Object.keys(Ee),s);return Math.abs(n-s)<=i?Ee[n]:[e,t]}const Le={getSources(){if(!this.isHTML5)return[];return Array.from(this.media.querySelectorAll("source")).filter((e=>{const t=e.getAttribute("type");return!!W(t)||me.mime.call(this,t)}))},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Le.getSources.call(this).map((e=>Number(e.getAttribute("size")))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,W(this.config.ratio)||xe.call(e),Object.defineProperty(e.media,"quality",{get(){const t=Le.getSources.call(e).find((t=>t.getAttribute("src")===e.source));return t&&Number(t.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&j(e.config.quality.onChange))e.config.quality.onChange(t);else{const i=Le.getSources.call(e).find((e=>Number(e.getAttribute("size"))===t));if(!i)return;const{currentTime:s,paused:n,preload:a,readyState:l,playbackRate:o}=e.media;e.media.src=i.getAttribute("src"),("none"!==a||l)&&(e.once("loadedmetadata",(()=>{e.speed=o,e.currentTime=s,n||ke(e.play())})),e.media.load())}ve.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(te(Le.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function $e(e,...t){return W(e)?e:e.toString().replace(/{(\d+)}/g,((e,i)=>t[i].toString()))}const _e=(e="",t="",i="")=>e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString()),Oe=(e="")=>e.toString().replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()));function je(e=""){let t=e.toString();return t=function(e=""){let t=e.toString();return t=_e(t,"-"," "),t=_e(t,"_"," "),t=Oe(t),_e(t," ","")}(t),t.charAt(0).toLowerCase()+t.slice(1)}function De(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const qe={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},He={get(e="",t={}){if(W(e)||W(t))return"";let i=Q(t.i18n,e);if(W(i))return Object.keys(qe).includes(e)?qe[e]:"";const s={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(s).forEach((([e,t])=>{i=_e(i,e,t)})),i}};class Re{constructor(t){e(this,"get",(e=>{if(!Re.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(W(t))return null;const i=JSON.parse(t);return _(e)&&e.length?i[e]:i})),e(this,"set",(e=>{if(!Re.supported||!this.enabled)return;if(!L(e))return;let t=this.get();W(t)&&(t={}),X(t,e);try{window.localStorage.setItem(this.key,JSON.stringify(t))}catch(e){}})),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}}function Fe(e,t="text"){return new Promise(((i,s)=>{try{const s=new XMLHttpRequest;if(!("withCredentials"in s))return;s.addEventListener("load",(()=>{if("text"===t)try{i(JSON.parse(s.responseText))}catch(e){i(s.responseText)}else i(s.response)})),s.addEventListener("error",(()=>{throw new Error(s.status)})),s.open("GET",e,!0),s.responseType=t,s.send()}catch(e){s(e)}}))}function Ve(e,t){if(!_(e))return;const i=_(t);let s=!1;const n=()=>null!==document.getElementById(t),a=(e,t)=>{e.innerHTML=t,i&&n()||document.body.insertAdjacentElement("afterbegin",e)};if(!i||!n()){const n=Re.supported,l=document.createElement("div");if(l.setAttribute("hidden",""),i&&l.setAttribute("id",t),n){const e=window.localStorage.getItem(`cache-${t}`);if(s=null!==e,s){const t=JSON.parse(e);a(l,t.content)}}Fe(e).then((e=>{if(!W(e)){if(n)try{window.localStorage.setItem(`cache-${t}`,JSON.stringify({content:e}))}catch(e){}a(l,e)}})).catch((()=>{}))}}const Be=e=>Math.trunc(e/60/60%60,10);function Ue(e=0,t=!1,i=!1){if(!$(e))return Ue(void 0,t,i);const s=e=>`0${e}`.slice(-2);let n=Be(e);const a=(l=e,Math.trunc(l/60%60,10));var l;const o=(e=>Math.trunc(e%60,10))(e);return n=t||n>0?`${n}:`:"",`${i&&e>0?"-":""}${n}${s(a)}:${s(o)}`}const We={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,i=e.host!==t||Y.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements(){try{return this.elements.controls=he.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:ce.call(this,this.config.selectors.buttons.play),pause:he.call(this,this.config.selectors.buttons.pause),restart:he.call(this,this.config.selectors.buttons.restart),rewind:he.call(this,this.config.selectors.buttons.rewind),fastForward:he.call(this,this.config.selectors.buttons.fastForward),mute:he.call(this,this.config.selectors.buttons.mute),pip:he.call(this,this.config.selectors.buttons.pip),airplay:he.call(this,this.config.selectors.buttons.airplay),settings:he.call(this,this.config.selectors.buttons.settings),captions:he.call(this,this.config.selectors.buttons.captions),fullscreen:he.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=he.call(this,this.config.selectors.progress),this.elements.inputs={seek:he.call(this,this.config.selectors.inputs.seek),volume:he.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:he.call(this,this.config.selectors.display.buffer),currentTime:he.call(this,this.config.selectors.display.currentTime),duration:he.call(this,this.config.selectors.display.duration)},H(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const i="http://www.w3.org/2000/svg",s=We.getIconUrl.call(this),n=`${s.cors?"":s.url}#${this.config.iconPrefix}`,a=document.createElementNS(i,"svg");G(a,X(t,{"aria-hidden":"true",focusable:"false"}));const l=document.createElementNS(i,"use"),o=`${n}-${e}`;return"href"in l&&l.setAttributeNS("http://www.w3.org/1999/xlink","href",o),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),a.appendChild(l),a},createLabel(e,t={}){const i=He.get(e,this.config);return Z("span",{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")},i)},createBadge(e){if(W(e))return null;const t=Z("span",{class:this.config.classNames.menu.value});return t.appendChild(Z("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=X({},t);let s=je(e);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((e=>{Object.keys(i).includes(e)&&(n[e]=i[e],delete i[e])})),"button"!==n.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((e=>e===this.config.classNames.control))||X(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,s="play",n.label="play",n.icon="play";break;default:W(n.label)&&(n.label=s),W(n.icon)&&(n.icon=e)}const a=Z(n.element);return n.toggle?(a.appendChild(We.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),a.appendChild(We.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),a.appendChild(We.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),a.appendChild(We.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(a.appendChild(We.createIcon.call(this,n.icon)),a.appendChild(We.createLabel.call(this,n.label))),X(i,ne(this.config.selectors.buttons[s],i)),G(a,i),"play"===s?(D(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(a)):this.elements.buttons[s]=a,a},createRange(e,t){const i=Z("input",X(ne(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":He.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,We.updateRangeFill.call(this,i),T.setup(i),i},createProgress(e,t){const i=Z("progress",X(ne(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(Z("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],s=t?He.get(t,this.config):"";i.innerText=`% ${s.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=ne(this.config.selectors.display[e],t),s=Z("div",X(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":He.get(e,this.config)}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,t){fe.call(this,e,"keydown keyup",(i=>{if(!["Space","ArrowUp","ArrowDown","ArrowRight"].includes(i.key))return;if(i.preventDefault(),i.stopPropagation(),"keydown"===i.type)return;const s=re(e,'[role="menuitemradio"]');if(!s&&["Space","ArrowRight"].includes(i.key))We.showMenuPanel.call(this,t,!0);else{let t;"Space"!==i.key&&("ArrowDown"===i.key||s&&"ArrowRight"===i.key?(t=e.nextElementSibling,H(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,H(t)||(t=e.parentNode.lastElementChild)),ue.call(this,t,!0))}}),!1),fe.call(this,e,"keyup",(e=>{"Return"===e.key&&We.focusFirstMenuItem.call(this,null,!0)}))},createMenuItem({value:e,list:t,type:i,title:s,badge:n=null,checked:a=!1}){const l=ne(this.config.selectors.inputs[i]),o=Z("button",X(l,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${l.class?l.class:""}`.trim(),"aria-checked":a,value:e})),r=Z("span");r.innerHTML=s,H(n)&&r.appendChild(n),o.appendChild(r),Object.defineProperty(o,"checked",{enumerable:!0,get:()=>"true"===o.getAttribute("aria-checked"),set(e){e&&Array.from(o.parentNode.children).filter((e=>re(e,'[role="menuitemradio"]'))).forEach((e=>e.setAttribute("aria-checked","false"))),o.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(o,"click keyup",(t=>{if(!F(t)||"Space"===t.key){switch(t.preventDefault(),t.stopPropagation(),o.checked=!0,i){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}We.showMenuPanel.call(this,"home",F(t))}}),i,!1),We.bindMenuItemShortcuts.call(this,o,i),t.appendChild(o)},formatTime(e=0,t=!1){if(!$(e))return e;return Ue(e,Be(this.duration)>0,t)},updateTimeDisplay(e=null,t=0,i=!1){H(e)&&$(t)&&(e.innerText=We.formatTime(t,i))},updateVolume(){this.supported.ui&&(H(this.elements.inputs.volume)&&We.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),H(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange(e,t=0){H(e)&&(e.value=t,We.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!R(e))return;let t=0;const i=(e,t)=>{const i=$(t)?t:0,s=H(e)?e:this.elements.display.buffer;if(H(s)){s.value=i;const e=s.getElementsByTagName("span")[0];H(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":s=this.currentTime,n=this.duration,t=0===s||0===n||Number.isNaN(s)||Number.isNaN(n)?0:(s/n*100).toFixed(2),"timeupdate"===e.type&&We.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered)}var s,n},updateRangeFill(e){const t=R(e)?e.target:e;if(H(t)&&"range"===t.getAttribute("type")){if(re(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=We.formatTime(this.currentTime),i=We.formatTime(this.duration),s=He.get("seekLabel",this.config);t.setAttribute("aria-valuetext",s.replace("{currentTime}",e).replace("{duration}",i))}else if(re(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);Y.isWebkit&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){var t,i;if(!this.config.tooltips.seek||!H(this.elements.inputs.seek)||!H(this.elements.display.seekTooltip)||0===this.duration)return;const s=this.elements.display.seekTooltip,n=`${this.config.classNames.tooltip}--visible`,a=e=>le(s,n,e);if(this.touch)return void a(!1);let l=0;const o=this.elements.progress.getBoundingClientRect();if(R(e))l=100/o.width*(e.pageX-o.left);else{if(!oe(s,n))return;l=parseFloat(s.style.left,10)}l<0?l=0:l>100&&(l=100);const r=this.duration/100*l;s.innerText=We.formatTime(r);const c=null===(t=this.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((({time:e})=>e===Math.round(r)));c&&s.insertAdjacentHTML("afterbegin",`${c.label}
    `),s.style.left=`${l}%`,R(e)&&["mouseenter","mouseleave"].includes(e.type)&&a("mouseenter"===e.type)},timeUpdate(e){const t=!H(this.elements.display.duration)&&this.config.invertTime;We.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||We.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return ae(this.elements.display.currentTime,!0),void ae(this.elements.progress,!0);H(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=H(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&We.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&We.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&We.setMarkers.call(this),We.updateSeekTooltip.call(this)},toggleMenuButton(e,t){ae(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const s=this.elements.settings.panels[e];let n=null,a=t;if("captions"===e)n=this.currentTrack;else{if(n=W(i)?this[e]:i,W(n)&&(n=this.config[e].default),!W(this.options[e])&&!this.options[e].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${e}`);if(!this.config[e].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${e}`)}if(H(a)||(a=s&&s.querySelector('[role="menu"]')),!H(a))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=We.getLabel.call(this,e,n);const l=a&&a.querySelector(`[value="${n}"]`);H(l)&&(l.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?He.get("normal",this.config):`${t}×`;case"quality":if($(t)){const e=He.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return Oe(t);case"captions":return Ye.getLabel.call(this);default:return null}},setQualityMenu(e){if(!H(this.elements.settings.panels.quality))return;const t="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');D(e)&&(this.options.quality=Ce(e).filter((e=>this.config.quality.options.includes(e))));const s=!W(this.options.quality)&&this.options.quality.length>1;if(We.toggleMenuButton.call(this,t,s),ie(i),We.checkMenu.call(this),!s)return;const n=e=>{const t=He.get(`qualityBadge.${e}`,this.config);return t.length?We.createBadge.call(this,t):null};this.options.quality.sort(((e,t)=>{const i=this.config.quality.options;return i.indexOf(e)>i.indexOf(t)?1:-1})).forEach((e=>{We.createMenuItem.call(this,{value:e,list:i,type:t,title:We.getLabel.call(this,"quality",e),badge:n(e)})})),We.updateSetting.call(this,t,i)},setCaptionsMenu(){if(!H(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=Ye.getTracks.call(this),s=Boolean(i.length);if(We.toggleMenuButton.call(this,e,s),ie(t),We.checkMenu.call(this),!s)return;const n=i.map(((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:Ye.getLabel.call(this,e),badge:e.language&&We.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"})));n.unshift({value:-1,checked:!this.captions.toggled,title:He.get("disabled",this.config),list:t,type:"language"}),n.forEach(We.createMenuItem.bind(this)),We.updateSetting.call(this,e,t)},setSpeedMenu(){if(!H(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((e=>e>=this.minimumSpeed&&e<=this.maximumSpeed));const i=!W(this.options.speed)&&this.options.speed.length>1;We.toggleMenuButton.call(this,e,i),ie(t),We.checkMenu.call(this),i&&(this.options.speed.forEach((i=>{We.createMenuItem.call(this,{value:i,list:t,type:e,title:We.getLabel.call(this,"speed",i)})})),We.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!W(e)&&Object.values(e).some((e=>!e.hidden));ae(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let i=e;H(i)||(i=Object.values(this.elements.settings.panels).find((e=>!e.hidden)));const s=i.querySelector('[role^="menuitem"]');ue.call(this,s,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!H(t)||!H(i))return;const{hidden:s}=t;let n=s;if(O(e))n=e;else if(F(e)&&"Escape"===e.key)n=!1;else if(R(e)){const s=j(e.composedPath)?e.composedPath()[0]:e.target,a=t.contains(s);if(a||!a&&e.target!==i&&n)return}i.setAttribute("aria-expanded",n),ae(t,!n),le(this.elements.container,this.config.classNames.menu.open,n),n&&F(e)?We.focusFirstMenuItem.call(this,null,!0):n||s||ue.call(this,i,F(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const i=t.scrollWidth,s=t.scrollHeight;return te(t),{width:i,height:s}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!H(i))return;const s=i.parentNode,n=Array.from(s.children).find((e=>!e.hidden));if(me.transitions&&!me.reducedMotion){s.style.width=`${n.scrollWidth}px`,s.style.height=`${n.scrollHeight}px`;const e=We.getMenuSize.call(this,i),t=e=>{e.target===s&&["width","height"].includes(e.propertyName)&&(s.style.width="",s.style.height="",be.call(this,s,z,t))};fe.call(this,s,z,t),s.style.width=`${e.width}px`,s.style.height=`${e.height}px`}ae(n,!0),ae(i,!1),We.focusFirstMenuItem.call(this,i,t)},setDownloadUrl(){const e=this.elements.buttons.download;H(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:s,createRange:n,createTime:a,setQualityMenu:l,setSpeedMenu:o,showMenuPanel:r}=We;this.elements.controls=null,D(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const c=Z("div",ne(this.config.selectors.controls.wrapper));this.elements.controls=c;const h={class:"plyr__controls__item"};return Ce(D(this.config.controls)?this.config.controls:[]).forEach((l=>{if("restart"===l&&c.appendChild(i.call(this,"restart",h)),"rewind"===l&&c.appendChild(i.call(this,"rewind",h)),"play"===l&&c.appendChild(i.call(this,"play",h)),"fast-forward"===l&&c.appendChild(i.call(this,"fast-forward",h)),"progress"===l){const t=Z("div",{class:`${h.class} plyr__progress__container`}),i=Z("div",ne(this.config.selectors.progress));if(i.appendChild(n.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const e=Z("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=i,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===l&&c.appendChild(a.call(this,"currentTime",h)),"duration"===l&&c.appendChild(a.call(this,"duration",h)),"mute"===l||"volume"===l){let{volume:t}=this.elements;if(H(t)&&c.contains(t)||(t=Z("div",X({},h,{class:`${h.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===l&&t.appendChild(i.call(this,"mute")),"volume"===l&&!Y.isIos){const i={max:1,step:.05,value:this.config.volume};t.appendChild(n.call(this,"volume",X(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===l&&c.appendChild(i.call(this,"captions",h)),"settings"===l&&!W(this.config.settings)){const s=Z("div",X({},h,{class:`${h.class} plyr__menu`.trim(),hidden:""}));s.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const n=Z("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),a=Z("div"),l=Z("div",{id:`plyr-settings-${e.id}-home`}),o=Z("div",{role:"menu"});l.appendChild(o),a.appendChild(l),this.elements.settings.panels.home=l,this.config.settings.forEach((i=>{const s=Z("button",X(ne(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,s,i),fe.call(this,s,"click",(()=>{r.call(this,i,!1)}));const n=Z("span",null,He.get(i,this.config)),l=Z("span",{class:this.config.classNames.menu.value});l.innerHTML=e[i],n.appendChild(l),s.appendChild(n),o.appendChild(s);const c=Z("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),h=Z("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});h.appendChild(Z("span",{"aria-hidden":!0},He.get(i,this.config))),h.appendChild(Z("span",{class:this.config.classNames.hidden},He.get("menuBack",this.config))),fe.call(this,c,"keydown",(e=>{"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),r.call(this,"home",!0))}),!1),fe.call(this,h,"click",(()=>{r.call(this,"home",!1)})),c.appendChild(h),c.appendChild(Z("div",{role:"menu"})),a.appendChild(c),this.elements.settings.buttons[i]=s,this.elements.settings.panels[i]=c})),n.appendChild(a),s.appendChild(n),c.appendChild(s),this.elements.settings.popup=n,this.elements.settings.menu=s}if("pip"===l&&me.pip&&c.appendChild(i.call(this,"pip",h)),"airplay"===l&&me.airplay&&c.appendChild(i.call(this,"airplay",h)),"download"===l){const e=X({},h,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!U(t)&&this.isEmbed&&X(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===l&&c.appendChild(i.call(this,"fullscreen",h))})),this.isHTML5&&l.call(this,Le.getQualityOptions.call(this)),o.call(this),c},inject(){if(this.config.loadSprite){const e=We.getIconUrl.call(this);e.cors&&Ve(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i=!0;j(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),H(this.config.controls)||_(this.config.controls)?e=this.config.controls:(e=We.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Ye.getLabel.call(this)}),i=!1);let s;i&&_(this.config.controls)&&(e=(e=>{let i=e;return Object.entries(t).forEach((([e,t])=>{i=_e(i,`{${e}}`,t)})),i})(e)),_(this.config.selectors.controls.container)&&(s=document.querySelector(this.config.selectors.controls.container)),H(s)||(s=this.elements.container);if(s[H(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),H(this.elements.controls)||We.findElements.call(this),!W(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;e.setAttribute("aria-pressed","false"),Object.defineProperty(e,"pressed",{configurable:!0,enumerable:!0,get:()=>oe(e,t),set(i=!1){le(e,t,i),e.setAttribute("aria-pressed",i?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach((t=>{D(t)||q(t)?Array.from(t).filter(Boolean).forEach(e):e(t)}))}if(Y.isEdge&&K(s),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,s=ce.call(this,i);Array.from(s).forEach((e=>{le(e,this.config.classNames.hidden,!1),le(e,this.config.classNames.tooltip,!0)}))}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch(e){}},setMarkers(){var e,t;if(!this.duration||this.elements.markers)return;const i=null===(e=this.config.markers)||void 0===e||null===(t=e.points)||void 0===t?void 0:t.filter((({time:e})=>e>0&&ele(a,l,e);i.forEach((e=>{const t=Z("span",{class:this.config.classNames.marker},""),i=e.time/this.duration*100+"%";a&&(t.addEventListener("mouseenter",(()=>{e.label||(a.style.left=i,a.innerHTML=e.label,o(!0))})),t.addEventListener("mouseleave",(()=>{o(!1)}))),t.addEventListener("click",(()=>{this.currentTime=e.time})),t.style.left=i,n.appendChild(t)})),s.appendChild(n),this.config.tooltips.seek||(a=Z("span",{class:this.config.classNames.tooltip},""),s.appendChild(a)),this.elements.markers={points:n,tip:a},this.elements.progress.appendChild(s)}};function ze(e,t=!0){let i=e;if(t){const e=document.createElement("a");e.href=i,i=e.href}try{return new URL(i)}catch(e){return null}}function Ke(e){const t=new URLSearchParams;return L(e)&&Object.entries(e).forEach((([e,i])=>{t.set(e,i)})),t}const Ye={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!me.textTracks)return void(D(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&We.setCaptionsMenu.call(this));var e,t;if(H(this.elements.captions)||(this.elements.captions=Z("div",ne(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),e=this.elements.captions,t=this.elements.wrapper,H(e)&&H(t)&&t.parentNode.insertBefore(e,t.nextSibling)),Y.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach((e=>{const t=e.getAttribute("src"),i=ze(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&Fe(t,"blob").then((t=>{e.setAttribute("src",window.URL.createObjectURL(t))})).catch((()=>{te(e)}))}))}const i=Ce((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((e=>e.split("-")[0])));let s=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===s&&([s]=i);let n=this.storage.get("captions");if(O(n)||({active:n}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:n,language:s,languages:i}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";fe.call(this,this.media.textTracks,e,Ye.update.bind(this))}setTimeout(Ye.update.bind(this),0)},update(){const e=Ye.getTracks.call(this,!0),{active:t,language:i,meta:s,currentTrackNode:n}=this.captions,a=Boolean(e.find((e=>e.language===i)));this.isHTML5&&this.isVideo&&e.filter((e=>!s.get(e))).forEach((e=>{this.debug.log("Track added",e),s.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),fe.call(this,e,"cuechange",(()=>Ye.updateCues.call(this)))})),(a&&this.language!==i||!e.includes(n))&&(Ye.setLanguage.call(this,i),Ye.toggle.call(this,t&&a)),this.elements&&le(this.elements.container,this.config.classNames.captions.enabled,!W(e)),D(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&We.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,s=this.config.classNames.captions.active,n=I(e)?!i:e;if(n!==i){if(t||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!t){const e=Ye.getTracks.call(this),t=Ye.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void Ye.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),le(this.elements.container,s,n),this.captions.toggled=n,We.updateSetting.call(this,"captions"),ve.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout((()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")}))},set(e,t=!0){const i=Ye.getTracks.call(this);if(-1!==e)if($(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=i[e],{language:n}=s||{};this.captions.currentTrackNode=s,We.updateSetting.call(this,"captions"),t||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n),ve.call(this,this.media,"languagechange")}Ye.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Ye.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Ye.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!_(e))return void this.debug.warn("Invalid language argument",e);const i=e.toLowerCase();this.captions.language=i;const s=Ye.getTracks.call(this),n=Ye.findTrack.call(this,[i]);Ye.set.call(this,s.indexOf(n),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter((t=>!this.isHTML5||e||this.captions.meta.has(t))).filter((e=>["captions","subtitles"].includes(e.kind)))},findTrack(e,t=!1){const i=Ye.getTracks.call(this),s=e=>Number((this.captions.meta.get(e)||{}).default),n=Array.from(i).sort(((e,t)=>s(t)-s(e)));let a;return e.every((e=>(a=n.find((t=>t.language===e)),!a))),a||(t?n[0]:void 0)},getCurrentTrack(){return Ye.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!V(t)&&me.textTracks&&this.captions.toggled&&(t=Ye.getCurrentTrack.call(this)),V(t)?W(t.label)?W(t.language)?He.get("enabled",this.config):e.language.toUpperCase():t.label:He.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!H(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!I(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=Ye.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map((e=>e.getCueAsHTML())).map(De)}const i=t.map((e=>e.trim())).join("\n");if(i!==this.elements.captions.innerHTML){ie(this.elements.captions);const e=Z("span",ne(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),ve.call(this,this.media,"cuechange")}}},Qe={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.3/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},Xe="picture-in-picture",Je="inline",Ge={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Ze="audio",et="video";const tt=()=>{};class it{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):tt}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):tt}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):tt}}class st{constructor(t){e(this,"onChange",(()=>{if(!this.enabled)return;const e=this.player.elements.buttons.fullscreen;H(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;ve.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)})),e(this,"toggleFallback",((e=!1)=>{if(e?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",le(this.target,this.player.config.classNames.fullscreen.fallback,e),Y.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const s=_(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!s,s||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter((e=>e.trim()!==i)).join(","))}this.onChange()})),e(this,"trapFocus",(e=>{if(Y.isIos||!this.active||"Tab"!==e.key)return;const t=document.activeElement,i=ce.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[s]=i,n=i[i.length-1];t!==n||e.shiftKey?t===s&&e.shiftKey&&(n.focus(),e.preventDefault()):(s.focus(),e.preventDefault())})),e(this,"update",(()=>{if(this.enabled){let e;e=this.forceFallback?"Fallback (forced)":st.native?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");le(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)})),e(this,"enter",(()=>{this.enabled&&(Y.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!st.native||this.forceFallback?this.toggleFallback(!0):this.prefix?W(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))})),e(this,"exit",(()=>{if(this.enabled)if(Y.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),ke(this.player.play());else if(!st.native||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!W(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),e(this,"toggle",(()=>{this.active?this.exit():this.enter()})),this.player=t,this.prefix=st.prefix,this.property=st.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===t.config.fullscreen.fallback,this.player.elements.fullscreen=t.config.fullscreen.container&&function(e,t){const{prototype:i}=Element;return(i.closest||function(){let e=this;do{if(re.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,t.config.fullscreen.container),fe.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,(()=>{this.onChange()})),fe.call(this.player,this.player.elements.container,"dblclick",(e=>{H(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")})),fe.call(this,this.player.elements.container,"keydown",(e=>this.trapFocus(e))),this.update()}static get native(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get usingNative(){return st.native&&!this.forceFallback}static get prefix(){if(j(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some((t=>!(!j(document[`${t}ExitFullscreen`])&&!j(document[`${t}CancelFullScreen`]))&&(e=t,!0))),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get enabled(){return(st.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}get active(){if(!this.enabled)return!1;if(!st.native||this.forceFallback)return oe(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){return Y.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}function nt(e,t=1){return new Promise(((i,s)=>{const n=new Image,a=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=t?i:s)(n)};Object.assign(n,{onload:a,onerror:a,src:e})}))}const at={addStyleHook(){le(this.elements.container,this.config.selectors.container.replace(".",""),!0),le(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void at.toggleNativeControls.call(this,!0);H(this.elements.controls)||(We.inject.call(this),this.listeners.controls()),at.toggleNativeControls.call(this),this.isHTML5&&Ye.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,We.updateVolume.call(this),We.timeUpdate.call(this),We.durationUpdate.call(this),at.checkPlaying.call(this),le(this.elements.container,this.config.classNames.pip.supported,me.pip&&this.isHTML5&&this.isVideo),le(this.elements.container,this.config.classNames.airplay.supported,me.airplay&&this.isHTML5),le(this.elements.container,this.config.classNames.isIos,Y.isIos),le(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((()=>{ve.call(this,this.media,"ready")}),0),at.setTitle.call(this),this.poster&&at.setPoster.call(this,this.poster,!1).catch((()=>{})),this.config.duration&&We.durationUpdate.call(this),this.config.mediaMetadata&&We.setMediaMetadata.call(this)},setTitle(){let e=He.get("play",this.config);if(_(this.config.title)&&!W(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach((t=>{t.setAttribute("aria-label",e)})),this.isEmbed){const e=he.call(this,"iframe");if(!H(e))return;const t=W(this.config.title)?"video":this.config.title,i=He.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(e){le(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),Te.call(this).then((()=>nt(e))).catch((t=>{throw e===this.poster&&at.togglePoster.call(this,!1),t})).then((()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),at.togglePoster.call(this,!0),e))))},checkPlaying(e){le(this.elements.container,this.config.classNames.playing,this.playing),le(this.elements.container,this.config.classNames.paused,this.paused),le(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",He.get(this.playing?"pause":"play",this.config))})),R(e)&&"timeupdate"===e.type||at.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((()=>{le(this.elements.container,this.config.classNames.loading,this.loading),at.toggleControls.call(this)}),this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles(){Object.values({...this.media.style}).filter((e=>!W(e)&&_(e)&&e.startsWith("--plyr"))).forEach((e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)})),W(this.media.style)&&this.media.removeAttribute("style")}};class lt{constructor(t){e(this,"firstTouch",(()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,le(t.container,e.config.classNames.isTouch,!0)})),e(this,"setTabFocus",(e=>{const{player:t}=this,{elements:i}=t,{key:s,type:n,timeStamp:a}=e;if(clearTimeout(this.focusTimer),"keydown"===n&&"Tab"!==s)return;"keydown"===n&&(this.lastKeyDown=a);const l=a-this.lastKeyDown<=20;("focus"!==n||l)&&((()=>{const e=t.config.classNames.tabFocus;le(ce.call(t,`.${e}`),e,!1)})(),"focusout"!==n&&(this.focusTimer=setTimeout((()=>{const e=document.activeElement;i.container.contains(e)&&le(document.activeElement,t.config.classNames.tabFocus,!0)}),10)))})),e(this,"global",((e=!0)=>{const{player:t}=this;t.config.keyboard.global&&ge.call(t,window,"keydown keyup",this.handleKey,e,!1),ge.call(t,document.body,"click",this.toggleMenu,e),ye.call(t,document.body,"touchstart",this.firstTouch),ge.call(t,document.body,"keydown focus blur focusout",this.setTabFocus,e,!1,!0)})),e(this,"container",(()=>{const{player:e}=this,{config:t,elements:i,timers:s}=e;!t.keyboard.global&&t.keyboard.focused&&fe.call(e,i.container,"keydown keyup",this.handleKey,!1),fe.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(t=>{const{controls:n}=i;n&&"enterfullscreen"===t.type&&(n.pressed=!1,n.hover=!1);let a=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(at.toggleControls.call(e,!0),a=e.touch?3e3:2e3),clearTimeout(s.controls),s.controls=setTimeout((()=>at.toggleControls.call(e,!1)),a)}));const n=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;const t=i.wrapper,{active:s}=e.fullscreen,[n,a]=Ne.call(e),l=Se(`aspect-ratio: ${n} / ${a}`);if(!s)return void(l?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null));const[o,r]=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],c=o/r>n/a;l?(t.style.width=c?"auto":"100%",t.style.height=c?"100%":"auto"):(t.style.maxWidth=c?r/a*n+"px":null,t.style.margin=c?"0 auto":null)},a=()=>{clearTimeout(s.resized),s.resized=setTimeout(n,50)};fe.call(e,i.container,"enterfullscreen exitfullscreen",(t=>{const{target:s}=e.fullscreen;if(s!==i.container)return;if(!e.isEmbed&&W(e.config.ratio))return;n();("enterfullscreen"===t.type?fe:be).call(e,window,"resize",a)}))})),e(this,"media",(()=>{const{player:e}=this,{elements:t}=e;if(fe.call(e,e.media,"timeupdate seeking seeked",(t=>We.timeUpdate.call(e,t))),fe.call(e,e.media,"durationchange loadeddata loadedmetadata",(t=>We.durationUpdate.call(e,t))),fe.call(e,e.media,"ended",(()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())})),fe.call(e,e.media,"progress playing seeking seeked",(t=>We.updateProgress.call(e,t))),fe.call(e,e.media,"volumechange",(t=>We.updateVolume.call(e,t))),fe.call(e,e.media,"playing play pause ended emptied timeupdate",(t=>at.checkPlaying.call(e,t))),fe.call(e,e.media,"waiting canplay seeked playing",(t=>at.checkLoading.call(e,t))),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const i=he.call(e,`.${e.config.classNames.video}`);if(!H(i))return;fe.call(e,t.container,"click",(s=>{([t.container,i].includes(s.target)||i.contains(s.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(s,e.restart,"restart"),this.proxy(s,(()=>{ke(e.play())}),"play")):this.proxy(s,(()=>{ke(e.togglePlay())}),"play")))}))}e.supported.ui&&e.config.disableContextMenu&&fe.call(e,t.wrapper,"contextmenu",(e=>{e.preventDefault()}),!1),fe.call(e,e.media,"volumechange",(()=>{e.storage.set({volume:e.volume,muted:e.muted})})),fe.call(e,e.media,"ratechange",(()=>{We.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})})),fe.call(e,e.media,"qualitychange",(t=>{We.updateSetting.call(e,"quality",null,t.detail.quality)})),fe.call(e,e.media,"ready qualitychange",(()=>{We.setDownloadUrl.call(e)}));const i=e.config.events.concat(["keyup","keydown"]).join(" ");fe.call(e,e.media,i,(i=>{let{detail:s={}}=i;"error"===i.type&&(s=e.media.error),ve.call(e,t.container,i.type,!0,s)}))})),e(this,"proxy",((e,t,i)=>{const{player:s}=this,n=s.config.listeners[i];let a=!0;j(n)&&(a=n.call(s,e)),!1!==a&&j(t)&&t.call(s,e)})),e(this,"bind",((e,t,i,s,n=!0)=>{const{player:a}=this,l=a.config.listeners[s],o=j(l);fe.call(a,e,t,(e=>this.proxy(e,i,s)),n&&!o)})),e(this,"controls",(()=>{const{player:e}=this,{elements:t}=e,i=Y.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach((t=>{this.bind(t,"click",(()=>{ke(e.togglePlay())}),"play")})),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",(()=>{e.lastSeekTime=Date.now(),e.rewind()}),"rewind"),this.bind(t.buttons.fastForward,"click",(()=>{e.lastSeekTime=Date.now(),e.forward()}),"fastForward"),this.bind(t.buttons.mute,"click",(()=>{e.muted=!e.muted}),"mute"),this.bind(t.buttons.captions,"click",(()=>e.toggleCaptions())),this.bind(t.buttons.download,"click",(()=>{ve.call(e,e.media,"download")}),"download"),this.bind(t.buttons.fullscreen,"click",(()=>{e.fullscreen.toggle()}),"fullscreen"),this.bind(t.buttons.pip,"click",(()=>{e.pip="toggle"}),"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",(t=>{t.stopPropagation(),t.preventDefault(),We.toggleMenu.call(e,t)}),null,!1),this.bind(t.buttons.settings,"keyup",(t=>{["Space","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),We.toggleMenu.call(e,t)):We.focusFirstMenuItem.call(e,null,!0))}),null,!1),this.bind(t.settings.menu,"keydown",(t=>{"Escape"===t.key&&We.toggleMenu.call(e,t)})),this.bind(t.inputs.seek,"mousedown mousemove",(e=>{const i=t.progress.getBoundingClientRect(),s=100/i.width*(e.pageX-i.left);e.currentTarget.setAttribute("seek-value",s)})),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(t=>{const i=t.currentTarget,s="play-on-seeked";if(F(t)&&!["ArrowLeft","ArrowRight"].includes(t.key))return;e.lastSeekTime=Date.now();const n=i.hasAttribute(s),a=["mouseup","touchend","keyup"].includes(t.type);n&&a?(i.removeAttribute(s),ke(e.play())):!a&&e.playing&&(i.setAttribute(s,""),e.pause())})),Y.isIos){const t=ce.call(e,'input[type="range"]');Array.from(t).forEach((e=>this.bind(e,i,(e=>K(e.target)))))}this.bind(t.inputs.seek,i,(t=>{const i=t.currentTarget;let s=i.getAttribute("seek-value");W(s)&&(s=i.value),i.removeAttribute("seek-value"),e.currentTime=s/i.max*e.duration}),"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",(t=>We.updateSeekTooltip.call(e,t))),this.bind(t.progress,"mousemove touchmove",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startMove(t)})),this.bind(t.progress,"mouseleave touchend click",(()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)})),this.bind(t.progress,"mousedown touchstart",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startScrubbing(t)})),this.bind(t.progress,"mouseup touchend",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.endScrubbing(t)})),Y.isWebkit&&Array.from(ce.call(e,'input[type="range"]')).forEach((t=>{this.bind(t,"input",(t=>We.updateRangeFill.call(e,t.target)))})),e.config.toggleInvert&&!H(t.display.duration)&&this.bind(t.display.currentTime,"click",(()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,We.timeUpdate.call(e))})),this.bind(t.inputs.volume,i,(t=>{e.volume=t.target.value}),"volume"),this.bind(t.controls,"mouseenter mouseleave",(i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type})),t.fullscreen&&Array.from(t.fullscreen.children).filter((e=>!e.contains(t.container))).forEach((i=>{this.bind(i,"mouseenter mouseleave",(i=>{t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===i.type)}))})),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",(e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(t.controls,"focusin",(()=>{const{config:i,timers:s}=e;le(t.controls,i.classNames.noTransition,!0),at.toggleControls.call(e,!0),setTimeout((()=>{le(t.controls,i.classNames.noTransition,!1)}),0);const n=this.touch?3e3:4e3;clearTimeout(s.controls),s.controls=setTimeout((()=>at.toggleControls.call(e,!1)),n)})),this.bind(t.inputs.volume,"wheel",(t=>{const i=t.webkitDirectionInvertedFromDevice,[s,n]=[t.deltaX,-t.deltaY].map((e=>i?-e:e)),a=Math.sign(Math.abs(s)>Math.abs(n)?s:n);e.increaseVolume(a/50);const{volume:l}=e.media;(1===a&&l<1||-1===a&&l>0)&&t.preventDefault()}),"volume",!1)})),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:i}=t,{key:s,type:n,altKey:a,ctrlKey:l,metaKey:o,shiftKey:r}=e,c="keydown"===n,h=c&&s===this.lastKey;if(a||l||o||r)return;if(!s)return;if(c){const n=document.activeElement;if(H(n)){const{editable:s}=t.config.selectors,{seek:a}=i.inputs;if(n!==a&&re(n,s))return;if("Space"===e.key&&re(n,'button, [role^="menuitem"]'))return}switch(["Space","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(s)&&(e.preventDefault(),e.stopPropagation()),s){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":h||(u=parseInt(s,10),t.currentTime=t.duration/10*u);break;case"Space":case"k":h||ke(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":h||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":h||t.toggleCaptions();break;case"l":t.loop=!t.loop}"Escape"===s&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=s}else this.lastKey=null;var u}toggleMenu(e){We.toggleMenu.call(this.player,e)}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var ot=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){e.exports=function(){var e=function(){},t={},i={},s={};function n(e,t){e=e.push?e:[e];var n,a,l,o=[],r=e.length,c=r;for(n=function(e,i){i.length&&o.push(e),--c||t(o)};r--;)a=e[r],(l=i[a])?n(a,l):(s[a]=s[a]||[]).push(n)}function a(e,t){if(e){var n=s[e];if(i[e]=t,n)for(;n.length;)n[0](e,t),n.splice(0,1)}}function l(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function o(t,i,s,n){var a,l,r=document,c=s.async,h=(s.numRetries||0)+1,u=s.before||e,d=t.replace(/[\?|#].*$/,""),m=t.replace(/^(css|img)!/,"");n=n||0,/(^css!|\.css$)/.test(d)?((l=r.createElement("link")).rel="stylesheet",l.href=m,(a="hideFocus"in l)&&l.relList&&(a=0,l.rel="preload",l.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(d)?(l=r.createElement("img")).src=m:((l=r.createElement("script")).src=t,l.async=void 0===c||c),l.onload=l.onerror=l.onbeforeload=function(e){var r=e.type[0];if(a)try{l.sheet.cssText.length||(r="e")}catch(e){18!=e.code&&(r="e")}if("e"==r){if((n+=1){ot(e,{success:t,error:i})}))}function ct(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ve.call(this,this.media,e?"play":"pause"))}const ht={setup(){const e=this;le(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,xe.call(e),L(window.Vimeo)?ht.ready.call(e):rt(e.config.urls.vimeo.sdk).then((()=>{ht.ready.call(e)})).catch((t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)}))},ready(){const e=this,t=e.config.vimeo,{premium:i,referrerPolicy:s,...n}=t;let a=e.media.getAttribute("src"),l="";W(a)?(a=e.media.getAttribute(e.config.attributes.embed.id),l=e.media.getAttribute(e.config.attributes.embed.hash)):l=function(e){const t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}(a);const o=l?{h:l}:{};i&&Object.assign(n,{controls:!1,sidedock:!1});const r=Ke({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative,...o,...n}),c=W(h=a)?null:$(Number(h))?h:h.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:h;var h;const u=Z("iframe"),d=$e(e.config.urls.vimeo.iframe,c,r);if(u.setAttribute("src",d),u.setAttribute("allowfullscreen",""),u.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),W(s)||u.setAttribute("referrerPolicy",s),i||!t.customControls)u.setAttribute("data-poster",e.poster),e.media=se(u,e.media);else{const t=Z("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(u),e.media=se(t,e.media)}t.customControls||Fe($e(e.config.urls.vimeo.api,d)).then((t=>{!W(t)&&t.thumbnail_url&&at.setPoster.call(e,t.thumbnail_url).catch((()=>{}))})),e.embed=new window.Vimeo.Player(u,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(ct.call(e,!0),e.embed.play()),e.media.pause=()=>(ct.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:m}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>m,set(t){const{embed:i,media:s,paused:n,volume:a}=e,l=n&&!i.hasPlayed;s.seeking=!0,ve.call(e,s,"seeking"),Promise.resolve(l&&i.setVolume(0)).then((()=>i.setCurrentTime(t))).then((()=>l&&i.pause())).then((()=>l&&i.setVolume(a))).catch((()=>{}))}});let p=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>p,set(t){e.embed.setPlaybackRate(t).then((()=>{p=t,ve.call(e,e.media,"ratechange")})).catch((()=>{e.options.speed=[1]}))}});let{volume:g}=e.config;Object.defineProperty(e.media,"volume",{get:()=>g,set(t){e.embed.setVolume(t).then((()=>{g=t,ve.call(e,e.media,"volumechange")}))}});let{muted:f}=e.config;Object.defineProperty(e.media,"muted",{get:()=>f,set(t){const i=!!O(t)&&t;e.embed.setVolume(i?0:e.config.volume).then((()=>{f=i,ve.call(e,e.media,"volumechange")}))}});let b,{loop:y}=e.config;Object.defineProperty(e.media,"loop",{get:()=>y,set(t){const i=O(t)?t:e.config.loop.active;e.embed.setLoop(i).then((()=>{y=i}))}}),e.embed.getVideoUrl().then((t=>{b=t,We.setDownloadUrl.call(e)})).catch((e=>{this.debug.warn(e)})),Object.defineProperty(e.media,"currentSrc",{get:()=>b}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then((t=>{const[i,s]=t;e.embed.ratio=Ie(i,s),xe.call(this)})),e.embed.setAutopause(e.config.autopause).then((t=>{e.config.autopause=t})),e.embed.getVideoTitle().then((t=>{e.config.title=t,at.setTitle.call(this)})),e.embed.getCurrentTime().then((t=>{m=t,ve.call(e,e.media,"timeupdate")})),e.embed.getDuration().then((t=>{e.media.duration=t,ve.call(e,e.media,"durationchange")})),e.embed.getTextTracks().then((t=>{e.media.textTracks=t,Ye.setup.call(e)})),e.embed.on("cuechange",(({cues:t=[]})=>{const i=t.map((e=>function(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.innerText}(e.text)));Ye.updateCues.call(e,i)})),e.embed.on("loaded",(()=>{if(e.embed.getPaused().then((t=>{ct.call(e,!t),t||ve.call(e,e.media,"playing")})),H(e.embed.element)&&e.supported.ui){e.embed.element.setAttribute("tabindex",-1)}})),e.embed.on("bufferstart",(()=>{ve.call(e,e.media,"waiting")})),e.embed.on("bufferend",(()=>{ve.call(e,e.media,"playing")})),e.embed.on("play",(()=>{ct.call(e,!0),ve.call(e,e.media,"playing")})),e.embed.on("pause",(()=>{ct.call(e,!1)})),e.embed.on("timeupdate",(t=>{e.media.seeking=!1,m=t.seconds,ve.call(e,e.media,"timeupdate")})),e.embed.on("progress",(t=>{e.media.buffered=t.percent,ve.call(e,e.media,"progress"),1===parseInt(t.percent,10)&&ve.call(e,e.media,"canplaythrough"),e.embed.getDuration().then((t=>{t!==e.media.duration&&(e.media.duration=t,ve.call(e,e.media,"durationchange"))}))})),e.embed.on("seeked",(()=>{e.media.seeking=!1,ve.call(e,e.media,"seeked")})),e.embed.on("ended",(()=>{e.media.paused=!0,ve.call(e,e.media,"ended")})),e.embed.on("error",(t=>{e.media.error=t,ve.call(e,e.media,"error")})),t.customControls&&setTimeout((()=>at.build.call(e)),0)}};function ut(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ve.call(this,this.media,e?"play":"pause"))}function dt(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const mt={setup(){if(le(this.elements.wrapper,this.config.classNames.embed,!0),L(window.YT)&&j(window.YT.Player))mt.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{j(e)&&e(),mt.ready.call(this)},rt(this.config.urls.youtube.sdk).catch((e=>{this.debug.warn("YouTube API failed to load",e)}))}},getTitle(e){Fe($e(this.config.urls.youtube.api,e)).then((e=>{if(L(e)){const{title:t,height:i,width:s}=e;this.config.title=t,at.setTitle.call(this),this.embed.ratio=Ie(s,i)}xe.call(this)})).catch((()=>{xe.call(this)}))},ready(){const e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(!W(i)&&i.startsWith("youtube-"))return;let s=e.media.getAttribute("src");W(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const n=W(a=s)?null:a.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:a;var a;const l=Z("div",{id:`${e.provider}-${Math.floor(1e4*Math.random())}`,"data-poster":t.customControls?e.poster:void 0});if(e.media=se(l,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${n}/${e}default.jpg`;nt(t("maxres"),121).catch((()=>nt(t("sd"),121))).catch((()=>nt(t("hq")))).then((t=>at.setPoster.call(e,t.src))).then((t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((()=>{}))}e.embed=new window.YT.Player(e.media,{videoId:n,host:dt(t),playerVars:X({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(t){if(!e.media.error){const i=t.data,s={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occured";e.media.error={code:i,message:s},ve.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),ve.call(e,e.media,"ratechange")},onReady(i){if(j(e.media.play))return;const s=i.target;mt.getTitle.call(e,n),e.media.play=()=>{ut.call(e,!0),s.playVideo()},e.media.pause=()=>{ut.call(e,!1),s.pauseVideo()},e.media.stop=()=>{s.stopVideo()},e.media.duration=s.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(s.getCurrentTime()),set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,ve.call(e,e.media,"seeking"),s.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>s.getPlaybackRate(),set(e){s.setPlaybackRate(e)}});let{volume:a}=e.config;Object.defineProperty(e.media,"volume",{get:()=>a,set(t){a=t,s.setVolume(100*a),ve.call(e,e.media,"volumechange")}});let{muted:l}=e.config;Object.defineProperty(e.media,"muted",{get:()=>l,set(t){const i=O(t)?t:l;l=i,s[i?"mute":"unMute"](),s.setVolume(100*a),ve.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>s.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const o=s.getAvailablePlaybackRates();e.options.speed=o.filter((t=>e.config.speed.options.includes(t))),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),ve.call(e,e.media,"timeupdate"),ve.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((()=>{e.media.buffered=s.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBufferedat.build.call(e)),50)},onStateChange(i){const s=i.target;clearInterval(e.timers.playing);switch(e.media.seeking&&[1,2].includes(i.data)&&(e.media.seeking=!1,ve.call(e,e.media,"seeked")),i.data){case-1:ve.call(e,e.media,"timeupdate"),e.media.buffered=s.getVideoLoadedFraction(),ve.call(e,e.media,"progress");break;case 0:ut.call(e,!1),e.media.loop?(s.stopVideo(),s.playVideo()):ve.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(ut.call(e,!0),ve.call(e,e.media,"playing"),e.timers.playing=setInterval((()=>{ve.call(e,e.media,"timeupdate")}),50),e.media.duration!==s.getDuration()&&(e.media.duration=s.getDuration(),ve.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),ut.call(e,!1);break;case 3:ve.call(e,e.media,"waiting")}ve.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}},pt={setup(){this.media?(le(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),le(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&le(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=Z("div",{class:this.config.classNames.video}),J(this.media,this.elements.wrapper),this.elements.poster=Z("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Le.setup.call(this):this.isYouTube?mt.setup.call(this):this.isVimeo&&ht.setup.call(this)):this.debug.warn("No media element found!")}};class gt{constructor(t){e(this,"load",(()=>{this.enabled&&(L(window.google)&&L(window.google.ima)?this.ready():rt(this.player.config.urls.googleIMA.sdk).then((()=>{this.ready()})).catch((()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))})))})),e(this,"ready",(()=>{var e;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then((()=>{this.clearSafetyTimer("onAdsManagerLoaded()")})),this.listeners(),this.setupIMA()})),e(this,"setupIMA",(()=>{this.elements.container=Z("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(e=>this.onAdsManagerLoaded(e)),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e)),!1),this.requestAds()})),e(this,"requestAds",(()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}})),e(this,"pollCountdown",((e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval((()=>{const e=Ue(Math.max(this.manager.getRemainingTime(),0)),t=`${He.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)}),100)})),e(this,"onAdsManagerLoaded",(e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e))),Object.keys(google.ima.AdEvent.Type).forEach((e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],(e=>this.onAdEvent(e)))})),this.trigger("loaded")})),e(this,"addCuePoints",(()=>{W(this.cuePoints)||this.cuePoints.forEach((e=>{if(0!==e&&-1!==e&&e{const{container:t}=this.player.elements,i=e.getAd(),s=e.getAdData();switch((e=>{ve.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)})(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:s.adError&&this.player.debug.warn(`Non-fatal ad error: ${s.adError.getMessage()}`)}})),e(this,"onAdError",(e=>{this.cancel(),this.player.debug.warn("Ads error",e)})),e(this,"listeners",(()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",(()=>{this.addCuePoints()})),this.player.on("ended",(()=>{this.loader.contentComplete()})),this.player.on("timeupdate",(()=>{t=this.player.currentTime})),this.player.on("seeked",(()=>{const e=this.player.currentTime;W(this.cuePoints)||this.cuePoints.forEach(((i,s)=>{t{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)}))})),e(this,"play",(()=>{const{container:e}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then((()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(e){this.onAdError(e)}})).catch((()=>{}))})),e(this,"resumeContent",(()=>{this.elements.container.style.zIndex="",this.playing=!1,ke(this.player.media.play())})),e(this,"pauseContent",(()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()})),e(this,"cancel",(()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()})),e(this,"loadAds",(()=>{this.managerPromise.then((()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise((e=>{this.on("loaded",e),this.player.debug.log(this.manager)})),this.initialized=!1,this.requestAds()})).catch((()=>{}))})),e(this,"trigger",((e,...t)=>{const i=this.events[e];D(i)&&i.forEach((e=>{j(e)&&e.apply(this,t)}))})),e(this,"on",((e,t)=>(D(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this))),e(this,"startSafetyTimer",((e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout((()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")}),e)})),e(this,"clearSafetyTimer",(e=>{I(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)})),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(((e,t)=>{this.on("loaded",e),this.on("error",t)})),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!W(e.publisherId)||U(e.tagUrl))}get tagUrl(){const{config:e}=this;if(U(e.tagUrl))return e.tagUrl;return`https://go.aniview.com/api/adserver6/vast/?${Ke({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}function ft(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}const bt=e=>{const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach((e=>{const i={};e.split(/\r\n|\n|\r/).forEach((e=>{if($(i.startTime)){if(!W(e.trim())&&W(i.text)){const t=e.trim().split("#xywh=");[i.text]=t,t[1]&&([i.x,i.y,i.w,i.h]=t[1].split(","))}}else{const t=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);t&&(i.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),i.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}})),i.text&&t.push(i)})),t},yt=(e,t)=>{const i={};return e>t.width/t.height?(i.width=t.width,i.height=1/e*t.width):(i.height=t.height,i.width=e*t.height),i};class vt{constructor(t){e(this,"load",(()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then((()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.loaded=!0)}))})),e(this,"getThumbnails",(()=>new Promise((e=>{const{src:t}=this.player.config.previewThumbnails;if(W(t))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort(((e,t)=>e.height-t.height)),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(j(t))t((e=>{this.thumbnails=e,i()}));else{const e=(_(t)?[t]:t).map((e=>this.getThumbnail(e)));Promise.all(e).then(i)}})))),e(this,"getThumbnail",(e=>new Promise((t=>{Fe(e).then((i=>{const s={frames:bt(i),height:null,urlPrefix:""};s.frames[0].text.startsWith("/")||s.frames[0].text.startsWith("http://")||s.frames[0].text.startsWith("https://")||(s.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const n=new Image;n.onload=()=>{s.height=n.naturalHeight,s.width=n.naturalWidth,this.thumbnails.push(s),t()},n.src=s.urlPrefix+s.frames[0].text}))})))),e(this,"startMove",(e=>{if(this.loaded&&R(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t,i;const s=this.player.elements.progress.getBoundingClientRect(),n=100/s.width*(e.pageX-s.left);this.seekTime=this.player.media.duration*(n/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=Ue(this.seekTime);const a=null===(t=this.player.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((({time:e})=>e===Math.round(this.seekTime)));a&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${a.label}
    `)}this.showImageAtCurrentTime()}})),e(this,"endMove",(()=>{this.toggleThumbContainer(!1,!0)})),e(this,"startScrubbing",(e=>{(I(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))})),e(this,"endScrubbing",(()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):ye.call(this.player,this.player.media,"timeupdate",(()=>{this.mouseDown||this.toggleScrubbingContainer(!1)}))})),e(this,"listeners",(()=>{this.player.on("play",(()=>{this.toggleThumbContainer(!1,!0)})),this.player.on("seeked",(()=>{this.toggleThumbContainer(!1)})),this.player.on("timeupdate",(()=>{this.lastTime=this.player.media.currentTime}))})),e(this,"render",(()=>{this.elements.thumb.container=Z("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=Z("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=Z("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=Z("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(e),H(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=Z("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)})),e(this,"destroy",(()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()})),e(this,"showImageAtCurrentTime",(()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex((e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime)),t=e>=0;let i=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach(((t,s)=>{this.loadedImages.includes(t.frames[e].text)&&(i=s)})),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))})),e(this,"loadImage",((e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:s}=i,n=i.frames[t],a=i.frames[t].text,l=s+a;if(this.currentImageElement&&this.currentImageElement.dataset.filename===a)this.showImage(this.currentImageElement,n,e,t,a,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const i=new Image;i.src=l,i.dataset.index=t,i.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${l}`),i.onload=()=>this.showImage(i,n,e,t,a,!0),this.loadingImage=i,this.removeOldImages(i)}})),e(this,"showImage",((e,t,i,s,n,a=!0)=>{this.player.debug.log(`Showing thumb: ${n}. num: ${s}. qual: ${i}. newimg: ${a}`),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(n)||this.loadedImages.push(n)),this.preloadNearby(s,!0).then(this.preloadNearby(s,!1)).then(this.getHigherQuality(i,e,t,n))})),e(this,"removeOldImages",(e=>{Array.from(this.currentImageContainer.children).forEach((t=>{if("img"!==t.tagName.toLowerCase())return;const i=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout((()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)}),i)}}))})),e(this,"preloadNearby",((e,t=!0)=>new Promise((i=>{setTimeout((()=>{const s=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===s){let n;n=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let a=!1;n.forEach((e=>{const t=e.text;if(t!==s&&!this.loadedImages.includes(t)){a=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],s=e+t,n=new Image;n.src=s,n.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}})),a||i()}}),300)})))),e(this,"getHigherQuality",((e,t,i,s)=>{if(e{this.showingThumbFilename===s&&(this.player.debug.log(`Showing higher quality thumb for: ${s}`),this.loadImage(e+1))}),300)}})),e(this,"toggleThumbContainer",((e=!1,t=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)})),e(this,"toggleScrubbingContainer",((e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)})),e(this,"determineContainerAutoSizing",(()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)})),e(this,"setThumbContainerSizeAndPos",(()=>{const{imageContainer:e}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){const t=Math.floor(e.clientHeight*this.thumbAspectRatio);e.style.width=`${t}px`}else if(e.clientHeight<20&&e.clientWidth>20){const t=Math.floor(e.clientWidth/this.thumbAspectRatio);e.style.height=`${t}px`}}else{const t=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);e.style.height=`${this.thumbContainerHeight}px`,e.style.width=`${t}px`}this.setThumbContainerPos()})),e(this,"setThumbContainerPos",(()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,s=t.left-e.left+10,n=t.right-e.left-i.clientWidth-10,a=this.mousePosX-e.left-i.clientWidth/2,l=ft(a,s,n);i.style.left=`${l}px`,i.style.setProperty("--preview-arrow-offset",a-l+"px")})),e(this,"setScrubbingContainerSize",(()=>{const{width:e,height:t}=yt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`})),e(this,"setImageSizeAndOffset",((e,t)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left=`-${t.x*i}px`,e.style.top=`-${t.y*i}px`})),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=yt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const wt={insertElements(e,t){_(t)?ee(e,this.media,{src:t}):D(t)&&t.forEach((t=>{ee(e,this.media,t)}))},change(e){Q(e,"sources.length")?(Le.cancelRequests.call(this),this.destroy.call(this,(()=>{this.options.quality=[],te(this.media),this.media=null,H(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:s=Ge.html5,src:n}]=t,a="html5"===s?i:"div",l="html5"===s?{}:{src:n};Object.assign(this,{provider:s,type:i,supported:me.check(i,s,this.config.playsinline),media:Z(a,l)}),this.elements.container.appendChild(this.media),O(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),W(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),at.addStyleHook.call(this),this.isHTML5&&wt.insertElements.call(this,"source",t),this.config.title=e.title,pt.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&wt.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&at.build.call(this),this.isHTML5&&this.media.load(),W(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new vt(this))),this.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};class Tt{constructor(t,i){if(e(this,"play",(()=>j(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((()=>this.ads.play())).catch((()=>ke(this.media.play()))),this.media.play()):null)),e(this,"pause",(()=>this.playing&&j(this.media.pause)?this.media.pause():null)),e(this,"togglePlay",(e=>(O(e)?e:!this.playing)?this.play():this.pause())),e(this,"stop",(()=>{this.isHTML5?(this.pause(),this.restart()):j(this.media.stop)&&this.media.stop()})),e(this,"restart",(()=>{this.currentTime=0})),e(this,"rewind",(e=>{this.currentTime-=$(e)?e:this.config.seekTime})),e(this,"forward",(e=>{this.currentTime+=$(e)?e:this.config.seekTime})),e(this,"increaseVolume",(e=>{const t=this.media.muted?0:this.volume;this.volume=t+($(e)?e:0)})),e(this,"decreaseVolume",(e=>{this.increaseVolume(-e)})),e(this,"airplay",(()=>{me.airplay&&this.media.webkitShowPlaybackTargetPicker()})),e(this,"toggleControls",(e=>{if(this.supported.ui&&!this.isAudio){const t=oe(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,s=le(this.elements.container,this.config.classNames.hideControls,i);if(s&&D(this.config.controls)&&this.config.controls.includes("settings")&&!W(this.config.settings)&&We.toggleMenu.call(this,!1),s!==t){const e=s?"controlshidden":"controlsshown";ve.call(this,this.media,e)}return!s}return!1})),e(this,"on",((e,t)=>{fe.call(this,this.elements.container,e,t)})),e(this,"once",((e,t)=>{ye.call(this,this.elements.container,e,t)})),e(this,"off",((e,t)=>{be(this.elements.container,e,t)})),e(this,"destroy",((e,t=!1)=>{if(!this.ready)return;const i=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(te(this.elements.buttons.play),te(this.elements.captions),te(this.elements.controls),te(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),j(e)&&e()):(we.call(this),Le.cancelRequests.call(this),se(this.elements.original,this.elements.container),ve.call(this,this.elements.original,"destroyed",!0),j(e)&&e.call(this.elements.original),this.ready=!1,setTimeout((()=>{this.elements=null,this.media=null}),200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(at.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&j(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))})),e(this,"supports",(e=>me.mime.call(this,e))),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=me.touch,this.media=t,_(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||q(this.media)||D(this.media))&&(this.media=this.media[0]),this.config=X({},Qe,Tt.defaults,i||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch(e){return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new it(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",me),I(this.media)||!H(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!me.check().api)return void this.debug.error("Setup failed: no support");const s=this.media.cloneNode(!0);s.autoplay=!1,this.elements.original=s;const n=this.media.tagName.toLowerCase();let a=null,l=null;switch(n){case"div":if(a=this.media.querySelector("iframe"),H(a)){if(l=ze(a.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Ge.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Ge.vimeo:null}(l.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className="",l.search.length){const e=["1","true"];e.includes(l.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(l.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(l.searchParams.get("playsinline")),this.config.youtube.hl=l.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(W(this.provider)||!Object.values(Ge).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=et;break;case"video":case"audio":this.type=n,this.provider=Ge.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=me.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new lt(this),this.storage=new Re(this),this.media.plyr=this,H(this.elements.container)||(this.elements.container=Z("div",{tabindex:0}),J(this.media,this.elements.container)),at.migrateStyles.call(this),at.addStyleHook.call(this),pt.setup.call(this),this.config.debug&&fe.call(this,this.elements.container,this.config.events.join(" "),(e=>{this.debug.log(`event: ${e.type}`)})),this.fullscreen=new st(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&at.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new gt(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(()=>ke(this.play()))),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new vt(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===Ge.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Ge.youtube}get isVimeo(){return this.provider===Ge.vimeo}get isVideo(){return this.type===et}get isAudio(){return this.type===Ze}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=$(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return $(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=parseFloat(this.config.duration),t=(this.media||{}).duration,i=$(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;_(t)&&(t=Number(t)),$(t)||(t=this.storage.get("volume")),$(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!W(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;O(t)||(t=this.storage.get("muted")),O(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}set speed(e){let t=null;$(e)&&(t=e),$(t)||(t=this.storage.get("speed")),$(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:s}=this;t=ft(t,i,s),this.config.speed.selected=t,setTimeout((()=>{this.media&&(this.media.playbackRate=t)}),0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let s=[!W(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find($),n=!0;if(!i.includes(s)){const e=Ae(i,s);this.debug.warn(`Unsupported quality option: ${s}, using ${e} instead`),s=e,n=!1}t.selected=s,this.media.quality=s,n&&this.storage.set({quality:s})}get quality(){return this.media.quality}set loop(e){const t=O(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){wt.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return U(e)?e:this.source}set download(e){U(e)&&(this.config.urls.download=e,We.setDownloadUrl.call(this))}set poster(e){this.isVideo?at.setPoster.call(this,e,!1).catch((()=>{})):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=Me(Ne.call(this));return D(e)?e.join(":"):e}set ratio(e){this.isVideo?_(e)&&Pe(e)?(this.config.ratio=Me(e),xe.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=O(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){Ye.toggle.call(this,e,!1)}set currentTrack(e){Ye.set.call(this,e,!1),Ye.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){Ye.setLanguage.call(this,e,!1)}get language(){return(Ye.getCurrentTrack.call(this)||{}).language}set pip(e){if(!me.pip)return;const t=O(e)?e:!this.pip;j(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?Xe:Je),j(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return me.pip?W(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Xe:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new vt(this))}static supported(e,t,i){return me.check(e,t,i)}static loadSprite(e,t){return Ve(e,t)}static setup(e,t={}){let i=null;return _(e)?i=Array.from(document.querySelectorAll(e)):q(e)?i=Array.from(e):D(e)&&(i=e.filter(H)),W(i)?null:i.map((e=>new Tt(e,t)))}}var kt;return Tt.defaults=(kt=Qe,JSON.parse(JSON.stringify(kt))),Tt})); 2 | //# sourceMappingURL=plyr.min.js.map --------------------------------------------------------------------------------