Media player - weird behaviour

Not entirely sure I understand any of that!

So, my MP4 files are short, but lots of them. When uploaded to the APP inventor, I cannot produce an APK - It fails I assume due to too much uploaded data.
I have already reduced the quality to the lowest I can.

So, therefore the only option I could see was to upload the MP4 files from the phone itself (I can add the files in a folder).

I cannot get past the hidden player controls. I need those to go away and they just don't. No idea why Fullscreen = false breaks the player (blank screen, only audio).

I suspect I am trying to achieve something that MIT Inventor isn't really suited for

Because it is not possible to hide the controls (of the VideoPlayer component).

There is a 30MB limit for the AIA. What is the total size of your videos?
Try http://code.appinventor.mit.edu/. There is a 50MB limit.

If you want no controls, then perhaps consider using a webviewer and html5 video:

(this also uses an extension, so Android only)

Thanks for all the suggestions. I will take a look.

So, why is there an option to set videoPlayer to 'Hide'? No doubting, just wondering what the point of that option is

Moving over to http://code.appinventor.mit.edu/ works. I can upload all my files.
So I went back to the simple media player, but that only plays sound - video is missing.

Time to abandon this I think. I clearly doesn't want to play ball

OK... just seen it only plays audio.

Well if it's impossible to hide the controls of the Video player, I'll abandon MIT Inventor for this project and use a media player with a screen instead of an App.

I don't understand enough to go down the HTML5 route.
Thanks for the advice

So...

Seeing as I am clearly a bit thick here.

I can get videoPlayer to work, I just can't hide the controls and I need to do that.

I found this other video player extension, but just cannot get the path correct.
What would be the required path to access the Vid1.mp4 video that I have uploaded to the editor?

I know where it is on the phone .....(\Internal storage\Android\data\edu.mit.appinventor.aicompanion3\files\assets\Vid1.mp4)

But that fails for reasons I think you have already pointed out.

I didn't think this was going to be so annoyingly difficult (for an idiot like me)

Use the File component blocks to access an asset in the media folder for both companion and compiled app:

image

(You may need to remove the file:// prefix)

image

And again, there is no such path as \Internal storage, on Android this is /storage/emulated/0

(my guess is you are accessing that folder via Windows when connected over USB ?)

Thank you for that advice.

Tried both options (if I have used them correctly).

I get the error:

Attempt to invoke virtual method 'void android.widget.VideoView.setVideoPath(java.lang.String)' on a null object reference.

I am assuming this is a path issue

Yes - that was looking for the file in Windows which I now realise is incorrect.

Are you setting the video layout to an arrangement, I do not see blocks for that?

So for the newbie dumb person, something like this doesn't work without a rooted device?

/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/assets/Vid1.mp4

Does the video need an arrangement? ZERO instructions for people that do not understand the blocks with that extension.

I thought the arrangement was only needed if not using the whole page.
I will add that, but I think this is also a path issue

I think for all our sanity, I had better admit defeat

No rooted device needed to access assets.

I added the missing video arrangement block and now I get an error regarding that.

I don't see any any possible configuration for the layout block (in fact, I don't see the point of it at all). You can only get one block to interact with it and it's not the same block as in that thread.

Clearly asking MIT Inventor to auto-play a video with no controls is insanely impossible # 2 days wasted

  1. I don't believe that extension (the videoLayout one) will be of any use to you, nowhere does it say it will hide the controls, and needs to be compiled to an APK for it to work.
  1. Your statement is just not true, I provided you with a link to an example aia using html5 video and a webviewer which works just fine.

The Plyr Video player looks nice. But I have no idea how to install an extension that doesn't have the .aix prefix. The GIT link doesn't have an .aix as far as I could see.

Webviewer. Would I not need an internet connection for that? (which I won't have in this usage)

Extensions always end with .aix
You can find the download link in the download section here V 2.0.6 Plyr Video Player | Fullscreen, Qualities, Captions, Thumbnail, Attaractive UI - Extensions - Kodular Community

Taifun

Thanks. I'll have a tinker with it.
That example above, I can't find some of the blocks. I will just have to see what I can do with this

VideoPlayer_withoutControls.aia (575.9 KB)

1 Like

Many thanks for taking the time to assist.
I tried the VideoPlayer_withoutControls.aia

The video plays sound but no visual. Just looking into that.
I am almost at the point of just calling it a day... taking far too much of my time

Thanks again

It should look like I showed in the video (on all Android version, >=Android 4.4).
Android version, device name?