PluginProbe ʕ •ᴥ•ʔ
Presto Player / 2.2.2
Presto Player v2.2.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 / presets / Watermark.js
presto-player / src / admin / blocks / shared / presets Last commit date
parts 3 years ago ActionBar.js 2 years ago Behavior.js 2 years ago CTA.js 2 years ago Controls.js 5 years ago Edit.js 2 years ago Email.js 2 years ago Preset.js 4 years ago Search.js 3 years ago Style.js 2 years ago Watermark.js 4 years ago index.js 4 years ago
Watermark.js
149 lines
1 /**
2 * WordPress dependencies
3 */
4 const { __ } = wp.i18n;
5
6 const {
7 ToggleControl,
8 BaseControl,
9 RadioControl,
10 Flex,
11 RangeControl,
12 } = wp.components;
13
14 const { useEffect } = wp.element;
15
16 import DynamicText from "../overlays/components/DynamicText";
17
18 import ColorPopup from "../components/ColorPopup";
19
20 export default ({ state, updateState, className }) => {
21 const { watermark } = state;
22
23 const defaults = {
24 text: __("Enter your watermark text.", "presto-player"),
25 position: "top-right",
26 color: "#fff",
27 backgroundColor: "#333",
28 opacity: 80,
29 };
30 useEffect(() => {
31 Object.keys(defaults).forEach((key) => {
32 if (state?.watermark?.[key] === undefined) {
33 updateWatermarkState({
34 [key]: defaults[key],
35 });
36 }
37 });
38 }, [state]);
39
40 const updateWatermarkState = (updated) => {
41 updateState({
42 ...state,
43 watermark: {
44 ...watermark,
45 ...updated,
46 },
47 });
48 };
49
50 return (
51 <div className={className}>
52 <BaseControl>
53 <h3>{__("Dynamic Watermark Text", "presto-player")}</h3>
54 </BaseControl>
55 <BaseControl className="presto-player__control--watermark">
56 <ToggleControl
57 label={__("Enable", "presto-player")}
58 help={__(
59 "Add a simulated dynamic watermark over your video.",
60 "presto-player"
61 )}
62 onChange={(enabled) => {
63 updateWatermarkState({
64 enabled,
65 });
66 }}
67 checked={watermark?.enabled}
68 />
69 </BaseControl>
70
71 {watermark?.enabled && (
72 <div>
73 <DynamicText
74 text={watermark?.text}
75 update={({ text }) => {
76 updateWatermarkState({
77 text,
78 });
79 }}
80 />
81
82 <BaseControl className={className}>
83 <RadioControl
84 label={__("Position", "presto-player")}
85 options={[
86 { label: __("Top Right", "presto-player"), value: "top-right" },
87 { label: __("Top Left", "presto-player"), value: "top-left" },
88 {
89 label: __("Change Every 10 Seconds", "presto-player"),
90 value: "randomize",
91 },
92 ]}
93 selected={watermark?.position || "top-right"}
94 onChange={(position) =>
95 updateWatermarkState({
96 position,
97 })
98 }
99 />
100 </BaseControl>
101
102 <BaseControl className="presto-player__control-text-color">
103 <Flex>
104 <BaseControl.VisualLabel>
105 {__("Text Color", "presto-player")}
106 </BaseControl.VisualLabel>
107 <ColorPopup
108 color={watermark?.color || "#fff"}
109 setColor={(value) =>
110 updateWatermarkState({
111 color: value && value.hex,
112 })
113 }
114 />
115 </Flex>
116 </BaseControl>
117
118 <BaseControl className="presto-player__control-text-color">
119 <Flex>
120 <BaseControl.VisualLabel>
121 {__("Background Color", "presto-player")}
122 </BaseControl.VisualLabel>
123 <ColorPopup
124 color={watermark?.backgroundColor || "#333"}
125 setColor={(value) =>
126 updateWatermarkState({
127 backgroundColor: value && value.hex,
128 })
129 }
130 />
131 </Flex>
132 </BaseControl>
133
134 <BaseControl>
135 <RangeControl
136 label={__("Opacity", "presto-player")}
137 help={__("Opacity percentage of the watermark.", "presto-player")}
138 value={watermark?.opacity || 100}
139 onChange={(opacity) => updateWatermarkState({ opacity })}
140 min={0}
141 max={100}
142 />
143 </BaseControl>
144 </div>
145 )}
146 </div>
147 );
148 };
149