How to Remove Video Preview When User click on Delete in ReactJS

不打扰是莪最后的温柔 提交于 2019-12-11 15:35:44

问题


I am working on project in reactjs, Currently I am using ant-design form for selection of video and I implemented some logic when user click on video then display video to below but when user click on delete button and select another one the preview video is not remove with delete button . I will share my code please review it and Please help me

Thanks

Code

<PhotoText>Select a Video to Upload</PhotoText>
      <FormItem>
        {getFieldDecorator('video', {
          rules: [
            {
              required: true,
              message: 'Please upload video!',
            },
          ],
        })(
          <Dragger onChange={this.onChange} accept="video/*">
          <p className="ant-upload-drag-icon">
            <Icon type="upload" />
          </p>
          <p className="ant-upload-text">
            Click or drag Video to this area to upload
          </p>
        </Dragger>,
        )}
        { this.state.video ? <video width="350" height="280" style={{width:'450px',marginLeft:'23px'}} src={this.state.video} controls/>  : null }
      </FormItem>

来源:https://stackoverflow.com/questions/53650271/how-to-remove-video-preview-when-user-click-on-delete-in-reactjs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!