Hi, is it a known issue that videos will not load in the Emulator? Tried searching and did not see anything about this.
We have small video files that are under the right file size and are a legal format. Even with just a VideoPlayer component added, the Emulator always says, “Error 701: Unable to load [file name].” We have tried the tips from these forums for clock timers, etc., and nothing seems to work. When hooking up a physical device as the companion device, the video plays with no issues.
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select “Download Blocks as Image”. You might want to use an image editor to crop etc. if required. Then post it here in the community.
Hi, Taifun, this is the method we are trying in any app we try this in. The blocks are below. It is super simple (basically the same setup as this but without the stop button: https://www.youtube.com/watch?v=wgy1KaISfBQ) and isn’t loading in the Emulator, but is on a device. I wondered if something was missing (pretty new to App Inventor) or if this is a known bug in the Emulator.
The video file was uploaded through the media panel and then selected as the source for VideoPlayerWelcome. The file is 554 KB and is an mp4 so it should be legal. Just added a button to trigger it to play (also tried just clicking the built-in play button as shown in the video) but it continuously gives an error. I have also closed out App Inventor and reopened it thinking maybe it needed to load fresh with the file from the start and that did not work either.
did you set the source of the video in the designer? if yes, how? any screenshot of the designer settings of the videoplayer? did you upload the videos in the media section of the designer into the assets of the app?
Taifun
Screen1 is set to responsive, not fixed. I have tried this using both pixels (200x200 to make sure it is well within the size of the Emulator’s screen) and % (50% for both) and that did not work. The problem is not that is doesn’t show in the VideoPlayer window, it is that the Emulator won’t load the video file.
Which version of the emulator are you using? The older emulator version likely doesn’t have the codecs to handle MP4. The newer emulator might but I haven’t checked. If you are willing to share the MP4 file with us we can also run a test on it to better understand why it might not be working.
I have also tried other videos, including smaller sizes to see if it was a loading time issue, etc. The video in the example above is well under the size limit.
Thanks @Jamie_B, that’s helpful. I’ll see if we can replicate it here and what we might be able to do to fix it if so. If it’s possible would you mind sending me the video privately so I can run some tests?
Try this: videoTest.aia (928.4 KB)
Does it work for you (with Companion)?
For me it’s working on a Galaxy Note 8 (Android 9) and S6 (Android 7).
What version of Android are you using?
Note (to @ewpatton):
It is not possible to set the VideoPlayer.Source in the same button with VideoPlayer.Start. It is therefore not possible to change the souce afterwards (block-controlled) in the same block with which you start the video.
You need another button or use a timer:
a) ButtonX: source
b) ButtonY: start video or:
Button: source and enable a timer to start the video.
So it is not possible to do that at the same time (using only one button).
@Anke I’ve identified the issue with the source/start issue. Apparently it’s been like this since 2012. @bartmathijssen also has a fix in the queue that will give you the Source getter block.
@Anke This first file you sent did work in the Emulator. @ewpatton any ideas on why it doesn’t work in the one I messaged you? The apps are virtually the same.
For anyone else having this issue, @ewpatton and team looked into this and found the issue The version of Android that comes with the Emulator only supports the baseline h264 codec. The video files we were using were exported using an h264 high profile. This was causing errors with loading in the Emulator only but worked in a live device since that has a newer version of Android that does support high h264 videos. We are re-exporting the videos using the baseline profile instead to make this work.