Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-play video before uploading it to the server #84

Open
carrie-xin opened this issue May 29, 2020 · 6 comments
Open

pre-play video before uploading it to the server #84

carrie-xin opened this issue May 29, 2020 · 6 comments

Comments

@carrie-xin
Copy link

i want to play video before uploading it to the server, ngfBackground works fine for preview images ,but how about videos?

@AckerApple
Copy link
Owner

AckerApple commented May 29, 2020 via email

@carrie-xin
Copy link
Author

// 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

@AckerApple
Copy link
Owner

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

@carrie-xin
Copy link
Author

carrie-xin commented Jun 5, 2020

@AckerApple I've solved this problem by FileReader , thank you all the same😄

@AckerApple
Copy link
Owner

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

@carrie-xin
Copy link
Author

@AckerApple Here example with Pre-play video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants