@snapcall/stream-ui 1.11.4 → 1.11.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stream-ui.esm.js +68 -19
- package/dist/stream-ui.js +68 -19
- package/dist/stream-ui.umd.js +216 -216
- package/dist/types.d.ts +8 -1
- package/package.json +1 -1
package/dist/stream-ui.esm.js
CHANGED
|
@@ -1048,8 +1048,10 @@ var $82e31ca38889c079$export$2e2bcd8739ae039 = $82e31ca38889c079$var$AudioRender
|
|
|
1048
1048
|
const $850842193b726422$export$218be676a714a9df = '<svg width="103" height="36" fill="none" xmlns="http://www.w3.org/2000/svg"><g opacity=".8" fill="#fff"><path d="M10.994 33.06c.903 0 1.658-.734 1.392-1.581a5.249 5.249 0 0 0-1.279-2.124 5.171 5.171 0 0 0-3.673-1.535 5.171 5.171 0 0 0-3.673 1.535c-.595.6-1.03 1.33-1.28 2.124-.265.847.49 1.582 1.393 1.582h7.12ZM10.65 16.2c-.902 0-1.658.735-1.392 1.582.25.794.685 1.524 1.28 2.124a5.171 5.171 0 0 0 3.672 1.535 5.172 5.172 0 0 0 3.674-1.535 5.25 5.25 0 0 0 1.279-2.124c.266-.847-.49-1.582-1.393-1.582h-7.12ZM14.21 31.455c0 .887.75 1.63 1.606 1.35a5.187 5.187 0 0 0 2.067-1.279 5.264 5.264 0 0 0 1.521-3.706c0-1.39-.547-2.723-1.52-3.705a5.187 5.187 0 0 0-2.068-1.278c-.856-.281-1.606.462-1.606 1.349v7.27ZM7.434 17.806c0-.887-.75-1.63-1.607-1.35a5.186 5.186 0 0 0-2.066 1.279 5.264 5.264 0 0 0-1.522 3.706c0 1.39.548 2.723 1.522 3.705a5.186 5.186 0 0 0 2.066 1.278c.857.281 1.607-.462 1.607-1.349v-7.27Z"/><path d="M32.965 31.098c-1.442 0-2.601-.227-3.478-.68-.865-.465-1.517-1.043-1.955-1.734a.416.416 0 0 1-.052-.187c0-.125.057-.227.173-.306l.986-.731a.286.286 0 0 1 .208-.085c.103 0 .201.062.294.187.773 1.224 2.07 1.836 3.893 1.836.796 0 1.471-.142 2.025-.425.565-.284.848-.737.848-1.36 0-.465-.161-.827-.485-1.088-.311-.26-.796-.493-1.453-.697-.6-.181-.975-.289-1.125-.323-.992-.283-1.707-.504-2.146-.663-1.107-.408-1.84-.878-2.198-1.41-.357-.534-.536-1.089-.536-1.667 0-.476.15-.986.45-1.53.311-.555.796-1.025 1.453-1.41.67-.397 1.506-.595 2.51-.595 1.05 0 1.932.13 2.647.39.716.25 1.396.67 2.042 1.258.081.08.121.159.121.238 0 .114-.057.204-.173.272l-1.107.731a.469.469 0 0 1-.225.085c-.104 0-.202-.05-.294-.153-.692-.725-1.644-1.088-2.856-1.088-.692 0-1.228.102-1.609.306-.37.204-.617.431-.744.68-.115.25-.173.47-.173.663 0 .408.162.737.485.986.323.25.801.476 1.436.68.058.023.502.153 1.332.391.52.136 1.056.29 1.61.46 1.21.396 2.019.9 2.422 1.512.416.612.623 1.201.623 1.768 0 .612-.15 1.196-.45 1.75-.288.556-.801 1.02-1.54 1.395-.727.362-1.713.544-2.959.544ZM44.114 21.766c.865 0 1.667.249 2.405.748.739.487 1.108 1.388 1.108 2.702v5.321a.364.364 0 0 1-.104.272c-.058.057-.144.085-.26.085H46.14a.423.423 0 0 1-.277-.085.407.407 0 0 1-.087-.272v-5.032c-.035-.646-.22-1.155-.554-1.53-.323-.373-.744-.56-1.263-.56-.37 0-.738.102-1.107.306-.358.192-.664.492-.918.9-.253.397-.403.896-.45 1.496v4.42a.365.365 0 0 1-.103.272c-.058.057-.145.085-.26.085h-1.125a.423.423 0 0 1-.276-.085.407.407 0 0 1-.087-.272v-8.193c0-.114.029-.199.087-.255a.378.378 0 0 1 .276-.102h1.125c.116 0 .202.034.26.102.069.056.103.141.103.255v.204c0 .079.012.141.035.187a.168.168 0 0 0 .121.05c.092 0 .214-.062.364-.186a4.02 4.02 0 0 1 1.038-.612c.38-.148.738-.221 1.073-.221ZM57.436 28.207c.023.34.081.607.173.8.093.18.289.322.589.424.184.068.277.165.277.29a.396.396 0 0 1-.052.17l-.485.951c-.092.204-.242.278-.45.221-.669-.147-1.13-.47-1.384-.969-.058-.124-.115-.187-.173-.187-.058 0-.121.046-.19.136-.6.714-1.575 1.071-2.925 1.071-.819 0-1.482-.141-1.99-.425-.496-.283-.848-.623-1.056-1.02-.207-.408-.311-.799-.311-1.173 0-.612.19-1.161.571-1.648.392-.488.975-.828 1.748-1.02.53-.125 1.269-.221 2.215-.29.646-.045 1.113-.09 1.401-.135.231-.034.335-.17.312-.408-.058-.51-.23-.918-.52-1.224-.276-.318-.743-.476-1.4-.476-.428 0-.837.09-1.23.272-.38.17-.674.47-.882.9-.104.216-.254.29-.45.222l-1.055-.29c-.185-.056-.277-.152-.277-.288 0-.034.011-.085.034-.153a3.292 3.292 0 0 1 1.367-1.564c.635-.397 1.46-.595 2.475-.595.992 0 1.834.255 2.526.765.693.498 1.062 1.224 1.108 2.176.011.453.017 1.06.017 1.819.012.759.017 1.308.017 1.648Zm-4.326 1.445c.312 0 .652-.073 1.021-.22.38-.148.715-.403 1.004-.766.3-.374.484-.872.554-1.495v-.034c0-.114-.035-.199-.104-.256-.07-.067-.162-.09-.277-.067l-.675.067c-.75.069-1.361.148-1.834.238-.462.08-.86.227-1.194.442a.984.984 0 0 0-.485.884c0 .465.208.782.623.952.416.17.871.255 1.367.255ZM64.486 21.766c1.107 0 1.967.26 2.578.782.611.51 1.027 1.116 1.246 1.819a6.83 6.83 0 0 1 .329 2.073c0 .692-.11 1.389-.329 2.091-.22.692-.635 1.298-1.246 1.82-.611.509-1.47.764-2.578.764-.9 0-1.65-.238-2.25-.714-.08-.08-.161-.119-.242-.119-.116 0-.173.096-.173.29v3.569c0 .113-.035.198-.104.255-.058.068-.144.102-.26.102H60.42a.378.378 0 0 1-.277-.102c-.058-.057-.086-.142-.086-.255V22.344c0-.114.028-.199.086-.255a.378.378 0 0 1 .277-.102h1.038c.116 0 .202.034.26.102.069.056.104.141.104.255 0 .09.011.164.034.22.035.046.075.069.122.069.057 0 .109-.023.155-.068.612-.533 1.396-.8 2.354-.8Zm-.173 7.785c.888 0 1.54-.3 1.955-.9.427-.601.64-1.338.64-2.21 0-.873-.213-1.61-.64-2.21-.415-.601-1.067-.902-1.955-.902-.877 0-1.518.3-1.921.901-.393.59-.589 1.326-.589 2.21 0 .884.197 1.627.589 2.227.403.59 1.044.884 1.92.884ZM76.268 31.097c-1.316 0-2.452-.277-3.41-.833a5.531 5.531 0 0 1-2.163-2.277c-.484-.975-.726-2.08-.726-3.315 0-1.236.242-2.335.727-3.298a5.507 5.507 0 0 1 2.163-2.295c.957-.555 2.094-.833 3.409-.833 1.246 0 2.324.25 3.236.748a5.437 5.437 0 0 1 2.163 2.09c.034.069.052.131.052.188 0 .125-.087.215-.26.272l-1.298.323a.39.39 0 0 1-.12.017c-.151 0-.266-.074-.347-.221-.715-1.156-1.857-1.734-3.426-1.734-.97 0-1.771.221-2.406.663a3.907 3.907 0 0 0-1.401 1.75c-.3.715-.45 1.491-.45 2.33 0 .838.15 1.615.45 2.329.3.713.767 1.291 1.401 1.733.635.442 1.437.663 2.406.663.911 0 1.701-.21 2.37-.628.681-.42 1.165-1.06 1.454-1.921.08-.216.225-.306.433-.272l1.315.17c.196.034.294.124.294.272 0 .022-.012.079-.035.17-.507 1.303-1.246 2.283-2.215 2.94-.957.646-2.163.97-3.616.97ZM91.216 28.207c.023.34.08.607.173.8.092.18.288.322.588.424.185.068.277.165.277.29a.396.396 0 0 1-.052.17l-.484.951c-.093.204-.243.278-.45.221-.67-.147-1.13-.47-1.385-.969-.057-.124-.115-.187-.173-.187-.057 0-.12.046-.19.136-.6.714-1.575 1.071-2.925 1.071-.819 0-1.482-.141-1.99-.425-.496-.283-.848-.623-1.055-1.02-.208-.408-.312-.799-.312-1.173 0-.612.19-1.161.571-1.648.393-.488.975-.828 1.748-1.02.53-.125 1.27-.221 2.215-.29.646-.045 1.113-.09 1.402-.135.23-.034.334-.17.311-.408-.057-.51-.23-.918-.519-1.224-.277-.318-.744-.476-1.401-.476-.427 0-.837.09-1.23.272-.38.17-.674.47-.882.9-.103.216-.254.29-.45.222l-1.055-.29c-.185-.056-.277-.152-.277-.288a.53.53 0 0 1 .034-.153 3.293 3.293 0 0 1 1.368-1.564c.634-.397 1.459-.595 2.474-.595.992 0 1.834.255 2.527.765.692.498 1.06 1.224 1.107 2.176.012.453.017 1.06.017 1.819.012.759.018 1.308.018 1.648Zm-4.326 1.445c.311 0 .651-.073 1.02-.22.381-.148.716-.403 1.004-.766.3-.374.485-.872.554-1.495v-.034c0-.114-.035-.199-.104-.256-.07-.067-.161-.09-.277-.067l-.675.067c-.75.069-1.36.148-1.834.238-.461.08-.86.227-1.194.442a.984.984 0 0 0-.484.884c0 .465.207.782.622.952.416.17.871.255 1.368.255ZM95.687 30.536a.364.364 0 0 1-.104.272c-.058.057-.144.085-.26.085h-1.125a.424.424 0 0 1-.277-.085.407.407 0 0 1-.086-.272V18.79c0-.114.029-.199.086-.255a.378.378 0 0 1 .277-.102h1.125c.116 0 .202.034.26.102.069.056.104.141.104.255v11.746ZM100.033 30.536a.364.364 0 0 1-.104.272c-.057.057-.144.085-.26.085h-1.124a.423.423 0 0 1-.277-.085.407.407 0 0 1-.086-.272V18.79c0-.114.028-.199.086-.255a.378.378 0 0 1 .277-.102h1.125c.115 0 .202.034.26.102.069.056.103.141.103.255v11.746Z" stroke="#fff" stroke-width=".5"/><path d="M43.151 8.686c.296 0 .554-.036.774-.108.22-.076.402-.182.546-.318.148-.14.258-.308.33-.504.072-.2.108-.422.108-.666a1.75 1.75 0 0 0-.108-.63 1.245 1.245 0 0 0-.324-.48 1.41 1.41 0 0 0-.546-.3 2.516 2.516 0 0 0-.78-.108h-1.206v3.114h1.206Zm0-4.362c.58 0 1.082.068 1.506.204.424.136.774.326 1.05.57.276.244.48.536.612.876.136.34.204.712.204 1.116 0 .42-.07.806-.21 1.158-.14.348-.35.648-.63.9s-.632.448-1.056.588c-.42.14-.912.21-1.476.21h-1.206V13h-1.614V4.324h2.82Zm6.819 2.424c.456 0 .87.074 1.242.222a2.692 2.692 0 0 1 1.578 1.626c.144.392.216.83.216 1.314 0 .488-.072.928-.216 1.32-.144.392-.35.726-.618 1.002a2.653 2.653 0 0 1-.96.636 3.333 3.333 0 0 1-1.242.222c-.46 0-.878-.074-1.254-.222a2.712 2.712 0 0 1-.966-.636 2.922 2.922 0 0 1-.618-1.002 3.807 3.807 0 0 1-.216-1.32c0-.484.072-.922.216-1.314.148-.392.354-.724.618-.996.268-.272.59-.482.966-.63a3.397 3.397 0 0 1 1.254-.222Zm0 5.202c.512 0 .89-.172 1.134-.516.248-.344.372-.848.372-1.512s-.124-1.17-.372-1.518c-.244-.348-.622-.522-1.134-.522-.52 0-.906.176-1.158.528-.248.348-.372.852-.372 1.512s.124 1.164.372 1.512c.252.344.638.516 1.158.516Zm12.85-5.106L60.866 13h-1.188c-.136 0-.23-.088-.282-.264L58.29 9.178c-.036-.12-.07-.238-.102-.354a5.729 5.729 0 0 1-.072-.36 6.81 6.81 0 0 1-.084.366c-.028.12-.06.24-.096.36l-1.122 3.546c-.048.176-.154.264-.318.264h-1.14l-1.95-6.156h1.182c.108 0 .2.026.276.078a.363.363 0 0 1 .15.198l.882 3.288c.044.18.082.356.114.528.036.172.066.344.09.516.044-.172.09-.344.138-.516l.162-.528 1.02-3.3a.382.382 0 0 1 .138-.198.429.429 0 0 1 .258-.078h.654c.104 0 .192.026.264.078a.363.363 0 0 1 .15.198l.99 3.3c.052.18.1.358.144.534.048.172.094.344.138.516.052-.34.126-.69.222-1.05l.906-3.288a.405.405 0 0 1 .15-.198.429.429 0 0 1 .258-.078h1.128Zm4.704 2.37c0-.192-.028-.372-.084-.54a1.25 1.25 0 0 0-.24-.45 1.096 1.096 0 0 0-.414-.3 1.358 1.358 0 0 0-.576-.114c-.428 0-.766.122-1.014.366-.244.244-.4.59-.468 1.038h2.796Zm-2.826.894c.024.316.08.59.168.822.088.228.204.418.348.57.144.148.314.26.51.336.2.072.42.108.66.108.24 0 .446-.028.618-.084a2.76 2.76 0 0 0 .456-.186 7.55 7.55 0 0 0 .342-.186.59.59 0 0 1 .288-.084c.124 0 .216.046.276.138l.426.54a2.536 2.536 0 0 1-.552.486 3.281 3.281 0 0 1-1.32.474 4.79 4.79 0 0 1-.666.048 3.33 3.33 0 0 1-1.194-.21 2.726 2.726 0 0 1-.96-.63 2.993 2.993 0 0 1-.642-1.032c-.156-.412-.234-.888-.234-1.428 0-.42.068-.814.204-1.182.136-.372.33-.694.582-.966.256-.276.566-.494.93-.654.368-.16.782-.24 1.242-.24.388 0 .746.062 1.074.186.328.124.61.306.846.546.236.236.42.528.552.876.136.344.204.738.204 1.182 0 .224-.024.376-.072.456-.048.076-.14.114-.276.114h-3.81Zm6.668-2.196c.192-.368.42-.656.684-.864a1.45 1.45 0 0 1 .936-.318c.284 0 .512.062.684.186l-.096 1.11a.294.294 0 0 1-.09.156.239.239 0 0 1-.15.042c-.06 0-.15-.01-.27-.03a2.01 2.01 0 0 0-.342-.03 1.11 1.11 0 0 0-.786.282c-.1.088-.19.196-.27.324a3.44 3.44 0 0 0-.216.438V13h-1.482V6.844h.87c.152 0 .258.028.318.084.06.052.1.148.12.288l.09.696Zm6.87 1.302c0-.192-.029-.372-.085-.54a1.25 1.25 0 0 0-.24-.45 1.096 1.096 0 0 0-.414-.3 1.358 1.358 0 0 0-.576-.114c-.428 0-.766.122-1.014.366-.244.244-.4.59-.468 1.038h2.796Zm-2.827.894c.024.316.08.59.168.822.088.228.204.418.348.57.144.148.314.26.51.336.2.072.42.108.66.108.24 0 .446-.028.618-.084a2.76 2.76 0 0 0 .456-.186 7.55 7.55 0 0 0 .342-.186.59.59 0 0 1 .288-.084c.124 0 .216.046.276.138l.426.54a2.536 2.536 0 0 1-.552.486 3.281 3.281 0 0 1-1.32.474 4.79 4.79 0 0 1-.666.048 3.33 3.33 0 0 1-1.194-.21 2.726 2.726 0 0 1-.96-.63 2.993 2.993 0 0 1-.642-1.032c-.156-.412-.234-.888-.234-1.428 0-.42.068-.814.204-1.182.136-.372.33-.694.582-.966.256-.276.566-.494.93-.654.368-.16.782-.24 1.242-.24.388 0 .746.062 1.074.186.328.124.61.306.846.546.236.236.42.528.552.876.136.344.204.738.204 1.182 0 .224-.024.376-.072.456-.048.076-.14.114-.276.114h-3.81Zm9.134-1.692a1.451 1.451 0 0 0-.552-.432 1.597 1.597 0 0 0-.636-.126c-.224 0-.426.042-.606.126a1.21 1.21 0 0 0-.462.384 1.8 1.8 0 0 0-.294.648c-.068.26-.102.568-.102.924 0 .36.028.666.084.918.06.248.144.452.252.612.108.156.24.27.396.342.156.068.33.102.522.102.308 0 .57-.064.786-.192.216-.128.42-.31.612-.546v-2.76Zm1.482-4.332V13h-.906c-.196 0-.32-.09-.372-.27l-.126-.594a3.09 3.09 0 0 1-.858.69c-.32.176-.694.264-1.122.264-.336 0-.644-.07-.924-.21a2.098 2.098 0 0 1-.726-.606 3.033 3.033 0 0 1-.468-.99 5.072 5.072 0 0 1-.162-1.344c0-.456.062-.88.186-1.272s.302-.732.534-1.02c.232-.288.51-.512.834-.672a2.384 2.384 0 0 1 1.092-.246c.344 0 .638.054.882.162.244.108.462.254.654.438V4.084h1.482Zm5.863 7.32c.168.204.35.348.546.432.2.084.41.126.63.126.228 0 .432-.04.612-.12.184-.084.34-.212.468-.384a1.93 1.93 0 0 0 .294-.666 4.05 4.05 0 0 0 .102-.972c0-.676-.112-1.164-.336-1.464-.224-.304-.546-.456-.966-.456-.284 0-.532.066-.744.198a2.38 2.38 0 0 0-.606.546v2.76Zm0-3.804a3.02 3.02 0 0 1 .822-.618c.304-.156.65-.234 1.038-.234.356 0 .676.07.96.21.288.14.532.342.732.606.204.26.36.576.468.948.108.372.162.79.162 1.254 0 .5-.062.954-.186 1.362a3.132 3.132 0 0 1-.534 1.05 2.4 2.4 0 0 1-.828.672c-.324.16-.684.24-1.08.24a2.103 2.103 0 0 1-.954-.216 1.891 1.891 0 0 1-.366-.246c-.108-.1-.212-.21-.312-.33l-.066.414c-.024.104-.066.178-.126.222a.37.37 0 0 1-.234.066h-.978V4.084h1.482V7.6Zm10.743-.756-3.354 7.848a.538.538 0 0 1-.174.234c-.068.056-.174.084-.318.084H97.68l1.152-2.472-2.49-5.694h1.302c.116 0 .206.028.27.084.068.056.118.12.15.192l1.308 3.192c.044.108.08.216.108.324.032.108.062.218.09.33a32.3 32.3 0 0 1 .108-.33c.036-.112.076-.222.12-.33l1.236-3.186a.437.437 0 0 1 .408-.276h1.188Z"/></g></svg>';
|
|
1049
1049
|
|
|
1050
1050
|
|
|
1051
|
-
const $
|
|
1052
|
-
|
|
1051
|
+
const $9ac119af65504970$export$eabbd7447140cfb = `<svg xmlns="http://www.w3.org/2000/svg" width="100" height="103"><path d="M92.527 39.465 22.312 1.87A15.549 15.549 0 0 0 14.777 0c-2.64.02-5.226.703-7.5 1.98a14.086 14.086 0 0 0-5.332 5.032A13.185 13.185 0 0 0 0 13.906v75.188c-.004 2.422.668 4.8 1.945 6.894 1.278 2.094 3.117 3.832 5.332 5.035a15.598 15.598 0 0 0 7.5 1.977 15.6 15.6 0 0 0 7.536-1.867l70.214-37.598c2.262-1.187 4.153-2.933 5.465-5.05A13.198 13.198 0 0 0 100 51.5c0-2.457-.691-4.867-2.008-6.984-1.312-2.118-3.203-3.86-5.465-5.051Zm0 0" style="stroke:none;fill-rule:nonzero;fill:#fff;fill-opacity:1"/></svg>`;
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
const $15ddac3121cc3a5d$var$getWatermarkedCanvas = (canvas, dpr = 1)=>new Promise((resolve)=>{
|
|
1053
1055
|
const context = canvas.getContext("2d");
|
|
1054
1056
|
const svgBlob = new Blob([
|
|
1055
1057
|
(0, $850842193b726422$export$218be676a714a9df)
|
|
@@ -1066,7 +1068,26 @@ const $15ddac3121cc3a5d$var$getWatermarkedCanvas = (canvas)=>new Promise((resolv
|
|
|
1066
1068
|
};
|
|
1067
1069
|
watermarkImage.src = blobUrl;
|
|
1068
1070
|
});
|
|
1069
|
-
const $15ddac3121cc3a5d$
|
|
1071
|
+
const $15ddac3121cc3a5d$var$addVideoPlayerWatermarkedCanvas = (canvas, dpr = 1)=>new Promise((resolve)=>{
|
|
1072
|
+
const context = canvas.getContext("2d");
|
|
1073
|
+
const svgBlob = new Blob([
|
|
1074
|
+
(0, $9ac119af65504970$export$eabbd7447140cfb)
|
|
1075
|
+
], {
|
|
1076
|
+
type: "image/svg+xml;charset=utf-8"
|
|
1077
|
+
});
|
|
1078
|
+
const blobUrl = URL.createObjectURL(svgBlob);
|
|
1079
|
+
const watermarkImage = new Image();
|
|
1080
|
+
watermarkImage.onload = ()=>{
|
|
1081
|
+
const x = canvas.width / dpr / 2 - watermarkImage.width / 2;
|
|
1082
|
+
const y = canvas.height / dpr / 2 - watermarkImage.height / 2;
|
|
1083
|
+
context?.drawImage(watermarkImage, x, y);
|
|
1084
|
+
resolve(canvas);
|
|
1085
|
+
};
|
|
1086
|
+
watermarkImage.src = blobUrl;
|
|
1087
|
+
});
|
|
1088
|
+
const $15ddac3121cc3a5d$export$674c90a250a8b2c5 = async (video, options = {
|
|
1089
|
+
addPlayWatermark: false
|
|
1090
|
+
})=>{
|
|
1070
1091
|
const { videoWidth: videoWidth , videoHeight: videoHeight } = video;
|
|
1071
1092
|
const orientation = videoWidth > videoHeight ? "landscape" : "portrait";
|
|
1072
1093
|
const sourceWidth = orientation === "portrait" ? videoWidth : videoHeight;
|
|
@@ -1080,10 +1101,13 @@ const $15ddac3121cc3a5d$export$674c90a250a8b2c5 = async (video)=>{
|
|
|
1080
1101
|
canvas.height = sourceHeight * dpr;
|
|
1081
1102
|
ctx?.scale(dpr, dpr);
|
|
1082
1103
|
ctx?.drawImage(video, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, canvas.width / dpr, canvas.height / dpr);
|
|
1083
|
-
const watermarkedCanvas = await $15ddac3121cc3a5d$var$getWatermarkedCanvas(canvas);
|
|
1104
|
+
const watermarkedCanvas = await $15ddac3121cc3a5d$var$getWatermarkedCanvas(canvas, window.devicePixelRatio);
|
|
1105
|
+
if (options.addPlayWatermark) return (await $15ddac3121cc3a5d$var$addVideoPlayerWatermarkedCanvas(canvas, window.devicePixelRatio)).toDataURL("image/jpeg");
|
|
1084
1106
|
return watermarkedCanvas.toDataURL("image/jpeg");
|
|
1085
1107
|
};
|
|
1086
|
-
const $15ddac3121cc3a5d$export$4a210166cc9cb64b = async (src
|
|
1108
|
+
const $15ddac3121cc3a5d$export$4a210166cc9cb64b = async (src, options = {
|
|
1109
|
+
addPlayWatermark: false
|
|
1110
|
+
})=>{
|
|
1087
1111
|
const video = document.createElement("video");
|
|
1088
1112
|
const stream = new MediaStream();
|
|
1089
1113
|
stream.addTrack(src);
|
|
@@ -1099,6 +1123,7 @@ const $15ddac3121cc3a5d$export$4a210166cc9cb64b = async (src)=>{
|
|
|
1099
1123
|
canvas.width = video.width;
|
|
1100
1124
|
ctx?.drawImage(video, 0, 0);
|
|
1101
1125
|
const watermarkedCanvas = await $15ddac3121cc3a5d$var$getWatermarkedCanvas(canvas);
|
|
1126
|
+
if (options.addPlayWatermark) return (await $15ddac3121cc3a5d$var$addVideoPlayerWatermarkedCanvas(canvas)).toDataURL("image/jpeg");
|
|
1102
1127
|
return watermarkedCanvas.toDataURL("image/jpeg");
|
|
1103
1128
|
};
|
|
1104
1129
|
|
|
@@ -2586,17 +2611,32 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
|
|
|
2586
2611
|
assetId: res.assetId
|
|
2587
2612
|
};
|
|
2588
2613
|
}
|
|
2614
|
+
async saveThumbnail(base64Image) {
|
|
2615
|
+
const { objectUrl: objectUrl } = await fetch(`${this.config.streamApiURL}/uploadSnapshot`, {
|
|
2616
|
+
method: "POST",
|
|
2617
|
+
body: JSON.stringify({
|
|
2618
|
+
file: base64Image
|
|
2619
|
+
})
|
|
2620
|
+
}).then((rawResponse)=>rawResponse.json());
|
|
2621
|
+
const res = await this.protoo.request("addThumbnail", {
|
|
2622
|
+
url: objectUrl
|
|
2623
|
+
});
|
|
2624
|
+
return {
|
|
2625
|
+
url: objectUrl,
|
|
2626
|
+
assetId: res.assetId
|
|
2627
|
+
};
|
|
2628
|
+
}
|
|
2589
2629
|
async deleteCapture(assetId) {
|
|
2590
2630
|
const res = await this.protoo.request("deleteCapture", {
|
|
2591
2631
|
assetId: assetId
|
|
2592
2632
|
});
|
|
2593
2633
|
return res;
|
|
2594
2634
|
}
|
|
2595
|
-
async captureVideo(videoElement) {
|
|
2635
|
+
async captureVideo(videoElement, option) {
|
|
2596
2636
|
if (this.permissions.find((permission)=>permission === "instant_picture")) {
|
|
2597
2637
|
let image;
|
|
2598
|
-
if (videoElement) image = await (0, $15ddac3121cc3a5d$export$674c90a250a8b2c5)(videoElement);
|
|
2599
|
-
else if (this.webcamProducer && this.webcamProducer.track) image = await (0, $15ddac3121cc3a5d$export$4a210166cc9cb64b)(this.webcamProducer.track);
|
|
2638
|
+
if (videoElement) image = await (0, $15ddac3121cc3a5d$export$674c90a250a8b2c5)(videoElement, option);
|
|
2639
|
+
else if (this.webcamProducer && this.webcamProducer.track) image = await (0, $15ddac3121cc3a5d$export$4a210166cc9cb64b)(this.webcamProducer.track, option);
|
|
2600
2640
|
else throw new Error("no video to capture");
|
|
2601
2641
|
return image;
|
|
2602
2642
|
} else throw new Error("feature not allowed");
|
|
@@ -5614,13 +5654,12 @@ const $5939a59dc7c96d41$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
|
|
|
5614
5654
|
]
|
|
5615
5655
|
}),
|
|
5616
5656
|
!streaming && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$f217faec90120a0c), {
|
|
5617
|
-
children: /*#__PURE__*/ (0, $3Sbms$
|
|
5618
|
-
children:
|
|
5619
|
-
profile.
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
]
|
|
5657
|
+
children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$6ddfb572d7b6d164), {
|
|
5658
|
+
children: profile.image ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$a7a74ab5cffd1455), {
|
|
5659
|
+
src: profile.image
|
|
5660
|
+
}) : profile.name ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7ec04c1818c68245$export$a2930b41faa750f4), {
|
|
5661
|
+
children: profile.name.slice(0, 1).toUpperCase()
|
|
5662
|
+
}) : /*#__PURE__*/ (0, $3Sbms$jsx)((0, $57da43088f4a416a$export$2e2bcd8739ae039), {})
|
|
5624
5663
|
})
|
|
5625
5664
|
}),
|
|
5626
5665
|
!extended && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $6efc75079651494a$export$500c3c5544c37412), {
|
|
@@ -11662,6 +11701,15 @@ const $92672d57809ea9d3$export$336a011955157f9a = ()=>{
|
|
|
11662
11701
|
}
|
|
11663
11702
|
]);
|
|
11664
11703
|
};
|
|
11704
|
+
const captureThumbnail = async (videoElement)=>{
|
|
11705
|
+
let image = await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).captureVideo(undefined, {
|
|
11706
|
+
addPlayWatermark: true
|
|
11707
|
+
}).catch(console.error);
|
|
11708
|
+
if (!image) image = await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).captureVideo(videoElement, {
|
|
11709
|
+
addPlayWatermark: true
|
|
11710
|
+
});
|
|
11711
|
+
await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).saveThumbnail(image);
|
|
11712
|
+
};
|
|
11665
11713
|
const removeAsset = (0, $3Sbms$useCallback)(async (asset)=>{
|
|
11666
11714
|
if (!asset.assetId) return;
|
|
11667
11715
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).deleteCapture(asset.assetId);
|
|
@@ -11710,7 +11758,9 @@ const $92672d57809ea9d3$export$336a011955157f9a = ()=>{
|
|
|
11710
11758
|
onFinish: ()=>{
|
|
11711
11759
|
setCountdownVisible(false);
|
|
11712
11760
|
setStartRecordTime(Date.now());
|
|
11713
|
-
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).startRecord()
|
|
11761
|
+
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).startRecord().then(()=>{
|
|
11762
|
+
if (videoElementRef.current) captureThumbnail(videoElementRef.current);
|
|
11763
|
+
});
|
|
11714
11764
|
}
|
|
11715
11765
|
}),
|
|
11716
11766
|
flashAnimation && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $6efc75079651494a$export$2b501aee548bae06), {
|
|
@@ -11746,7 +11796,6 @@ const $92672d57809ea9d3$export$336a011955157f9a = ()=>{
|
|
|
11746
11796
|
if (menuBarState.photo && videoElementRef.current) {
|
|
11747
11797
|
onPhotoCapture(videoElementRef.current);
|
|
11748
11798
|
setFlashAnimation(true);
|
|
11749
|
-
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).captureVideo(videoElementRef.current);
|
|
11750
11799
|
}
|
|
11751
11800
|
if (!menuBarState.photo && !menuBarState.streaming) {
|
|
11752
11801
|
menuBarState.setStreaming(true);
|
|
@@ -11873,7 +11922,7 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
|
|
|
11873
11922
|
const [profile, setProfile] = (0, $3Sbms$useState)({});
|
|
11874
11923
|
const [muted, setMuted] = (0, $3Sbms$useState)(true);
|
|
11875
11924
|
const [streaming, setStreaming] = (0, $3Sbms$useState)(false);
|
|
11876
|
-
const [isLoading, setLoading] = (0, $3Sbms$useState)(!options.recorder);
|
|
11925
|
+
const [isLoading, setLoading] = (0, $3Sbms$useState)(!options.recorder?.enabled);
|
|
11877
11926
|
const [screensharing, setScreensharing] = (0, $3Sbms$useState)(false);
|
|
11878
11927
|
const [isAgent, setIsAgent] = (0, $3Sbms$useState)(false);
|
|
11879
11928
|
const [userInteractionTriggered, setUserInteractionTriggered] = (0, $3Sbms$useState)(false);
|
|
@@ -12578,7 +12627,7 @@ const $24075a5d702d64b3$export$3f94917203ab7078 = {
|
|
|
12578
12627
|
let styleElement = null;
|
|
12579
12628
|
styleElement = /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $3Sbms$Fragment), {
|
|
12580
12629
|
children: [
|
|
12581
|
-
options.recorder && /*#__PURE__*/ (0, $3Sbms$jsx)("style", {
|
|
12630
|
+
options.recorder?.enabled && /*#__PURE__*/ (0, $3Sbms$jsx)("style", {
|
|
12582
12631
|
children: (0, (/*@__PURE__*/$parcel$interopDefault($e02c50a47b475960$exports)))
|
|
12583
12632
|
}),
|
|
12584
12633
|
/*#__PURE__*/ (0, $3Sbms$jsx)("style", {
|
package/dist/stream-ui.js
CHANGED
|
@@ -1053,8 +1053,10 @@ var $1bfa11322d1d6377$export$2e2bcd8739ae039 = $1bfa11322d1d6377$var$AudioRender
|
|
|
1053
1053
|
const $67e3b71ab2fb8185$export$218be676a714a9df = '<svg width="103" height="36" fill="none" xmlns="http://www.w3.org/2000/svg"><g opacity=".8" fill="#fff"><path d="M10.994 33.06c.903 0 1.658-.734 1.392-1.581a5.249 5.249 0 0 0-1.279-2.124 5.171 5.171 0 0 0-3.673-1.535 5.171 5.171 0 0 0-3.673 1.535c-.595.6-1.03 1.33-1.28 2.124-.265.847.49 1.582 1.393 1.582h7.12ZM10.65 16.2c-.902 0-1.658.735-1.392 1.582.25.794.685 1.524 1.28 2.124a5.171 5.171 0 0 0 3.672 1.535 5.172 5.172 0 0 0 3.674-1.535 5.25 5.25 0 0 0 1.279-2.124c.266-.847-.49-1.582-1.393-1.582h-7.12ZM14.21 31.455c0 .887.75 1.63 1.606 1.35a5.187 5.187 0 0 0 2.067-1.279 5.264 5.264 0 0 0 1.521-3.706c0-1.39-.547-2.723-1.52-3.705a5.187 5.187 0 0 0-2.068-1.278c-.856-.281-1.606.462-1.606 1.349v7.27ZM7.434 17.806c0-.887-.75-1.63-1.607-1.35a5.186 5.186 0 0 0-2.066 1.279 5.264 5.264 0 0 0-1.522 3.706c0 1.39.548 2.723 1.522 3.705a5.186 5.186 0 0 0 2.066 1.278c.857.281 1.607-.462 1.607-1.349v-7.27Z"/><path d="M32.965 31.098c-1.442 0-2.601-.227-3.478-.68-.865-.465-1.517-1.043-1.955-1.734a.416.416 0 0 1-.052-.187c0-.125.057-.227.173-.306l.986-.731a.286.286 0 0 1 .208-.085c.103 0 .201.062.294.187.773 1.224 2.07 1.836 3.893 1.836.796 0 1.471-.142 2.025-.425.565-.284.848-.737.848-1.36 0-.465-.161-.827-.485-1.088-.311-.26-.796-.493-1.453-.697-.6-.181-.975-.289-1.125-.323-.992-.283-1.707-.504-2.146-.663-1.107-.408-1.84-.878-2.198-1.41-.357-.534-.536-1.089-.536-1.667 0-.476.15-.986.45-1.53.311-.555.796-1.025 1.453-1.41.67-.397 1.506-.595 2.51-.595 1.05 0 1.932.13 2.647.39.716.25 1.396.67 2.042 1.258.081.08.121.159.121.238 0 .114-.057.204-.173.272l-1.107.731a.469.469 0 0 1-.225.085c-.104 0-.202-.05-.294-.153-.692-.725-1.644-1.088-2.856-1.088-.692 0-1.228.102-1.609.306-.37.204-.617.431-.744.68-.115.25-.173.47-.173.663 0 .408.162.737.485.986.323.25.801.476 1.436.68.058.023.502.153 1.332.391.52.136 1.056.29 1.61.46 1.21.396 2.019.9 2.422 1.512.416.612.623 1.201.623 1.768 0 .612-.15 1.196-.45 1.75-.288.556-.801 1.02-1.54 1.395-.727.362-1.713.544-2.959.544ZM44.114 21.766c.865 0 1.667.249 2.405.748.739.487 1.108 1.388 1.108 2.702v5.321a.364.364 0 0 1-.104.272c-.058.057-.144.085-.26.085H46.14a.423.423 0 0 1-.277-.085.407.407 0 0 1-.087-.272v-5.032c-.035-.646-.22-1.155-.554-1.53-.323-.373-.744-.56-1.263-.56-.37 0-.738.102-1.107.306-.358.192-.664.492-.918.9-.253.397-.403.896-.45 1.496v4.42a.365.365 0 0 1-.103.272c-.058.057-.145.085-.26.085h-1.125a.423.423 0 0 1-.276-.085.407.407 0 0 1-.087-.272v-8.193c0-.114.029-.199.087-.255a.378.378 0 0 1 .276-.102h1.125c.116 0 .202.034.26.102.069.056.103.141.103.255v.204c0 .079.012.141.035.187a.168.168 0 0 0 .121.05c.092 0 .214-.062.364-.186a4.02 4.02 0 0 1 1.038-.612c.38-.148.738-.221 1.073-.221ZM57.436 28.207c.023.34.081.607.173.8.093.18.289.322.589.424.184.068.277.165.277.29a.396.396 0 0 1-.052.17l-.485.951c-.092.204-.242.278-.45.221-.669-.147-1.13-.47-1.384-.969-.058-.124-.115-.187-.173-.187-.058 0-.121.046-.19.136-.6.714-1.575 1.071-2.925 1.071-.819 0-1.482-.141-1.99-.425-.496-.283-.848-.623-1.056-1.02-.207-.408-.311-.799-.311-1.173 0-.612.19-1.161.571-1.648.392-.488.975-.828 1.748-1.02.53-.125 1.269-.221 2.215-.29.646-.045 1.113-.09 1.401-.135.231-.034.335-.17.312-.408-.058-.51-.23-.918-.52-1.224-.276-.318-.743-.476-1.4-.476-.428 0-.837.09-1.23.272-.38.17-.674.47-.882.9-.104.216-.254.29-.45.222l-1.055-.29c-.185-.056-.277-.152-.277-.288 0-.034.011-.085.034-.153a3.292 3.292 0 0 1 1.367-1.564c.635-.397 1.46-.595 2.475-.595.992 0 1.834.255 2.526.765.693.498 1.062 1.224 1.108 2.176.011.453.017 1.06.017 1.819.012.759.017 1.308.017 1.648Zm-4.326 1.445c.312 0 .652-.073 1.021-.22.38-.148.715-.403 1.004-.766.3-.374.484-.872.554-1.495v-.034c0-.114-.035-.199-.104-.256-.07-.067-.162-.09-.277-.067l-.675.067c-.75.069-1.361.148-1.834.238-.462.08-.86.227-1.194.442a.984.984 0 0 0-.485.884c0 .465.208.782.623.952.416.17.871.255 1.367.255ZM64.486 21.766c1.107 0 1.967.26 2.578.782.611.51 1.027 1.116 1.246 1.819a6.83 6.83 0 0 1 .329 2.073c0 .692-.11 1.389-.329 2.091-.22.692-.635 1.298-1.246 1.82-.611.509-1.47.764-2.578.764-.9 0-1.65-.238-2.25-.714-.08-.08-.161-.119-.242-.119-.116 0-.173.096-.173.29v3.569c0 .113-.035.198-.104.255-.058.068-.144.102-.26.102H60.42a.378.378 0 0 1-.277-.102c-.058-.057-.086-.142-.086-.255V22.344c0-.114.028-.199.086-.255a.378.378 0 0 1 .277-.102h1.038c.116 0 .202.034.26.102.069.056.104.141.104.255 0 .09.011.164.034.22.035.046.075.069.122.069.057 0 .109-.023.155-.068.612-.533 1.396-.8 2.354-.8Zm-.173 7.785c.888 0 1.54-.3 1.955-.9.427-.601.64-1.338.64-2.21 0-.873-.213-1.61-.64-2.21-.415-.601-1.067-.902-1.955-.902-.877 0-1.518.3-1.921.901-.393.59-.589 1.326-.589 2.21 0 .884.197 1.627.589 2.227.403.59 1.044.884 1.92.884ZM76.268 31.097c-1.316 0-2.452-.277-3.41-.833a5.531 5.531 0 0 1-2.163-2.277c-.484-.975-.726-2.08-.726-3.315 0-1.236.242-2.335.727-3.298a5.507 5.507 0 0 1 2.163-2.295c.957-.555 2.094-.833 3.409-.833 1.246 0 2.324.25 3.236.748a5.437 5.437 0 0 1 2.163 2.09c.034.069.052.131.052.188 0 .125-.087.215-.26.272l-1.298.323a.39.39 0 0 1-.12.017c-.151 0-.266-.074-.347-.221-.715-1.156-1.857-1.734-3.426-1.734-.97 0-1.771.221-2.406.663a3.907 3.907 0 0 0-1.401 1.75c-.3.715-.45 1.491-.45 2.33 0 .838.15 1.615.45 2.329.3.713.767 1.291 1.401 1.733.635.442 1.437.663 2.406.663.911 0 1.701-.21 2.37-.628.681-.42 1.165-1.06 1.454-1.921.08-.216.225-.306.433-.272l1.315.17c.196.034.294.124.294.272 0 .022-.012.079-.035.17-.507 1.303-1.246 2.283-2.215 2.94-.957.646-2.163.97-3.616.97ZM91.216 28.207c.023.34.08.607.173.8.092.18.288.322.588.424.185.068.277.165.277.29a.396.396 0 0 1-.052.17l-.484.951c-.093.204-.243.278-.45.221-.67-.147-1.13-.47-1.385-.969-.057-.124-.115-.187-.173-.187-.057 0-.12.046-.19.136-.6.714-1.575 1.071-2.925 1.071-.819 0-1.482-.141-1.99-.425-.496-.283-.848-.623-1.055-1.02-.208-.408-.312-.799-.312-1.173 0-.612.19-1.161.571-1.648.393-.488.975-.828 1.748-1.02.53-.125 1.27-.221 2.215-.29.646-.045 1.113-.09 1.402-.135.23-.034.334-.17.311-.408-.057-.51-.23-.918-.519-1.224-.277-.318-.744-.476-1.401-.476-.427 0-.837.09-1.23.272-.38.17-.674.47-.882.9-.103.216-.254.29-.45.222l-1.055-.29c-.185-.056-.277-.152-.277-.288a.53.53 0 0 1 .034-.153 3.293 3.293 0 0 1 1.368-1.564c.634-.397 1.459-.595 2.474-.595.992 0 1.834.255 2.527.765.692.498 1.06 1.224 1.107 2.176.012.453.017 1.06.017 1.819.012.759.018 1.308.018 1.648Zm-4.326 1.445c.311 0 .651-.073 1.02-.22.381-.148.716-.403 1.004-.766.3-.374.485-.872.554-1.495v-.034c0-.114-.035-.199-.104-.256-.07-.067-.161-.09-.277-.067l-.675.067c-.75.069-1.36.148-1.834.238-.461.08-.86.227-1.194.442a.984.984 0 0 0-.484.884c0 .465.207.782.622.952.416.17.871.255 1.368.255ZM95.687 30.536a.364.364 0 0 1-.104.272c-.058.057-.144.085-.26.085h-1.125a.424.424 0 0 1-.277-.085.407.407 0 0 1-.086-.272V18.79c0-.114.029-.199.086-.255a.378.378 0 0 1 .277-.102h1.125c.116 0 .202.034.26.102.069.056.104.141.104.255v11.746ZM100.033 30.536a.364.364 0 0 1-.104.272c-.057.057-.144.085-.26.085h-1.124a.423.423 0 0 1-.277-.085.407.407 0 0 1-.086-.272V18.79c0-.114.028-.199.086-.255a.378.378 0 0 1 .277-.102h1.125c.115 0 .202.034.26.102.069.056.103.141.103.255v11.746Z" stroke="#fff" stroke-width=".5"/><path d="M43.151 8.686c.296 0 .554-.036.774-.108.22-.076.402-.182.546-.318.148-.14.258-.308.33-.504.072-.2.108-.422.108-.666a1.75 1.75 0 0 0-.108-.63 1.245 1.245 0 0 0-.324-.48 1.41 1.41 0 0 0-.546-.3 2.516 2.516 0 0 0-.78-.108h-1.206v3.114h1.206Zm0-4.362c.58 0 1.082.068 1.506.204.424.136.774.326 1.05.57.276.244.48.536.612.876.136.34.204.712.204 1.116 0 .42-.07.806-.21 1.158-.14.348-.35.648-.63.9s-.632.448-1.056.588c-.42.14-.912.21-1.476.21h-1.206V13h-1.614V4.324h2.82Zm6.819 2.424c.456 0 .87.074 1.242.222a2.692 2.692 0 0 1 1.578 1.626c.144.392.216.83.216 1.314 0 .488-.072.928-.216 1.32-.144.392-.35.726-.618 1.002a2.653 2.653 0 0 1-.96.636 3.333 3.333 0 0 1-1.242.222c-.46 0-.878-.074-1.254-.222a2.712 2.712 0 0 1-.966-.636 2.922 2.922 0 0 1-.618-1.002 3.807 3.807 0 0 1-.216-1.32c0-.484.072-.922.216-1.314.148-.392.354-.724.618-.996.268-.272.59-.482.966-.63a3.397 3.397 0 0 1 1.254-.222Zm0 5.202c.512 0 .89-.172 1.134-.516.248-.344.372-.848.372-1.512s-.124-1.17-.372-1.518c-.244-.348-.622-.522-1.134-.522-.52 0-.906.176-1.158.528-.248.348-.372.852-.372 1.512s.124 1.164.372 1.512c.252.344.638.516 1.158.516Zm12.85-5.106L60.866 13h-1.188c-.136 0-.23-.088-.282-.264L58.29 9.178c-.036-.12-.07-.238-.102-.354a5.729 5.729 0 0 1-.072-.36 6.81 6.81 0 0 1-.084.366c-.028.12-.06.24-.096.36l-1.122 3.546c-.048.176-.154.264-.318.264h-1.14l-1.95-6.156h1.182c.108 0 .2.026.276.078a.363.363 0 0 1 .15.198l.882 3.288c.044.18.082.356.114.528.036.172.066.344.09.516.044-.172.09-.344.138-.516l.162-.528 1.02-3.3a.382.382 0 0 1 .138-.198.429.429 0 0 1 .258-.078h.654c.104 0 .192.026.264.078a.363.363 0 0 1 .15.198l.99 3.3c.052.18.1.358.144.534.048.172.094.344.138.516.052-.34.126-.69.222-1.05l.906-3.288a.405.405 0 0 1 .15-.198.429.429 0 0 1 .258-.078h1.128Zm4.704 2.37c0-.192-.028-.372-.084-.54a1.25 1.25 0 0 0-.24-.45 1.096 1.096 0 0 0-.414-.3 1.358 1.358 0 0 0-.576-.114c-.428 0-.766.122-1.014.366-.244.244-.4.59-.468 1.038h2.796Zm-2.826.894c.024.316.08.59.168.822.088.228.204.418.348.57.144.148.314.26.51.336.2.072.42.108.66.108.24 0 .446-.028.618-.084a2.76 2.76 0 0 0 .456-.186 7.55 7.55 0 0 0 .342-.186.59.59 0 0 1 .288-.084c.124 0 .216.046.276.138l.426.54a2.536 2.536 0 0 1-.552.486 3.281 3.281 0 0 1-1.32.474 4.79 4.79 0 0 1-.666.048 3.33 3.33 0 0 1-1.194-.21 2.726 2.726 0 0 1-.96-.63 2.993 2.993 0 0 1-.642-1.032c-.156-.412-.234-.888-.234-1.428 0-.42.068-.814.204-1.182.136-.372.33-.694.582-.966.256-.276.566-.494.93-.654.368-.16.782-.24 1.242-.24.388 0 .746.062 1.074.186.328.124.61.306.846.546.236.236.42.528.552.876.136.344.204.738.204 1.182 0 .224-.024.376-.072.456-.048.076-.14.114-.276.114h-3.81Zm6.668-2.196c.192-.368.42-.656.684-.864a1.45 1.45 0 0 1 .936-.318c.284 0 .512.062.684.186l-.096 1.11a.294.294 0 0 1-.09.156.239.239 0 0 1-.15.042c-.06 0-.15-.01-.27-.03a2.01 2.01 0 0 0-.342-.03 1.11 1.11 0 0 0-.786.282c-.1.088-.19.196-.27.324a3.44 3.44 0 0 0-.216.438V13h-1.482V6.844h.87c.152 0 .258.028.318.084.06.052.1.148.12.288l.09.696Zm6.87 1.302c0-.192-.029-.372-.085-.54a1.25 1.25 0 0 0-.24-.45 1.096 1.096 0 0 0-.414-.3 1.358 1.358 0 0 0-.576-.114c-.428 0-.766.122-1.014.366-.244.244-.4.59-.468 1.038h2.796Zm-2.827.894c.024.316.08.59.168.822.088.228.204.418.348.57.144.148.314.26.51.336.2.072.42.108.66.108.24 0 .446-.028.618-.084a2.76 2.76 0 0 0 .456-.186 7.55 7.55 0 0 0 .342-.186.59.59 0 0 1 .288-.084c.124 0 .216.046.276.138l.426.54a2.536 2.536 0 0 1-.552.486 3.281 3.281 0 0 1-1.32.474 4.79 4.79 0 0 1-.666.048 3.33 3.33 0 0 1-1.194-.21 2.726 2.726 0 0 1-.96-.63 2.993 2.993 0 0 1-.642-1.032c-.156-.412-.234-.888-.234-1.428 0-.42.068-.814.204-1.182.136-.372.33-.694.582-.966.256-.276.566-.494.93-.654.368-.16.782-.24 1.242-.24.388 0 .746.062 1.074.186.328.124.61.306.846.546.236.236.42.528.552.876.136.344.204.738.204 1.182 0 .224-.024.376-.072.456-.048.076-.14.114-.276.114h-3.81Zm9.134-1.692a1.451 1.451 0 0 0-.552-.432 1.597 1.597 0 0 0-.636-.126c-.224 0-.426.042-.606.126a1.21 1.21 0 0 0-.462.384 1.8 1.8 0 0 0-.294.648c-.068.26-.102.568-.102.924 0 .36.028.666.084.918.06.248.144.452.252.612.108.156.24.27.396.342.156.068.33.102.522.102.308 0 .57-.064.786-.192.216-.128.42-.31.612-.546v-2.76Zm1.482-4.332V13h-.906c-.196 0-.32-.09-.372-.27l-.126-.594a3.09 3.09 0 0 1-.858.69c-.32.176-.694.264-1.122.264-.336 0-.644-.07-.924-.21a2.098 2.098 0 0 1-.726-.606 3.033 3.033 0 0 1-.468-.99 5.072 5.072 0 0 1-.162-1.344c0-.456.062-.88.186-1.272s.302-.732.534-1.02c.232-.288.51-.512.834-.672a2.384 2.384 0 0 1 1.092-.246c.344 0 .638.054.882.162.244.108.462.254.654.438V4.084h1.482Zm5.863 7.32c.168.204.35.348.546.432.2.084.41.126.63.126.228 0 .432-.04.612-.12.184-.084.34-.212.468-.384a1.93 1.93 0 0 0 .294-.666 4.05 4.05 0 0 0 .102-.972c0-.676-.112-1.164-.336-1.464-.224-.304-.546-.456-.966-.456-.284 0-.532.066-.744.198a2.38 2.38 0 0 0-.606.546v2.76Zm0-3.804a3.02 3.02 0 0 1 .822-.618c.304-.156.65-.234 1.038-.234.356 0 .676.07.96.21.288.14.532.342.732.606.204.26.36.576.468.948.108.372.162.79.162 1.254 0 .5-.062.954-.186 1.362a3.132 3.132 0 0 1-.534 1.05 2.4 2.4 0 0 1-.828.672c-.324.16-.684.24-1.08.24a2.103 2.103 0 0 1-.954-.216 1.891 1.891 0 0 1-.366-.246c-.108-.1-.212-.21-.312-.33l-.066.414c-.024.104-.066.178-.126.222a.37.37 0 0 1-.234.066h-.978V4.084h1.482V7.6Zm10.743-.756-3.354 7.848a.538.538 0 0 1-.174.234c-.068.056-.174.084-.318.084H97.68l1.152-2.472-2.49-5.694h1.302c.116 0 .206.028.27.084.068.056.118.12.15.192l1.308 3.192c.044.108.08.216.108.324.032.108.062.218.09.33a32.3 32.3 0 0 1 .108-.33c.036-.112.076-.222.12-.33l1.236-3.186a.437.437 0 0 1 .408-.276h1.188Z"/></g></svg>';
|
|
1054
1054
|
|
|
1055
1055
|
|
|
1056
|
-
const $
|
|
1057
|
-
|
|
1056
|
+
const $83954b4ec0d03b4b$export$eabbd7447140cfb = `<svg xmlns="http://www.w3.org/2000/svg" width="100" height="103"><path d="M92.527 39.465 22.312 1.87A15.549 15.549 0 0 0 14.777 0c-2.64.02-5.226.703-7.5 1.98a14.086 14.086 0 0 0-5.332 5.032A13.185 13.185 0 0 0 0 13.906v75.188c-.004 2.422.668 4.8 1.945 6.894 1.278 2.094 3.117 3.832 5.332 5.035a15.598 15.598 0 0 0 7.5 1.977 15.6 15.6 0 0 0 7.536-1.867l70.214-37.598c2.262-1.187 4.153-2.933 5.465-5.05A13.198 13.198 0 0 0 100 51.5c0-2.457-.691-4.867-2.008-6.984-1.312-2.118-3.203-3.86-5.465-5.051Zm0 0" style="stroke:none;fill-rule:nonzero;fill:#fff;fill-opacity:1"/></svg>`;
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
const $3575c8a563f2a1da$var$getWatermarkedCanvas = (canvas, dpr = 1)=>new Promise((resolve)=>{
|
|
1058
1060
|
const context = canvas.getContext("2d");
|
|
1059
1061
|
const svgBlob = new Blob([
|
|
1060
1062
|
(0, $67e3b71ab2fb8185$export$218be676a714a9df)
|
|
@@ -1071,7 +1073,26 @@ const $3575c8a563f2a1da$var$getWatermarkedCanvas = (canvas)=>new Promise((resolv
|
|
|
1071
1073
|
};
|
|
1072
1074
|
watermarkImage.src = blobUrl;
|
|
1073
1075
|
});
|
|
1074
|
-
const $3575c8a563f2a1da$
|
|
1076
|
+
const $3575c8a563f2a1da$var$addVideoPlayerWatermarkedCanvas = (canvas, dpr = 1)=>new Promise((resolve)=>{
|
|
1077
|
+
const context = canvas.getContext("2d");
|
|
1078
|
+
const svgBlob = new Blob([
|
|
1079
|
+
(0, $83954b4ec0d03b4b$export$eabbd7447140cfb)
|
|
1080
|
+
], {
|
|
1081
|
+
type: "image/svg+xml;charset=utf-8"
|
|
1082
|
+
});
|
|
1083
|
+
const blobUrl = URL.createObjectURL(svgBlob);
|
|
1084
|
+
const watermarkImage = new Image();
|
|
1085
|
+
watermarkImage.onload = ()=>{
|
|
1086
|
+
const x = canvas.width / dpr / 2 - watermarkImage.width / 2;
|
|
1087
|
+
const y = canvas.height / dpr / 2 - watermarkImage.height / 2;
|
|
1088
|
+
context?.drawImage(watermarkImage, x, y);
|
|
1089
|
+
resolve(canvas);
|
|
1090
|
+
};
|
|
1091
|
+
watermarkImage.src = blobUrl;
|
|
1092
|
+
});
|
|
1093
|
+
const $3575c8a563f2a1da$export$674c90a250a8b2c5 = async (video, options = {
|
|
1094
|
+
addPlayWatermark: false
|
|
1095
|
+
})=>{
|
|
1075
1096
|
const { videoWidth: videoWidth , videoHeight: videoHeight } = video;
|
|
1076
1097
|
const orientation = videoWidth > videoHeight ? "landscape" : "portrait";
|
|
1077
1098
|
const sourceWidth = orientation === "portrait" ? videoWidth : videoHeight;
|
|
@@ -1085,10 +1106,13 @@ const $3575c8a563f2a1da$export$674c90a250a8b2c5 = async (video)=>{
|
|
|
1085
1106
|
canvas.height = sourceHeight * dpr;
|
|
1086
1107
|
ctx?.scale(dpr, dpr);
|
|
1087
1108
|
ctx?.drawImage(video, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, canvas.width / dpr, canvas.height / dpr);
|
|
1088
|
-
const watermarkedCanvas = await $3575c8a563f2a1da$var$getWatermarkedCanvas(canvas);
|
|
1109
|
+
const watermarkedCanvas = await $3575c8a563f2a1da$var$getWatermarkedCanvas(canvas, window.devicePixelRatio);
|
|
1110
|
+
if (options.addPlayWatermark) return (await $3575c8a563f2a1da$var$addVideoPlayerWatermarkedCanvas(canvas, window.devicePixelRatio)).toDataURL("image/jpeg");
|
|
1089
1111
|
return watermarkedCanvas.toDataURL("image/jpeg");
|
|
1090
1112
|
};
|
|
1091
|
-
const $3575c8a563f2a1da$export$4a210166cc9cb64b = async (src
|
|
1113
|
+
const $3575c8a563f2a1da$export$4a210166cc9cb64b = async (src, options = {
|
|
1114
|
+
addPlayWatermark: false
|
|
1115
|
+
})=>{
|
|
1092
1116
|
const video = document.createElement("video");
|
|
1093
1117
|
const stream = new MediaStream();
|
|
1094
1118
|
stream.addTrack(src);
|
|
@@ -1104,6 +1128,7 @@ const $3575c8a563f2a1da$export$4a210166cc9cb64b = async (src)=>{
|
|
|
1104
1128
|
canvas.width = video.width;
|
|
1105
1129
|
ctx?.drawImage(video, 0, 0);
|
|
1106
1130
|
const watermarkedCanvas = await $3575c8a563f2a1da$var$getWatermarkedCanvas(canvas);
|
|
1131
|
+
if (options.addPlayWatermark) return (await $3575c8a563f2a1da$var$addVideoPlayerWatermarkedCanvas(canvas)).toDataURL("image/jpeg");
|
|
1107
1132
|
return watermarkedCanvas.toDataURL("image/jpeg");
|
|
1108
1133
|
};
|
|
1109
1134
|
|
|
@@ -2591,17 +2616,32 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
2591
2616
|
assetId: res.assetId
|
|
2592
2617
|
};
|
|
2593
2618
|
}
|
|
2619
|
+
async saveThumbnail(base64Image) {
|
|
2620
|
+
const { objectUrl: objectUrl } = await fetch(`${this.config.streamApiURL}/uploadSnapshot`, {
|
|
2621
|
+
method: "POST",
|
|
2622
|
+
body: JSON.stringify({
|
|
2623
|
+
file: base64Image
|
|
2624
|
+
})
|
|
2625
|
+
}).then((rawResponse)=>rawResponse.json());
|
|
2626
|
+
const res = await this.protoo.request("addThumbnail", {
|
|
2627
|
+
url: objectUrl
|
|
2628
|
+
});
|
|
2629
|
+
return {
|
|
2630
|
+
url: objectUrl,
|
|
2631
|
+
assetId: res.assetId
|
|
2632
|
+
};
|
|
2633
|
+
}
|
|
2594
2634
|
async deleteCapture(assetId) {
|
|
2595
2635
|
const res = await this.protoo.request("deleteCapture", {
|
|
2596
2636
|
assetId: assetId
|
|
2597
2637
|
});
|
|
2598
2638
|
return res;
|
|
2599
2639
|
}
|
|
2600
|
-
async captureVideo(videoElement) {
|
|
2640
|
+
async captureVideo(videoElement, option) {
|
|
2601
2641
|
if (this.permissions.find((permission)=>permission === "instant_picture")) {
|
|
2602
2642
|
let image;
|
|
2603
|
-
if (videoElement) image = await (0, $3575c8a563f2a1da$export$674c90a250a8b2c5)(videoElement);
|
|
2604
|
-
else if (this.webcamProducer && this.webcamProducer.track) image = await (0, $3575c8a563f2a1da$export$4a210166cc9cb64b)(this.webcamProducer.track);
|
|
2643
|
+
if (videoElement) image = await (0, $3575c8a563f2a1da$export$674c90a250a8b2c5)(videoElement, option);
|
|
2644
|
+
else if (this.webcamProducer && this.webcamProducer.track) image = await (0, $3575c8a563f2a1da$export$4a210166cc9cb64b)(this.webcamProducer.track, option);
|
|
2605
2645
|
else throw new Error("no video to capture");
|
|
2606
2646
|
return image;
|
|
2607
2647
|
} else throw new Error("feature not allowed");
|
|
@@ -5619,13 +5659,12 @@ const $8393b5c887e16c8c$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
|
|
|
5619
5659
|
]
|
|
5620
5660
|
}),
|
|
5621
5661
|
!streaming && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$f217faec90120a0c), {
|
|
5622
|
-
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.
|
|
5623
|
-
children:
|
|
5624
|
-
profile.
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
]
|
|
5662
|
+
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$6ddfb572d7b6d164), {
|
|
5663
|
+
children: profile.image ? /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$a7a74ab5cffd1455), {
|
|
5664
|
+
src: profile.image
|
|
5665
|
+
}) : profile.name ? /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$a2930b41faa750f4), {
|
|
5666
|
+
children: profile.name.slice(0, 1).toUpperCase()
|
|
5667
|
+
}) : /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $0319693440f03062$export$2e2bcd8739ae039), {})
|
|
5629
5668
|
})
|
|
5630
5669
|
}),
|
|
5631
5670
|
!extended && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $2c45d365ee8aa1ab$export$500c3c5544c37412), {
|
|
@@ -11667,6 +11706,15 @@ const $7925c01e7577d264$export$336a011955157f9a = ()=>{
|
|
|
11667
11706
|
}
|
|
11668
11707
|
]);
|
|
11669
11708
|
};
|
|
11709
|
+
const captureThumbnail = async (videoElement)=>{
|
|
11710
|
+
let image = await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).captureVideo(undefined, {
|
|
11711
|
+
addPlayWatermark: true
|
|
11712
|
+
}).catch(console.error);
|
|
11713
|
+
if (!image) image = await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).captureVideo(videoElement, {
|
|
11714
|
+
addPlayWatermark: true
|
|
11715
|
+
});
|
|
11716
|
+
await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).saveThumbnail(image);
|
|
11717
|
+
};
|
|
11670
11718
|
const removeAsset = (0, $jQDcL$react.useCallback)(async (asset)=>{
|
|
11671
11719
|
if (!asset.assetId) return;
|
|
11672
11720
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).deleteCapture(asset.assetId);
|
|
@@ -11715,7 +11763,9 @@ const $7925c01e7577d264$export$336a011955157f9a = ()=>{
|
|
|
11715
11763
|
onFinish: ()=>{
|
|
11716
11764
|
setCountdownVisible(false);
|
|
11717
11765
|
setStartRecordTime(Date.now());
|
|
11718
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).startRecord()
|
|
11766
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).startRecord().then(()=>{
|
|
11767
|
+
if (videoElementRef.current) captureThumbnail(videoElementRef.current);
|
|
11768
|
+
});
|
|
11719
11769
|
}
|
|
11720
11770
|
}),
|
|
11721
11771
|
flashAnimation && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $2c45d365ee8aa1ab$export$2b501aee548bae06), {
|
|
@@ -11751,7 +11801,6 @@ const $7925c01e7577d264$export$336a011955157f9a = ()=>{
|
|
|
11751
11801
|
if (menuBarState.photo && videoElementRef.current) {
|
|
11752
11802
|
onPhotoCapture(videoElementRef.current);
|
|
11753
11803
|
setFlashAnimation(true);
|
|
11754
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).captureVideo(videoElementRef.current);
|
|
11755
11804
|
}
|
|
11756
11805
|
if (!menuBarState.photo && !menuBarState.streaming) {
|
|
11757
11806
|
menuBarState.setStreaming(true);
|
|
@@ -11878,7 +11927,7 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
|
|
|
11878
11927
|
const [profile, setProfile] = (0, $jQDcL$react.useState)({});
|
|
11879
11928
|
const [muted, setMuted] = (0, $jQDcL$react.useState)(true);
|
|
11880
11929
|
const [streaming, setStreaming] = (0, $jQDcL$react.useState)(false);
|
|
11881
|
-
const [isLoading, setLoading] = (0, $jQDcL$react.useState)(!options.recorder);
|
|
11930
|
+
const [isLoading, setLoading] = (0, $jQDcL$react.useState)(!options.recorder?.enabled);
|
|
11882
11931
|
const [screensharing, setScreensharing] = (0, $jQDcL$react.useState)(false);
|
|
11883
11932
|
const [isAgent, setIsAgent] = (0, $jQDcL$react.useState)(false);
|
|
11884
11933
|
const [userInteractionTriggered, setUserInteractionTriggered] = (0, $jQDcL$react.useState)(false);
|
|
@@ -12583,7 +12632,7 @@ const $e68207026aca356b$export$3f94917203ab7078 = {
|
|
|
12583
12632
|
let styleElement = null;
|
|
12584
12633
|
styleElement = /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $jQDcL$reactjsxruntime.Fragment), {
|
|
12585
12634
|
children: [
|
|
12586
|
-
options.recorder && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("style", {
|
|
12635
|
+
options.recorder?.enabled && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("style", {
|
|
12587
12636
|
children: (0, (/*@__PURE__*/$parcel$interopDefault($9833f4335ab609cd$exports)))
|
|
12588
12637
|
}),
|
|
12589
12638
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("style", {
|