Tuesday 24 November 2020

Open local video on Android device, from a QR code

Background

Some teams in my company's facilities are using Android tablets for multiple operations. We would like to allow them to access video demos from their tablets, when they are at specific places in the facility, without having to search through the tablet for the right video. So we thought of QR codes (printed on paper, stuck to the wall). Problem is: for security reasons, we can't allow the devices to access any network.

Question

So the idea is to store the videos locally, and have the QR code route to the local file. I thought this would be easy but it doesn't appear to be.

I have generated QR codes like file:///path/to/my/file.mp4, also trying to play with intents, like this: file:///path/to/my/file.mp4#Intent;scheme=file;action=android.intent.action.VIEW;type=video/mp4;end.

(+ variants including intent://, using scheme=file, targeting images instead of videos...)

In the best cases, the browser opens, closes, and I receive "Cannot display file. Invalid PDF", and in the worst cases, "Sorry, the application could not be launched. The bar code content may be invalid.".

I also tried variants (images instead of videos, URL vs plain text QR codes, several code scanner applications), all with the same result. I have searched through SO, but most questions are about doing this programmatically in an application, while I would like to avoid designing an app just for this.

What am I doing wrong? Is there no way to do this that way?

Note: I had absolutely no knowledge about Android and intents before trying to solve this case, there may be smarter workarounds. Any hint is appreciated.



from Open local video on Android device, from a QR code

No comments:

Post a Comment