Search Unity

Vuforia videoplayback for unity 2017.2

Discussion in 'Vuforia' started by unity_2TuCVSB-nuQz1g, Oct 12, 2017.

  1. unity_2TuCVSB-nuQz1g

    unity_2TuCVSB-nuQz1g

    Joined:
    Oct 12, 2017
    Posts:
    1
    Hi

    Where can i find the vuforia videoplayback sample for unity 2017.2.
    I am not able to find it in asset store. I need to create a simple videoplayback app with unity.

    Kindly please help

    Thanks
    Ansuman Suryaprakash
     
  2. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Hello Ansuman Suryaprakash,
    The videoplayback sample is now part of the Core Samples. The Image Target scene in the sample uses a Unity component to render a video over the Fissure target. Please download that sample and check it out!
    Thanks!
     
  3. RajuPedda

    RajuPedda

    Joined:
    Oct 11, 2017
    Posts:
    3
    Hi
    I have downloaded the core samples and it (including video) working fine when I run the application on unity play mode, but it's failed (not able to see the video, it just flickers with different colors in rectangle shape) on release build (final apk).
    Can somebody help me on this, please?
     
    Last edited: Oct 16, 2017
  4. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Which device are you seeing this on?
     
  5. RajuPedda

    RajuPedda

    Joined:
    Oct 11, 2017
    Posts:
    3
    Thanks for the reply.
    It's working fine now, after selecting the Transcode option with codec -VP8.

    Can you help me with these below options?
    1. Speech recognition
    2. Text recognition samples
    I haven't found these options in core samples.
    Thanks in advance.
     
  6. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Speech recognition isn't a feature provided by Vuforia and Text recognition is deprecated in Vuforia 6.5.
    Sorry for the inconvenience.
     
  7. RajuPedda

    RajuPedda

    Joined:
    Oct 11, 2017
    Posts:
    3
    Thanks you so much for your quick reply.
     
  8. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    To follow up with this, TextRecognition scripts and APIs are still available in 6.5, but they will be removed in a future build.
     
  9. maryam016

    maryam016

    Joined:
    Dec 14, 2017
    Posts:
    1
    Hi i have downloaded in vuforia samples part topic adance and i have in asset store. but i dont know how add video in unity and use this package. please help me.:oops::)

    Thanks
     
  10. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    The Image Target scene in the Core Samples has an example of using video player in Unity.
     
  11. ckombo

    ckombo

    Joined:
    Dec 27, 2014
    Posts:
    4
    Where do I find the core samples on mac osx?
     
  12. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
  13. ckombo

    ckombo

    Joined:
    Dec 27, 2014
    Posts:
    4
    Thank you.
     
    Vuforia-Strasza likes this.
  14. Shengen

    Shengen

    Joined:
    Nov 30, 2016
    Posts:
    1
    @Vuforia-Strasza Hello!

    I've got a question to ask, how do I make the video autoplay when the image target is found and pause when lost?

    the play on awake works, but however the video starts playing the moment the app starts. I don't want any buttons, just once found, play video, if lost, pause video.
     
  15. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    If your video object is enabled by default (even if Vuforia is automatically disabling it) this might be playing the video. If not, you can always pause the video immediately in code.

    The current sample will pause the video when tracking is lost so I recommend reviewing that.
     
  16. unity_fKqTZgMnJAOq8g

    unity_fKqTZgMnJAOq8g

    Joined:
    Mar 7, 2018
    Posts:
    1
    @Vuforia-Strasza Hello!
    I have some question about how to make VDO Playback with Vuforia7 and unity 2017 I need my VDO can play and pause by click can you help me for this

    Thanks in Advance
     
  17. creatingvfx

    creatingvfx

    Joined:
    Mar 2, 2018
    Posts:
    2
    checked out vuforia core sample image target . I tried to understand but its not working properly with that previous script we can directly make an app for videoplayback but i cant understand this way, kindly tell me the process for making videoplayback as on vuforia website is showing the old way OR provide that link again
    thanks vuforia
     
  18. Hyperlink_Unity3D

    Hyperlink_Unity3D

    Joined:
    Dec 10, 2016
    Posts:
    1
    Hello Vuforia team,

    I have downloaded Core sample from unity asset store to integrate video playback feature. When I run and click on play button video does not start immediately but takes 2-3 seconds to start, also, when video finished and i click play button it does not start again, I have to restart app in order to play video again

    I am checking "3-ImageTargets" scene of core sample
     
  19. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    The core samples have an example of using Unity's Video Player component to augment a video over a target. Look at the Fissure target in the Image Target scene.
     
  20. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Is the older way you are referring to the previous 6.2 sample?
     
  21. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Which version of Unity are you using? Is this in Playmode or on device?
     
  22. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    207
    Hello,

    How to use VideoPlayerHelper with UnityEngine.Video.VideoPlayer? I need to check the state of player and other things.
    Thanks
     
  23. juniortoretto23

    juniortoretto23

    Joined:
    May 17, 2018
    Posts:
    2
    Hi,

    Where do I download video playback to / Unity 2018.1.0f2?

    thank you
     
  24. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    The core samples have an example of video playback in the image target scene.
     
  25. ZunigaTinTIn

    ZunigaTinTIn

    Joined:
    Jun 8, 2017
    Posts:
    1
    Why using videplayback instead of videoplayer over a quad as vuforia sample? with videoplayback you need to have your videos inside StreamingAssets/ folder, so .obb script will not stream this media dynamically. With Video Player prefab you'll need to put your video files inside Resources and this makes load your videos over your target in the same way of any other 2D or 3D object.
    Remember that for iOS your videos resolution has to be up to 640x360 and not less (if not you will hear just the audio clip and no video at all).
     
    Last edited: Jun 28, 2018
    Hank_Bot likes this.
  26. Mohan225

    Mohan225

    Joined:
    Aug 16, 2018
    Posts:
    1
    Hello,
    I want to play different videos on different imagetargets and they should be played and paused based on
    ontrack-play ,onlost-pause
    can you help me with that .please
     
  27. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    The core samples demonstrate how to do this with one video + Image Target. Following this example, you can create multiple Image Targets with their own videos on them. I'd recommend downloading the core samples and using that as a reference to start building this out.
     
  28. abhineshp64

    abhineshp64

    Joined:
    Jan 1, 2019
    Posts:
    1
    Just add the one in bold to your image target handler script !!
    Code (CSharp):
    1.  
    2. public class DefaultTrackableEventHandler : MonoBehaviour, ITrackableEventHandler
    3. {
    4.    [B] public UnityEngine.Video.VideoPlayer VideoPlayer;[/B]
    5.    
    6.     #region PROTECTED_MEMBER_VARIABLES
    7.  
    8.     protected TrackableBehaviour mTrackableBehaviour;
    9.     protected TrackableBehaviour.Status m_PreviousStatus;
    10.     protected TrackableBehaviour.Status m_NewStatus;
    11.  
    12.     #endregion // PROTECTED_MEMBER_VARIABLES
    13.  
    14.     #region UNITY_MONOBEHAVIOUR_METHODS
    15.  
    16.     protected virtual void Start()
    17.     {
    18.         mTrackableBehaviour = GetComponent<TrackableBehaviour>();
    19.         if (mTrackableBehaviour)
    20.             mTrackableBehaviour.RegisterTrackableEventHandler(this);
    21.     }
    22.  
    23.     protected virtual void OnDestroy()
    24.     {
    25.         if (mTrackableBehaviour)
    26.             mTrackableBehaviour.UnregisterTrackableEventHandler(this);
    27.     }
    28.  
    29.     #endregion // UNITY_MONOBEHAVIOUR_METHODS
    30.  
    31.     #region PUBLIC_METHODS
    32.  
    33.     /// <summary>
    34.     ///     Implementation of the ITrackableEventHandler function called when the
    35.     ///     tracking state changes.
    36.     /// </summary>
    37.     public void OnTrackableStateChanged(
    38.         TrackableBehaviour.Status previousStatus,
    39.         TrackableBehaviour.Status newStatus)
    40.     {
    41.         m_PreviousStatus = previousStatus;
    42.         m_NewStatus = newStatus;
    43.  
    44.         if (newStatus == TrackableBehaviour.Status.DETECTED ||
    45.             newStatus == TrackableBehaviour.Status.TRACKED ||
    46.             newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
    47.         {
    48.             Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found");
    49.             OnTrackingFound();
    50.         }
    51.         else if (previousStatus == TrackableBehaviour.Status.TRACKED &&
    52.                  newStatus == TrackableBehaviour.Status.NO_POSE)
    53.         {
    54.             Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " lost");
    55.             OnTrackingLost();
    56.         }
    57.         else
    58.         {
    59.             // For combo of previousStatus=UNKNOWN + newStatus=UNKNOWN|NOT_FOUND
    60.             // Vuforia is starting, but tracking has not been lost or found yet
    61.             // Call OnTrackingLost() to hide the augmentations
    62.             OnTrackingLost();
    63.         }
    64.     }
    65.  
    66.     #endregion // PUBLIC_METHODS
    67.  
    68.     #region PROTECTED_METHODS
    69.  
    70.     protected virtual void OnTrackingFound()
    71.     {
    72.         [B]VideoPlayer.Play();[/B]
    73.         var rendererComponents = GetComponentsInChildren<Renderer>(true);
    74.         var colliderComponents = GetComponentsInChildren<Collider>(true);
    75.         var canvasComponents = GetComponentsInChildren<Canvas>(true);
    76.  
    77.         // Enable rendering:
    78.         foreach (var component in rendererComponents)
    79.             component.enabled = true;
    80.  
    81.         // Enable colliders:
    82.         foreach (var component in colliderComponents)
    83.             component.enabled = true;
    84.  
    85.         // Enable canvas':
    86.         foreach (var component in canvasComponents)
    87.             component.enabled = true;
    88.     }
    89.  
    90.  
    91.     protected virtual void OnTrackingLost()
    92.     {
    93.         [B]VideoPlayer.Pause();[/B]
    94.         var rendererComponents = GetComponentsInChildren<Renderer>(true);
    95.         var colliderComponents = GetComponentsInChildren<Collider>(true);
    96.         var canvasComponents = GetComponentsInChildren<Canvas>(true);
    97.  
    98.         // Disable rendering:
    99.         foreach (var component in rendererComponents)
    100.             component.enabled = false;
    101.  
    102.         // Disable colliders:
    103.         foreach (var component in colliderComponents)
    104.             component.enabled = false;
    105.  
    106.         // Disable canvas':
    107.         foreach (var component in canvasComponents)
    108.             component.enabled = false;
    109.     }
    110.  
    111.     #endregion // PROTECTED_METHODS
    112. }
    113.  
     
  29. cretinous

    cretinous

    Joined:
    Feb 24, 2019
    Posts:
    4
    sorry but this doesn't work either. any update?
    Quad videos play automatically when i run the application. When i disable "play on awake" they don't autorun, but all i can render is a blank square.
    Adding your "bold" script does change the behavior a bit but it doesn't fix the issue. Now when "play on awake" is disabled, the blank squares simply get stuck on the screen when you take away the target.
    I'm closer than i was before but still no luck. LOL Please help
     
  30. G51R

    G51R

    Joined:
    Apr 3, 2018
    Posts:
    1
    I have a similar issue, when I try the PlayerMode inside Unity using my webcam on the laptop everything is working fine and video is playing!
    But when I export it on to my device, Android tablet (also tried on different Android phones) the videoplayback doesnt work anymore and i get only the blank square, like mentioned above, over the target! What I am doing wrong?
     
  31. wwansitiaishah9612_unity

    wwansitiaishah9612_unity

    Joined:
    Mar 20, 2019
    Posts:
    1
    I already build my AR app successfully with video as quad 3d object. but while using smartphone, the video didn't play, it shown as a plain picture without motion. How to fix this? help me