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

Video without extensions won't work #53

Open
sqljim opened this issue Oct 31, 2020 · 1 comment
Open

Video without extensions won't work #53

sqljim opened this issue Oct 31, 2020 · 1 comment

Comments

@sqljim
Copy link

sqljim commented Oct 31, 2020

Hi,

I'm trying to add a video into the gallery by using the device's camera. I want to display the video in the gallery and at the same time in the background upload it to the cloud.

The issue I'm having is that my URL's look like this:

https://firebasestorage.googleapis.com/v0/b/mycoolappname.appspot.com/o/AAU%2Fperson-media%2F20201031_040941_uploadFile?alt=media&token=aafc5d4c8

Even when I set the URL (to something like newVideo.mkv or uploadedVideo.mp4) and the Type of the object I'm still not able to get the videos to play. The browser records MKV videos, which i'm able to play using a standard video tag:

But the gallery won't play them. Any ideas?

@sqljim
Copy link
Author

sqljim commented Nov 2, 2020

So I made some changes in a fork and have made a pull request. I checked that all the tests passed and added some new tests for the changes I've made.

Basically this change will let you specify the type of the 'image'. By using the image.type you can specify whether it's an image or a video. The type will be used first if specified, but the function will fall bcak to a slightly altered version of the existing functionality if the type is not specified, where it will attempt to derive the file type from the extension.

Currently the function just splits the filename by . and then pops the last element, assuming that it's a file extension. The change will do the same, except remove anything after a special character, so: mySpecialImage.jpg?alt=media&token=SDFDSFSS will return an image.

I'm new to contributing to projects so happy to make any changes required.

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

No branches or pull requests

1 participant