Start a new topic

VideoDrawable loader

VideoDrawable loader

Hi , I wanted to ask two questions about VideoDrawables. I have a VideoDrawable which uses a video file on a server and so it takes time to load the video , I wanted to use a loader which shows the percentage of the loaded video but didn't find any related method in the documentation. My second question is how can I add a fullscreen mode to the video which is playing on my marker.

I'll appreciate if you can help me with these.

Thanks very much

Hi , please help me on this problem , It seems the only way is to download the complete file and store it in a local folder and then play it with a local url. I'll appreciate if you can help me on a way to download the file with javascript.


I don't think you can download the file using javascript. You can download it from the native part of your application, using Java, but then the url would be a local file, and you could have problem trying to play that video inside an AR world loaded via http.

You could also include your video (and AR world) in the application assets instead of downloading it.

Hi Joee,

The SDK does not provide any status/progress functionality, you would have to implement it on your own. We usually use "spinning wheels" for that, e.g. an image that rotates 360 degrees until the video is fully loaded. However, the rotation functionality must be implemented on your own.

For your secind question: You can play a video full screen using AR.context.startVideoPlayer(url).



Hi , due to my other question in this thread I wanted to play the video fullscreen and thanks for your help I could do that with AR.context.startVideoPlayer(fileUrl); and it was working fine when I was testing the project on the samples package of the sdk. Now I wanted to create a clean and new project for my own and everything is fine but when I execute AR.context.startVideoPlayer(fileUrl) it gives me error and closes the app. I wanted to ask if there are any prerequesite code to implement this function.

Thanks very much

Can you describe the error you are getting when trying to play video? Is it an error message in the WebView or an exception in Android logcat? On which device are you testing your application?

The error is "Unfortunately , sampleApp has stopped" and I think it's a native error.

The same code in javascript is working quite well in WikitudeSDKSamples but gives me this error this time in new project.


Do you see any exception logged in android Logcat?

If you are trying to launch a full screen video, maybe it's a problem with the MediaPlayer activity.

See the manifest xml file in the sample application, there is a section for the MediaPlayerActivity, you should have something similar in your manifest.

Hi , Thanks so much , adding that activity to the manifest solved the error :)

Thanks , do you have any samples or hints on how to implement a loader which shows the progress of loading?

Unfortunately there is currently no official progress-sample available.
It is quite straight forward:

Define div with spinning wheel in it

Define onLoaded-method of AR.VideoDrawable.

Hide div once onLoaded method fires

You may even go a more advanced way in case you have more assets to load, compare stackoverflow posts.
Hope that helps.

Kind regards,

Hi , I also wanted to know more about how wikitude loads the assets. I have multiple VideoDrawables all with urls from a server, How these videos get loaded? are they starting to load when you open application or they start to load when you play them?

thanks very much

Hi Joee,

An AR.VideoDrawable loads the video right after its creation.
You may e.g. implement "onLoaded" method of the videos you like to load upfront and update a progressbar accordingly. It is recommended to also implement the "onError" method, so you can handle possible server-downtimes or connection-error properly.

Kind regards,

Thanks very much. I implemented a wheel loader which is enabled until the onLoad triggers. But one thing I noticed was that onLoad doesn't trigger after the whole video file is downloaded and it triggers after the download of some the video file. I wanted to check if it's true and if so how can I trigger onLoad after the video is downloaded completely or in another scenario how can I know the times of loading after onLoad has been triggered (something like youtube where it shows the loader even when it's loading the video in the middle parts).

Thanks very much
Login or Signup to post a comment