Start a new topic

Show video without marker

Show video without marker


Hello,

It's possible to show video in front of user without a marker detection?

Hello Eva,

I want to show a video with transparent background like i usually do when user detects marker with phone camera. The problem is that i don't want to use marker, but simply show the video when user open the camera.

Hello Eva,

Yes i will use video on relative geo location. But i don't know how to do this.

I'm using this snippet to try get something work but it doesn't

var video = new AR.VideoDrawable("assets/transparentVideo.mp4", 1.5, {
offsetX: 0.0,
offsetY: 0.0,
isTransparent: true
});

video.play(-1);
video.pause();

var location = new AR.RelativeLocation(null, 0, 0, 0);

var pageOne = new AR.GeoObject(location, {
drawables : { cam : },
onEnterFieldOfVision: function onEnterFieldOfVisionFn() {
video.resume();
},
onExitFieldOfVision: function onExitFieldOfVisionFn() {
video.pause();
}
});

 

No one has experience my issue?

Hi Luca,

If you wish to work with Geo Locations then you can choose between AR.GeoLocation or AR.RelativeLocation. With the relative location the location of the video will be relative to the user's position. You can find sample code and more information on how to work with geo locations in our documentation.

Thanks

Hello Eva,

In the documentation is mentioned only

var modelEarth = new AR.Model("assets/earth.wt3", {
onLoaded: this.worldLoaded,
scale: {
x: 1,
y: 1,
z: 1
}
});

 

How can i use video object?

Hello Luca,

Could you please describe in detail what your use case is so that we can understand how to achieve that? 

Thanks

Hello Eva,

I changed the code snipped in the tutorial as below

/*
First a location where the model should be displayed will be defined. This location will be relative to the user.
*/
var location = new AR.RelativeLocation(null, 5, 0, 2);

/*
Next the model object is loaded.
*/
video = new AR.VideoDrawable("assets/transparentVideo.mp4", 1.5, {
offsetX: 0.0,
offsetY: 0.0,
isTransparent: true
});

/*
Putting it all together the location and 3D model is added to an AR.GeoObject.
*/
var obj = new AR.GeoObject(location, {
drawables: {
cam:
}
});



There are no errors in the log, but i can't see the video but only the audio!

Maybe is not possible to show video at geo location?

Hi,

If you wish to have augmented objects then you basically have two choices. You can work with image tracking or you can work with geo locations. So in order to have the transparent video show up you need to trigger one of the above.

Thanks

Hi Luca,

You need to add the following code as well to make sure that the video starts immediately after the GeoLocation is loaded. Supplying -1 to play tells the Wikitude SDK to loop the video infinitely so you can choose any positive number to re-play it multiple times.

var obj = new AR.GeoObject(location, {

          drawables: {

             cam:

          },

   onEnterFieldOfVision: function onEnterFieldOfVisionFn () {

       video.play(-1);

   }

      });

Hi Luca,

What you need to do is replace the images with a video and enable/create the POIs once the video is finished. Just assign a function to the VideoDrawable's onFinishedPlaying trigger. As the name suggests it will be called once the video finshed playing.

Thanks
Login or Signup to post a comment