PluginProbe ʕ •ᴥ•ʔ
Presto Player / 4.3.3
Presto Player v4.3.3
4.3.3 4.3.2 4.3.1 4.3.0 4.2.4 4.2.3 4.2.2 4.2.0 4.2.1 trunk 1.10.0 1.10.1 1.10.2 1.11.0 1.12.0 1.13.0 1.14.0 1.14.1 1.5.10 1.5.11 1.5.12 1.5.13 1.5.14 1.5.15 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.10 1.6.11 1.6.12 1.6.13 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.16 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.3-beta1 2.3.0 2.3.1 2.3.2 2.3.3 3.0.0 3.0.0-beta1 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.1.0 3.1.1 3.1.2 3.1.3 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4
presto-player / src / admin / blocks / shared / Preview.js
presto-player / src / admin / blocks / shared Last commit date
MediaProviders 1 month ago ProvidersPlaceholder 1 month ago audioPresets 1 month ago branding 8 months ago chapters 2 years ago components 1 month ago media 1 month ago overlays 1 month ago presets 2 weeks ago services 4 years ago settings 2 months ago styles 2 years ago tracks 1 month ago BlockInspectorControls.js 1 month ago BlockInspectorControls.scss 1 month ago Editing.js 2 years ago LinkPlaceholder.js 2 months ago Player.js 2 months ago Preview.js 2 years ago ProUpgradeModal.js 2 months ago VisibilityEditor.js 8 months ago audio-placeholder.js 1 month ago helpers.js 5 years ago options.js 1 month ago placeholder.js 1 month ago
Preview.js
144 lines
1 import { __ } from "@wordpress/i18n";
2 import { useState, useEffect } from "@wordpress/element";
3 import { Disabled } from "@wordpress/components";
4 import {
5 PrestoCtaOverlayUi,
6 PrestoEmailOverlayUi,
7 } from "@presto-player/components-react";
8 import { timeToSeconds } from "../util";
9 import Player from "./Player";
10
11 export default ({
12 state,
13 branding,
14 menu,
15 src,
16 poster,
17 currentTime,
18 preload,
19 overlays,
20 isDisabled = true,
21 }) => {
22 const [renderKey, setRenderKey] = useState(1);
23 const { email_collection, cta, search } = state;
24
25 useEffect(() => {
26 setRenderKey(renderKey + 1);
27 }, [
28 state.skin,
29 state["play-large"],
30 state.rewind,
31 state.play,
32 state["fast-forward"],
33 state.progress,
34 state["current-time"],
35 state.mute,
36 state.volume,
37 state.speed,
38 state.pip,
39 state.fullscreen,
40 state.captions,
41 state.hide_logo,
42 ]);
43
44 const previews = {
45 email: !!email_collection?.enabled && (
46 <PrestoEmailOverlayUi
47 className="email-overlay"
48 slot="player-end"
49 headline={email_collection?.headline}
50 style={{
51 "--presto-player-email-border-radiuss": `${email_collection?.button_radius}px`,
52 "--plyr-color-main": state?.background_color || branding?.color,
53 ...(email_collection.button_color
54 ? {
55 "--presto-player-button-color": `${email_collection.button_color}`,
56 }
57 : {}),
58 ...(email_collection.button_text_color
59 ? {
60 "--presto-player-button-text": `${email_collection.button_text_color}`,
61 }
62 : {}),
63 }}
64 defaultHeadline={__("Enter your email to play.", "presto-player")}
65 bottomText={email_collection?.bottom_text}
66 allowSkip={email_collection?.allow_skip}
67 skipText={__("Skip", "presto-player")}
68 buttonText={email_collection?.button_text}
69 placeholder={__("Email address", "presto-player")}
70 i18n={window.prestoPlayer.i18n}
71 />
72 ),
73 cta: !!cta?.enabled && (
74 <PrestoCtaOverlayUi
75 className="cta-overlay"
76 style={{
77 "--presto-player-button-border-radius": `${cta.button_radius}px`,
78 ...(cta?.background_opacity
79 ? {
80 "--presto-player-cta-background-opacity": `${
81 cta?.background_opacity / 100
82 }`,
83 }
84 : {}),
85 ...(cta.button_color
86 ? {
87 "--presto-player-button-color": `${cta.button_color}`,
88 }
89 : {}),
90 ...(cta.button_text_color
91 ? {
92 "--presto-player-button-text": `${cta.button_text_color}`,
93 }
94 : {}),
95 }}
96 slot="player-end"
97 headline={cta?.headline}
98 bottom-text={cta?.bottom_text}
99 button-link={cta?.button_link}
100 allow-skip={cta?.percentage !== 100 && cta?.show_skip}
101 borderRadius={cta?.border_radius}
102 allow-rewatch={cta?.percentage === 100 && cta?.show_rewatch}
103 skip-text={__("Skip", "presto-player")}
104 show-button={cta?.show_button}
105 button-text={cta?.button_text}
106 i18n={window?.prestoPlayer?.i18n}
107 />
108 ),
109 };
110
111 return (
112 <Disabled
113 isDisabled={isDisabled}
114 className="disable-player"
115 style={{ width: "100%" }}
116 >
117 <div className="presto-player__wrapper">
118 <Player
119 src={src || ""}
120 className={`
121 ${menu === "cta" && !!cta?.enabled && "cta-active"}
122 ${menu === "email" && !!email_collection?.enabled && "email-active"}
123 ${menu === "search" && !!search?.enabled && "search-active"}`}
124 preset={state}
125 branding={{
126 ...branding,
127 logo: state?.hide_logo ? "" : branding["logo"],
128 }}
129 i18n={prestoPlayerAdmin?.i18n}
130 preload={preload}
131 attributes={{
132 chapters: [],
133 poster: poster,
134 }}
135 currentTime={currentTime ? timeToSeconds(currentTime) : ""}
136 overlays={overlays}
137 key={renderKey}
138 adminPreview={previews?.[menu] || ""}
139 />
140 </div>
141 </Disabled>
142 );
143 };
144