Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question video playback problem when using two image targets

Discussion in 'AR' started by Gonzofossa, Aug 19, 2021.

  1. Gonzofossa

    Gonzofossa

    Joined:
    Jun 8, 2021
    Posts:
    3
    Hi!

    I made an AR app (for Android) in which I have two images and a two videos that are played when you point a phone at the images. Unity 2021.1.10, Vuforia Engine 9.8.11

    My problem is that the first image works well - the video plays. But when I point the phone at the second image, the audio plays, but the video gets stuck.

    Is it because I do not use the OnTrackingLost () and OnTrackingFound () function?

    When I specify for "on Target Found ()" - VideoPlayer.Play and for "on Target Lost ()" – VideoPlayer.Stop and uncheck “Play On Awake” plays only audio, and instead of video, a white square appears.

    I also googled that the script “DefaultTrackableEventHandler” needs to be edited. I'm a complete newbie to Unity, so I found the script on the internet (I will attach it). But when I replace it in the project I have an error CS0246: The type or namespace name 'ITrackableEventHandler' could not be found (are you missing a using directive or an assembly reference?)

    I feel the solution is very simple, but I don't know what to do.

    Thank you!
     

    Attached Files: