I'm trying to load two different videos to show them on specific marker but android always stop. Why?
If i load video singular all works fine...
My code is
var video = new AR.VideoDrawable("assets/vid1.mp4", 1.5, { offsetX: 0.0, offsetY: 0.0, isTransparent: true });
video.play(-1); video.pause();
var video2 = new AR.VideoDrawable("assets/vid2.mp4", 1.5, { offsetX: 0.0, offsetY: 0.0, isTransparent: true });
video2.play(-1); video2.pause();
var pageOne = new AR.Trackable2DObject(this.tracker, "marker_vid1", { drawables: { cam: }, onEnterFieldOfVision: function onEnterFieldOfVisionFn() { video.resume(); }, onExitFieldOfVision: function onExitFieldOfVisionFn() { video.pause(); } });
var pageTwo = new AR.Trackable2DObject(this.tracker, "marker_vid2", { drawables: { cam: }, onEnterFieldOfVision: function onEnterFieldOfVisionFn() { video2.resume(); }, onExitFieldOfVision: function onExitFieldOfVisionFn() { video2.pause(); } });
E
Eva
said
almost 7 years ago
Hello Luca,
Based on the code you provided you are defining two markers and for each marker you have a video as an augmented object. If you wish to have only one marker with two videos then you can achieve that as well. You just need to define a marker and the two videos in this marker. You can also refer to the documentation here to see how you can achieve something like that.
A
Amministrazione
said
almost 7 years ago
I have two marker and two videos, one for marker.
For the marker1 i want to display video1, for the marker2 -> video2.
Is it not possible?
E
Eva
said
almost 7 years ago
Hi,
Yes you can have multiple targets and for each target define the augmented object that you wish. You can also refer to the documentation regarding Multiple Targets here.
A
Amministrazione
said
almost 7 years ago
Perfect...and my code is totally inspired to the guide about Multiple Targets
But it doesnt works
E
Eva
said
almost 7 years ago
In that case can you please send over your complete AR experience (.html, .css, .js files, assets, target images) so that we can test internally?
A
Amministrazione
said
almost 7 years ago
I found the problem, the code works, i put messages in the log and i can see them. I tryied different devices and in some of then i'm able to see videos.
In others i've this in log
06-14 17:45:22.361 2971-2971/com.gcode.museopime E/MediaPlayer: Should have subtitle controller already set 06-14 17:45:22.381 2971-2971/com.gcode.museopime E/MediaPlayer: Should have subtitle controller already set 06-14 17:45:22.421 2971-3627/com.gcode.museopime W/MediaPlayer: info/warning (3, 0) 06-14 17:45:22.931 2971-3649/com.gcode.museopime W/IMediaDeathNotifier: media server died 06-14 17:45:22.931 2971-3649/com.gcode.museopime E/MediaPlayer: error (100, 0) 06-14 17:45:22.931 2971-3649/com.gcode.museopime E/MediaPlayer: error (100, 0) 06-14 17:45:22.941 2971-2987/com.gcode.museopime W/CameraBase: Camera service died! 06-14 17:45:22.941 2971-3309/com.gcode.museopime W/AudioSystem: AudioFlinger server died! 06-14 17:45:22.941 2971-3619/com.gcode.museopime W/AudioSystem: AudioPolicyService server died! 06-14 17:45:22.941 2971-2971/com.gcode.museopime E/MediaPlayer: Error (100,0) 06-14 17:45:22.941 2971-3627/com.gcode.museopime W/CameraBase: mediaserver's remote binder Camera object died 06-14 17:45:22.941 2971-2971/com.gcode.museopime E/l: Error while loading the video. (Media player died ) 06-14 17:45:22.951 2971-2971/com.gcode.museopime E/MediaPlayer: Error (100,0) 06-14 17:45:22.951 2971-2971/com.gcode.museopime E/l: Error while loading the video. (Media player died ) 06-14 17:45:22.951 2971-2971/com.gcode.museopime E/Camera: Error 100
the devices are all Android 5.0 or 5.0.2
how can i solve?
A
Andreas Schacherbauer
said
almost 7 years ago
Hi Luca, On which hardware do you experience the issue? How large (pixel dimensions) are the videos?
Amministrazione