Search code examples
androidaugmented-reality

Auto video play in Augmented Reality in Android


I want to play video automatically when device detects a marker. How can I achieve this functionality? I'm using Vuforia SDK and VideoPlayBack tutorial.


Solution

  • In VideoPlayBack sample : If you would like the video to start playing as soon as it starts tracking and pause as soon as tracking is lost you can do that by commenting the for-loop in VideoPlaybackRenderer.java in method onDrawFrame and instead checking whether the isTracking() value has changed since the last frame. . Notice that you need to be careful not to trigger automatic playback for fullscreen since that will be inconvenient for your users.