Video URL and Auto Play labels changed. Removed onStart. (#793)
* Removing onStart * Changing auto play and url label
This commit is contained in:
parent
90438b117b
commit
53c616b747
|
|
@ -127,7 +127,7 @@ const PropertyPaneConfigResponse: PropertyPaneConfigsResponse["data"] = {
|
|||
{
|
||||
id: "17.1.1",
|
||||
propertyName: "url",
|
||||
label: "Url",
|
||||
label: "URL",
|
||||
controlType: "INPUT_TEXT",
|
||||
placeholderText: "Enter url",
|
||||
inputType: "TEXT",
|
||||
|
|
@ -135,7 +135,7 @@ const PropertyPaneConfigResponse: PropertyPaneConfigsResponse["data"] = {
|
|||
{
|
||||
id: "17.1.1",
|
||||
propertyName: "autoPlay",
|
||||
label: "autoPlay",
|
||||
label: "Auto Play",
|
||||
helpText: "Video will be automatically played",
|
||||
controlType: "SWITCH",
|
||||
isJSConvertible: true,
|
||||
|
|
@ -154,22 +154,6 @@ const PropertyPaneConfigResponse: PropertyPaneConfigsResponse["data"] = {
|
|||
id: "17.2",
|
||||
sectionName: "Actions",
|
||||
children: [
|
||||
{
|
||||
id: "17.2.1",
|
||||
helpText: "Triggers an action when the video starts playing",
|
||||
propertyName: "onStart",
|
||||
label: "onStart",
|
||||
controlType: "ACTION_SELECTOR",
|
||||
isJSConvertible: true,
|
||||
},
|
||||
{
|
||||
id: "17.2.2",
|
||||
helpText: "Triggers an action when the video ends",
|
||||
propertyName: "onEnd",
|
||||
label: "onEnd",
|
||||
controlType: "ACTION_SELECTOR",
|
||||
isJSConvertible: true,
|
||||
},
|
||||
{
|
||||
id: "17.2.3",
|
||||
helpText: "Triggers an action when the video is played",
|
||||
|
|
@ -186,6 +170,14 @@ const PropertyPaneConfigResponse: PropertyPaneConfigsResponse["data"] = {
|
|||
controlType: "ACTION_SELECTOR",
|
||||
isJSConvertible: true,
|
||||
},
|
||||
{
|
||||
id: "17.2.5",
|
||||
helpText: "Triggers an action when the video ends",
|
||||
propertyName: "onEnd",
|
||||
label: "onEnd",
|
||||
controlType: "ACTION_SELECTOR",
|
||||
isJSConvertible: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ class VideoWidget extends BaseWidget<VideoWidgetProps, WidgetState> {
|
|||
|
||||
static getTriggerPropertyMap(): TriggerPropertiesMap {
|
||||
return {
|
||||
onStart: true,
|
||||
onEnd: true,
|
||||
onPlay: true,
|
||||
onPause: true,
|
||||
|
|
@ -59,7 +58,7 @@ class VideoWidget extends BaseWidget<VideoWidgetProps, WidgetState> {
|
|||
}
|
||||
|
||||
getPageView() {
|
||||
const { url, autoPlay, onStart, onEnd, onPause, onPlay } = this.props;
|
||||
const { url, autoPlay, onEnd, onPause, onPlay } = this.props;
|
||||
return (
|
||||
<Suspense fallback={<Skeleton />}>
|
||||
<VideoComponent
|
||||
|
|
@ -67,17 +66,6 @@ class VideoWidget extends BaseWidget<VideoWidgetProps, WidgetState> {
|
|||
url={url}
|
||||
autoplay={autoPlay}
|
||||
controls={true}
|
||||
onStart={() => {
|
||||
this.updateWidgetMetaProperty("playState", PlayState.PLAYING);
|
||||
if (onStart) {
|
||||
super.executeAction({
|
||||
dynamicString: onStart,
|
||||
event: {
|
||||
type: EventType.ON_VIDEO_START,
|
||||
},
|
||||
});
|
||||
}
|
||||
}}
|
||||
onPlay={() => {
|
||||
this.updateWidgetMetaProperty("playState", PlayState.PLAYING);
|
||||
if (onPlay) {
|
||||
|
|
@ -125,7 +113,6 @@ class VideoWidget extends BaseWidget<VideoWidgetProps, WidgetState> {
|
|||
export interface VideoWidgetProps extends WidgetProps {
|
||||
url: string;
|
||||
autoPlay: boolean;
|
||||
onStart?: string;
|
||||
onPause?: string;
|
||||
onPlay?: string;
|
||||
onEnd?: string;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user