Video preview #727

Open
opened 2017-04-03 07:52:08 +00:00 by MaxKorolkov · 4 comments
MaxKorolkov commented 2017-04-03 07:52:08 +00:00 (Migrated from github.com)

Can any one tried how to show the video preview. I need to show the preview of a video before it is uploaded?

Can any one tried how to show the video preview. I need to show the preview of a video before it is uploaded?
Sathishchary commented 2017-05-10 15:44:43 +00:00 (Migrated from github.com)

I have also same problem. need to show the video preview before upload

I have also same problem. need to show the video preview before upload
Sathishchary commented 2017-05-11 12:48:04 +00:00 (Migrated from github.com)
it's resolved my problem. https://github.com/valor-software/ng2-file-upload/issues/158
HarshaVardhanPVK commented 2019-05-20 05:59:18 +00:00 (Migrated from github.com)

@MaxKorolkov did you found a way to preview video?

@MaxKorolkov did you found a way to preview video?
iamsahilralkar commented 2019-11-05 07:54:51 +00:00 (Migrated from github.com)

follow the following simple solution

import { DomSanitizer} from '@angular/platform-browser';
    ...
    public previewPath: any;
    ....
    constructor(private sanitizer: DomSanitizer) {
       this.uploader.onAfterAddingFile = (fileItem) => {
          this.previewPath = this.sanitizer.bypassSecurityTrustUrl((window.URL.createObjectURL(fileItem._file)));
        }
    }

In html

<video width="100" #videoPlayer controls controlsList="nodownload">
                                                                <source [src]="previewPath " />   
                                                                Browser not supported
                                                        </video>
follow the following simple solution ``` import { DomSanitizer} from '@angular/platform-browser'; ... public previewPath: any; .... constructor(private sanitizer: DomSanitizer) { this.uploader.onAfterAddingFile = (fileItem) => { this.previewPath = this.sanitizer.bypassSecurityTrustUrl((window.URL.createObjectURL(fileItem._file))); } } ``` In html ``` <video width="100" #videoPlayer controls controlsList="nodownload"> <source [src]="previewPath " /> Browser not supported </video> ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#727