????
Current Path : /proc/self/cwd/wp-content/plugins/presto-player/dist/components/esm/ |
Current File : //proc/self/cwd/wp-content/plugins/presto-player/dist/components/esm/presto-playlist.entry.js.map |
{"file":"presto-playlist.entry.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,4KAA4K,CAAC;AACvM,6BAAe,iBAAiB;;MCQnB,cAAc;;;;;;;kCAmBY,CAAC;;;uBASV,KAAK;;;;;IAMjC,OAAO;QACL,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;;;;IAMD,IAAI;QACF,IAAI,CAAC,UAAU,EAAE,CAAC;KACnB;;;;;;IAQD,iBAAiB,CAAC,KAAK,EAAE,aAAa;;QACpC,IAAI,CAAC,KAAK;YAAE,OAAO;;QAGnB,IAAI,CAAC,UAAU,EAAE,CAAC;;QAGlB,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC;;QAGtG,IAAI,aAAa,KAAK,SAAS,EAAE;;YAE/B,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,KAAI,MAAA,IAAI,CAAC,WAAW,0CAAE,KAAK,CAAA,EAAE;gBACjG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;aACjC;YAED,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;SACzB;KACF;;;;IAKD,UAAU;;;QAER,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;;QAEjE,IAAI,CAAC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACrD,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAC5C,IAAI,CAAC,OAAO,CAAC,c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M,0CAAE,KAAK,CAAA,CAAQ,CAC5C,EACP,YAAM,IAAI,EAAC,eAAe,IACxB,gBAAO,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAQ,CACxB,CACc,EACvB;SACH,CAAC,CACiB,EACrB;KACH;;;;;;;;;;","names":[],"sources":["src/components/core/features/presto-playlist/presto-playlist.scss?tag=presto-playlist&encapsulation=shadow","src/components/core/features/presto-playlist/presto-playlist.tsx"],"sourcesContent":[":host {\n display: block;\n overflow: hidden;\n}\npresto-player {\n opacity: 0;\n visibility: hidden;\n transition: 0.35s opacity, 0.35s visibility;\n\n &.ready {\n opacity: 1;\n visibility: visible;\n }\n}\n","import { Component, h, Prop, State, Watch, Listen, Element } from '@stencil/core';\n\nimport { PlaylistItem } from '../../../../interfaces';\n\n@Component({\n tag: 'presto-playlist',\n styleUrl: 'presto-playlist.scss',\n shadow: true,\n})\nexport class PrestoPlaylist {\n @Element() el: HTMLElement;\n\n /** Overlay component */\n private overlay: any;\n\n /** Array of videos from the Playlist */\n @Prop() items: Array<PlaylistItem>;\n\n /** Title for the Playlist */\n @Prop() heading: string;\n\n /** Count prefix string for the Playlist - Singular */\n @Prop() listTextSingular: string;\n\n /** Count prefix string for the Playlist - Plural */\n @Prop() listTextPlural: string;\n\n /** Transition duration for next video. */\n @Prop() transitionDuration: number = 5;\n\n /** Stores current video that is shown in the preview. */\n @State() currentPlaylistItem: PlaylistItem;\n\n /** Stores current video Plyr object that is shown in the preview. */\n @State() currentPlyr: any;\n\n /** Is a video playing. */\n @State() playing: boolean = false;\n\n /**\n * Listening to the Rewatch Video button click event.\n */\n @Listen('rewatch')\n rewatch() {\n this.handlePlay();\n }\n\n /**\n * Listening to the Next Video button click event.\n */\n @Listen('next')\n next() {\n this.handleNext();\n }\n\n /**\n * Plays the video, adds overlay and Presto Video styles as soon as a new object is assigned.\n * @param value Current value\n * @param previousValue Previous value\n */\n @Watch('currentPlyr')\n handleCurrentPlay(value, previousValue) {\n if (!value) return;\n\n // add the overlay.\n this.addOverlay();\n\n // add styles from the current video config.\n this.currentPlyr.elements.container.getRootNode().host.style = this.currentPlaylistItem.config.styles;\n\n // if we have a previous value, then we need to autoplay the video since we are switching.\n if (previousValue !== undefined) {\n // Restore audio (YouTube starts playing on seek if the video hasn't been played yet)\n if (this.currentPlyr.provider === 'youtube' && !this.currentPlyr.muted && this.currentPlyr?.embed) {\n this.currentPlyr.embed.unMute();\n }\n\n this.currentPlyr.play();\n }\n }\n\n /**\n * Adds overlay to the player which will regulate the Next video button.\n */\n addOverlay() {\n // create overlay\n this.overlay = document.createElement('presto-playlist-overlay');\n // assign properties.\n this.overlay.nextItemTitle = this.getNextItemTitle();\n this.overlay.isLastItem = this.isLastItem();\n this.overlay.nextItemString = this?.listTextSingular || 'Video';\n this.overlay.transitionDuration = this.transitionDuration;\n // append\n this.currentPlyr.elements?.container?.closest('.presto-player__wrapper').append(this.overlay);\n }\n\n /**\n * Lifecycle: Component will load.\n */\n componentWillLoad() {\n // Select the first video as a current video to be shown in the playlist.\n this.currentPlaylistItem = this?.items?.[0] || null;\n }\n\n /**\n * Handles the click on the playlist item.\n * @param item PlaylistItem\n */\n handleItemClick(item: PlaylistItem) {\n if (this.overlay) {\n this.overlay.show = false;\n }\n this.el.style.height = this.el.offsetHeight + 'px';\n this.el.style.width = this.el.offsetWidth + 'px';\n this.currentPlaylistItem = item;\n }\n\n /**\n * Assign the next item in the playlist as a current item.\n */\n handleNext() {\n this.overlay.show = false;\n this.currentPlaylistItem = this.getNextItem() || this.currentPlaylistItem;\n }\n\n /**\n * Play the current video.\n */\n handlePlay() {\n if (this.overlay) {\n this.overlay.show = false;\n }\n this.currentPlyr.play();\n }\n\n /**\n * Pause the current video.\n */\n handlePause() {\n this.overlay.show = false;\n this.currentPlyr.pause();\n }\n\n /**\n * Get the next item in the playlist.\n * @returns PlaylistItem Next item in the playlist.\n */\n getNextItem() {\n if (this.isLastItem()) return this.items[0];\n\n let nextItem: PlaylistItem;\n for (let i = 0; i < this.items?.length; i++) {\n if (this.items[i]?.id === this.currentPlaylistItem?.id && this.items?.length !== i + 1) {\n nextItem = this.items[i + 1];\n break;\n }\n }\n return nextItem;\n }\n\n /**\n * Checks if the current item is the last item in the playlist.\n * @returns boolean True if the current item is the last item in the playlist.\n */\n isLastItem() {\n const lastIndex = this.items?.length - 1;\n return this.items[lastIndex]?.id === this.currentPlaylistItem?.id;\n }\n\n /**\n * Get the title of the next item in the playlist.\n * @returns string Title of the next item in the playlist.\n */\n getNextItemTitle() {\n const nextItem = this.getNextItem();\n if (undefined !== nextItem) {\n return nextItem?.title || nextItem?.config?.title;\n }\n return '';\n }\n\n /**\n * Rendering the component.\n * @returns Web Component\n */\n render() {\n if (!this.items?.length) return '';\n\n const listTextS = this.listTextSingular ? this.listTextSingular : 'Video';\n const listTextP = this.listTextPlural ? this.listTextPlural : 'Videos';\n\n return (\n <presto-playlist-ui>\n {!!this.currentPlaylistItem.config?.src ? (\n <presto-player\n slot=\"preview\"\n src={this.currentPlaylistItem.config?.src}\n {...this.currentPlaylistItem.config}\n video_id={this.currentPlaylistItem.config?.id}\n id={`presto-player-${this.currentPlaylistItem.config?.id}`}\n media-title={this.currentPlaylistItem.config?.title}\n class={this.currentPlaylistItem.config?.playerClass}\n key={this.currentPlaylistItem.config?.id}\n provider={this.currentPlaylistItem.config?.provider}\n onPlayerReady={e => {\n this.currentPlyr = e.detail;\n this.el.style.height = null;\n this.el.style.width = null;\n }}\n onPlayedMedia={() => (this.playing = true)}\n onPausedMedia={() => (this.playing = false)}\n onEndedMedia={() => (this.overlay.show = true)}\n />\n ) : (\n <slot name=\"unauthorized\" slot=\"preview\" />\n )}\n\n <div slot=\"title\">{this.heading || 'Playlist'}</div>\n\n <div slot=\"count\">\n {this.items.length} {this.items.length > 1 ? listTextP : listTextS}\n </div>\n\n {this.items.map(item => {\n return (\n <presto-playlist-item\n slot=\"list\"\n onClick={() => this.handleItemClick(item)}\n active={this.currentPlaylistItem?.id === item?.id}\n playing={this.currentPlaylistItem?.id === item?.id && this.playing}\n class={this.currentPlaylistItem?.id === item?.id ? 'active' : ''}\n key={item?.id}\n onTriggerPause={() => this.handlePause()}\n onTriggerPlay={() => this.handlePlay()}\n >\n <span slot=\"item-title\">\n <span>{item?.title || item?.config?.title}</span>\n </span>\n <span slot=\"item-duration\">\n <span>{item?.duration}</span>\n </span>\n </presto-playlist-item>\n );\n })}\n </presto-playlist-ui>\n );\n }\n}\n"],"version":3}