PageSourceSearch

https://idfoman.com/_next/static/chunks/reactPlayerTiktok.c6959180f36df5f8.js

js idfoman.com collected 2026-10-07 00:00:19 UTC 8,011 bytes, 29 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[491],{380975:function(e,t,o){o.r(t),o.d(t,{default:function(){return u}});var i=o(902265);let r=/tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/,s={INIT:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3},a={[s.INIT]:"emptied",[s.PAUSED]:"pause",[s.ENDED]:"ended",[s.PLAYING]:"play",[s.BUFFERING]:"waiting"};function getTemplateHTML(e,t={}){let o={src:serializeIframeUrl(e,t),frameborder:0,width:"100%",height:"100%",allow:"accelerometer; autoplay; fullscreen; encrypted-media; gyroscope; picture-in-picture"};return t.config&&(o["data-config"]=JSON.stringify(t.config)),`
2    <style>
3      :host {
4        display:inline-block;
5        min-width: 300px;
6        min-height: 150px;
7        position: relative;
8      }
9      iframe {
10        position:absolute;
11        top:0;
12        left:0;
13        width:100%;
14        height:100%;
15        border:0;
16      }
17    </style>
18    <iframe ${serializeAttributes(o)} title="TikTok video"></iframe>
19  `}function serializeIframeUrl(e,t={}){if(!e.src)return;let o=e.src.match(r),i=o&&o[1],s={controls:""===e.controls?null:0,autoplay:e.autoplay,muted:e.muted,loop:e.loop,rel:0,...t.config};return`https://www.tiktok.com/player/v1/${i}?${serialize(s)}`}let TikTokVideoElement=class TikTokVideoElement extends(globalThis.HTMLElement??class{}){static getTemplateHTML=getTemplateHTML;static shadowRootOptions={mode:"open"};static get observedAttributes(){return["src","controls","loop","autoplay","muted"]}loadComplete=new PublicPromise;#e;#t;#o=!1;#i=0;#r=!0;#s=null;#a=100;#n=0;#l;constructor(){super(),this.#u("config")}async load(){if(this.#e)return;this.shadowRoot||this.attachShadow(TikTokVideoElement.shadowRootOptions);let e=!this.#t;if(this.#t&&(this.loadComplete=new PublicPromise),this.#t=!0,await (this.#e=Promise.resolve()),this.#e=null,this.#i=0,this.#o=!1,this.#r=!0,!this.src){this.shadowRoot.innerHTML="",globalThis.removeEventListener("message",this.#d);return}let t=this.shadowRoot.querySelector("iframe"),o=namedNodeMapToObject(this.attributes);e&&t&&(this.#s=JSON.parse(t.getAttribute("data-config")||"{}")),(null==t?void 0:t.src)&&t.src===serializeIframeUrl(o,this)||(this.shadowRoot.innerHTML=getTemplateHTML(o,this),t=this.shadowRoot.querySelector("iframe")),this.#l=t,globalThis.addEventListener("message",this.#d)}async attributeChangedCallback(e,t,o){if(t!==o)switch(e){case"muted":await this.loadComplete,this.muted=null!=o;break;case"autoplay":case"controls":case"loop":case"src":this.load();return}}get config(){return this.#s}set config(e){this.#s=e}#d=e=>{var t;if(e.source!==(null==(t=this.#l)?void 0:t.contentWindow))return;let o=e.data;if(null==o?void 0:o["x-tiktok-player"])switch(o.type){case"onPlayerReady":this.loadComplete.resolve();break;case"onStateChange":{this.#r=[s.INIT,s.PAUSED,s.ENDED].includes(o.value);let e=a[o.value];e&&this.dispatchEvent(new Event(e));break}case"onCurrentTime":this.#i=o.value.currentTime,this.#n=o.value.duration,this.dispatchEvent(new Event("durationchange")),this.dispatchEvent(new Event("timeupdate"));break;case"onVolumeChange":this.#a=o.value,this.dispatchEvent(new Event("volumechange"));break;case"onMute":this.#o=!!o.value,this.#a=o.value?0:this.#a,this.dispatchEvent(new Event("volumechange"));break;case"onError":this.dispatchEvent(new Event("error"));break;default:console.warn("Unhandled TikTok player message:",o)}};#c(e,t){var o;if(!(null==(o=this.#l)?void 0:o.contentWindow))return;let i={"x-tiktok-player":!0,type:e,...void 0!==t?{value:t}:{}};this.#l.contentWindow.postMessage(i,"*")}async play(){await this.loadComplete,this.#c("play")}async pause(){await this.loadComplete,this.#c("pause")}async #h(e){await this.loadComplete,this.#c("seekTo",Number(e))}async #p(){await this.loadComplete,this.#c("mute")}async #m(){await this.loadComplete,this.#c("unMute")}get volume(){return this.#a/100}set volume(e){console.warn("Volume control is not supported for TikTok videos.")}get currentTime(){return this.#i}set currentTime(e){this.#h(e)}get muted(){return this.#o}set muted(e){this.#o=e,e?this.#p():this.#m()}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(e){this.toggleAttribute("muted",!!e)}get paused(){return this.#r}get duration(){return this.#n}get src(){return this.getAttribute("src")}set src(e){this.setAttribute("src",e??"")}#u(e){if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}}};let PublicPromise=class PublicPromise extends Promise{constructor(e=()=>{}){let t,o;super((i,r)=>{e(i,r),t=i,o=r}),this.resolve=t,this.reject=o}};function namedNodeMapToObject(e){let t={};for(let o of e)t[o.name]=o.value;return t}function boolToBinary(e){let t={};for(let o in e){let i=e[o];!0===i||""===i?t[o]=1:!1===i?t[o]=0:null!=i&&(t[o]=i)}return t}function serialize(e){return String(new URLSearchParams(boolToBinary(e)))}function serializeAttributes(e){let t="";for(let o in e){let i=e[o];""===i?t+=` ${escapeHtml(o)}`:t+=` ${escapeHtml(o)}="${escapeHtml(`${i}`)}"`}return t}function escapeHtml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/`/g,"&#x60;")}globalThis.customElements&&!globalThis.customElements.get("tiktok-video")&&globalThis.customElements.define("tiktok-video",TikTokVideoElement);var n=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),l={className:"class",htmlFor:"for"};function defaultToAttributeName(e){return e.toLowerCase()}function defaultToAttributeValue(e){return"boolean"==typeof e?e?"":void 0:"function"==typeof e?void 0:"object"!=typeof e||null===e?e:void 0}function setProperty(e,t,o){var i;e[t]=o,null==o&&t in((null==(i=globalThis.HTMLElement)?void 0:i.prototype)??{})&&e.removeAttribute(t)}var u=function({react:e,tagName:t,elementClass:o,events:i,displayName:r,defaultProps:s,toAttributeName:a=defaultToAttributeName,toAttributeValue:u=defaultToAttributeValue}){let d=Number.parseInt(e.version)>=19,c=e.forwardRef((r,c)=>{var h,p;let m=e.useRef(null),f=e.useRef(new Map),v={},g={},T={},b={};for(let[e,t]of Object.entries(r)){if(n.has(e)){T[e]=t;continue}let i=a(l[e]??e);if(o.prototype&&e in o.prototype&&!(e in((null==(h=globalThis.HTMLElement)?void 0:h.prototype)??{}))&&!(null==(p=o.observedAttributes)?void 0:p.some(e=>e===i))){b[e]=t;continue}if(e.startsWith("on")){v[e]=t;continue}let r=u(t);if(i&&null!=r&&(g[i]=String(r),d||(T[i]=r)),i&&d){let e=defaultToAttributeValue(t);r!==e?T[i]=r:T[i]=t}}if("undefined"!=typeof window){for(let t in v){let o=v[t],r=t.endsWith("Capture"),s=((null==i?void 0:i[t])??t.slice(2).toLowerCase()).slice(0,r?-7:void 0);e.useLayoutEffect(()=>{let e=null==m?void 0:m.current;if(e&&"function"==typeof o)return e.addEventListener(s,o,r),()=>{e.removeEventListener(s,o,r)}},[null==m?void 0:m.current,o])}e.useLayoutEffect(()=>{if(null===m.current)return;let e=new Map;for(let t in b)setProperty(m.current,t,b[t]),f.current.delete(t),e.set(t,b[t]);for(let[e,t]of f.current)setProperty(m.current,e,void 0);f.current=e})}if("undefined"==typeof window&&(null==o?void 0:o.getTemplateHTML)&&(null==o?void 0:o.shadowRootOptions)){let{mode:t,delegatesFocus:i}=o.shadowRootOptions,s=e.createElement("template",{shadowrootmode:t,shadowrootdelegatesfocus:i,dangerouslySetInnerHTML:{__html:o.getTemplateHTML(g,r)}});T.children=[s,T.children]}return e.createElement(t,{...s,...T,ref:e.useCallback(e=>{m.current=e,"function"==typeof c?c(e):null!==c&&(c.current=e)},[c])})});return c.displayName=r??o.name,c}({react:i,tagName:"tiktok-video",elementClass:TikTokVideoElement,toAttributeName:e=>"muted"===e?"":"defaultMuted"===e?"muted":defaultToAttributeName(e)});/*! Bundled license information:
20
21ce-la-react/dist/ce-la-react.js:
22  (**
23   * @license
24   * Copyright 2018 Google LLC
25   * SPDX-License-Identifier: BSD-3-Clause
26   *
27   * Modified version of `@lit/react` for vanilla custom elements with support for SSR.
28   *)
29*/}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.