Simple one file mp4 video player from local storage

What is the size of your mp4 file ?

How will this get into the Download folder of the user ?

The whole idea is this that there will be 4 samsung phones and there will be 5 nfc tags and 5 video files which will be stored on every of 4 samsung phones. User will put one of the phone to one of the 5 nfc tags and then open video player with specific video file locally storage. So there will be no Internet connection and the phones will be the same for the whole time with video files the same on every phones

Video playback should be the easy part. Test, and test again that NFC works for each of the phones.

Example, using html and video from assets. I needed the video in webm format for this to work.

playvid.aia (431.3 KB)

html

<!DOCTYPE html> 
<html> 
<body>
<div style="text-align:center"> 
  <button onclick="play()">Play</button> 
  <br><br>
  <video id="video1" width="360">
    <source src="mov_bbb.webm" type="video/webm">
    Your browser does not support HTML video.
  </video>
</div> 
<script> 
var myVideo = document.getElementById("video1");
myVideo.load(); 
function play() { 
    myVideo.play(); 
} 
myVideo.addEventListener('ended', function(e) {
  myVideo.load();
})
</script> 
</body> 
</html>

Video courtesy of Big Buck Bunny

Thank you and today i will be testing your code and i will write about result

You might also want to try this:

videoPlayerOverlay.aia (450.3 KB)

I used the Video Player component and @vknow360 's custom sheet extension to provide an "overlay" which prevents interaction with the video player.

I have it set so that when you press the Back button, the video restarts.

1 Like

I have tested the videoPlayerOverlay.aia but with some modification:

  1. my all 5 video files in mp4 format will be stored in /Documents folder for example 20250110_130758.mp4; 20250110_130759.mp4 etc.
  2. I think that I use your app on every phone five times I mean:
  • NFC tag number 1 - your app number 1 with specific file path - video number 1
  • NFC tag number 2 - your app number 2 with specific file path - video number 2
    etc...
    So I will install your app 5 times on every of 4 phones and also put 5 video files on every of 4 phones.
    Unfortunately the app run correctly but the video isn't playing and the screen is very small
    Is your app can full screen after startup and shut down after the video end?

My suggestion is just a demo (art of the possible), and will require more work to fit your requirements.

Does your NFC open the app ?

You could create one app, and use the NFC tag value to select the video to be played ?

Yes, you can make fullscreen (landscape) and close app after video played.

Don't use fullscreen block, this makes the controls display for a couple of seconds.

Set the Screen orientation to landscape
image
Set the video dimensions to fit your devices (in my case 370x672 was good for the example video)
image

To close the app after the video has played (this won't work in companion)
image

I am sitting right now at your app and so the first path to file will be file:///storage/emulated/0/Documents/20250110_130758.mp4
but there is error 908: The permission READ_MEDIA_VIDEO has been denied. Please enable it in the Setting app but there is no way to add permission.
yes my nfc can open every app so that was my idea to install five apps with specific path files

to add permission I must add ActivityStarter am I right? Sorry for many questions but I am learning how to create first app

image

probably won't play the video first time, but restart and it should be OK?

1 Like

The video source should only be assigned when READ permission has been granted, i.e. when the app is first started in the .PermissionGranted event.

Just tested with apk, as indicated above need to give permission first time run, after that, no issues. For this particular application of an app, no real issue.

I am searching GetASD1 Sdk Version block but I don't see where to find

It is from an extension, use the second method which tests the Android Platform version.

Are any of your devices less than Android 13 ?

Android 14

Then you only need to ask for the READ_MEDIA_VIDEO permission.

Possibly not necessary, but you should also put your videos into the Movies folder...

I found the extension GetASD.aix

now i am searching call AndroidVer block