Video freezes at a last frame or keeps black but audio plays | Bug in Desktop Preview


#1

I am trying a very simple project:
Scanning a target image will automatically start a video.
That works somehow, but inconsistently. I think I am doing something wrong in general.

I added a simple Object as a plane below the target image in the hierarchy where its material shall be the video. Then I tried multiple ways to add the video:

  • I dragged & dropped the video from the media library as suggested in Reasons why I cannot add MP4 to VideoTexture?
  • I added a new Video by right clicking and adding new --> Video and selected the video file in the source from its properties
    and then no matter which way I choose I set it as material from the Plane’s properties.

In the properties of the Plane I used the Layer Mode “test_3d”, which seemed to work best, for blend I choose “default” and for Cull Faces I choose “none”. I transformed the plane a little to overlay the target image and to be in 16:9 format so I used for Scale “1.6 | 1.1 | 1”.

I had 3 MP4 Videos as test files:

My first file is private, so I cannot link it, it was black all the time, but the audio played well.
For the other files the video was at times black, but when they played, they did only once and after that they looped, but the video didn’t play any more, but froze with a picture from the video.

I added a pointerdown - event to the plane which should restart the video and this worked too but only the audio was replayed.

What am I doing wrong here? Any help would be appreciated. Thanks in advance.


#2

Hi @vollrath,
The following is the ZPP file I have created to help you understand how to tackle the above problem.
I have used the one 5MB ([https://raw.githubusercontent.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4 ] video in my demonstration.
The code is also commented on.
video help.zpp (5.1 MB)
The tracking image and zapcode are attached below.


I hope that you will be able to get a hang of your problem with the help of this.
Also, try and see the extensive documentation on the zapworks website which will surely solve any doubts you have in scripting.
If you have any problems understanding the ZPP please feel free to reach out.

Prodipta.


#3

Thank you very much for your help and your example project. That made things a little more clear, because I have the same issue with your project. What I forgot to mention, but which seems to be the problem: I am using the “Launch in Zappar Desktop” function at my desktop pc and this causes probably all my problems. When I try your project with my phone, it works as expected, finish event is fired and replay button is shown. When I try my own project with the phone, no auto replay of the video occurs and when I tap my plane with the pointerdown event, the video starts from the beginning. It also works with my “large” video file.

I cannot believe that I spent almost a day figuring out whats wrong with the videos without even checking the phone, whereas the desktop preview function seems to be the bug in here.


#4

I cannot believe that I spent almost a day figuring out whats wrong with the videos without even checking the phone, whereas the desktop preview function seems to be the bug in here.

If it’s any consolation, been there as well. There was this one time desktop preview wouldn’t work properly and I wasted my time trying to figure out why when it was actually working on the phone. Tough luck.