angular-file
angular-file copied to clipboard
pre-play video before uploading it to the server
i want to play video before uploading it to the server, ngfBackground works fine for preview images ,but how about videos?
Build me any example with vanilla JavaScript and implement
_Acker Apple
On May 29, 2020, at 3:47 AM, carrie-xin [email protected] wrote:
i want to play video before uploading it to the server, ngfBackground works fine for preview images ,but how about videos?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
// preview image
<button ngfSelect accept="image/*" [(file)]="imageFile" (fileChange)="changeImage()">
select image
</button>
<div [ngfBackground]="imageFile"></div>
// play video ?
<button ngfSelect accept="video/*" [(file)]="videoFile" (fileChange)="changeVideo()">
select video
</button>
// this not working
<video controls autoplay >
<source [ngfSrc]="videoFile">
</video>
@AckerApple i just want to play video with source file, because it takes too much time to upload videos to the server. Do you have a solution? thanks
Hey that’s not vanilla javascript
I’ve not had the need before to have a video preview during file upload so I do not off hand know what code to write. I know it’s not hard and docs exist it’s just I am busy elsewhere.
If you can build and example of how to use a selected file As a video preview or give me links to super easy docs, I can then implement into this package for tou
@AckerApple I've solved this problem by FileReader , thank you all the same😄
Make the world a better place and share me your solution or a link to where you learned how to do so I can implement in the future
@AckerApple Here example with Pre-play video