Log in or register to post comments

FrameMarkers change overlay contents dynamically

July 6, 2013 - 9:32am #1

Hi,

I am using Unity3d 3.5.5 and QCAR version 2.5.8.

I want to add framemarkers in a loop whereas marker ids are downloaded via WWW class.

 

1) Can I have sample code with adding video over particular framemarker and audio over another framemarker after adding them dynamically.

2) How to change content on button click once framemarkers are added with video/audio contents. I might want to remove video over particualr marker and add Text instead.

3) Please also tell me the files names as well where code will be modified since this is my first implementation of framemarkers via QCAR.

 

Cheers

Ayaz Alavi

FrameMarkers change overlay contents dynamically

July 8, 2013 - 8:41am #12

Yes, downloading the video to the device storage and then playing it is a viable option;

I recall other developers in this Forum have reported to have successfully implemented this technique;

if you search the Forum, you should be able to find a few instances on this subject (perhaps with some code snippets too...)

 

FrameMarkers change overlay contents dynamically

July 8, 2013 - 8:00am #11

should I download the video and then play it? Can I have sample code if it is possible.

FrameMarkers change overlay contents dynamically

July 8, 2013 - 7:57am #10

Ok, on iOS you cannot play video on texture when it is streamed from a URL.

Maybe also worth checking this page:

https://developer.vuforia.com/forum/faq/videoplayback-what-videos-can-i-play-what-platform

 

FrameMarkers change overlay contents dynamically

July 8, 2013 - 7:55am #9

I am using iOS as target. Video is not playing at all. Didi I miss something while adding video prefab?

FrameMarkers change overlay contents dynamically

July 8, 2013 - 7:53am #8

What is the Android version of your target device ?

You need Android 4.0 or higher to support "playable on texture" feature.

FrameMarkers change overlay contents dynamically

July 8, 2013 - 7:13am #7

I have added video prefab as Frame Marker child via

GameObject video_ = (GameObject) Instantiate(video);
                video_.transform.parent = markerBehaviour.transform;
                video_.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
                video_.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);    
                VideoPlaybackBehaviour videoBehavior = video_.GetComponent<VideoPlaybackBehaviour>();
                string videopath = language_.exhibitionsData[i]["video"].ToString().Trim(trimChars);
                videoBehavior.m_path = "http://gtmuseum.ayazala.com/uploads/"+videopath;
                videoBehavior.m_autoPlay = true;

 

Video file is at http://gtmuseum.ayazala.com/uploads/fb975b2b2f94745fb16669cd91e1c251.mp4 but mVideoPlayer.IsPlayableOnTexture(); returns false.

 

Can i know what is wrong with the video?

 

Thanks

FrameMarkers change overlay contents dynamically

July 7, 2013 - 10:30pm #6

You need to use C# , QCAR classes are not available in Javascript.

 

FrameMarkers change overlay contents dynamically

July 7, 2013 - 3:27pm #5
Frame marker can be added via following code found at https://developer.vuforia.com/resources/dev-guide/trackable-details-unity
 
MarkerTracker markerTracker = (MarkerTracker)
        TrackerManager.Instance.GetTracker(Tracker.Type.MARKER_TRACKER);
 
int markerId = 0;  // between 0 and 511
string markerName = "marker" + markerId;  // unique name
int markerSize = 100;  // markers are always square
 
MarkerBehaviour markerBehaviour = markerTracker.CreateMarker
(markerId, markerName, markerSize);
 
if (markerBehaviour != null)
{
    // Add a trackable event handler
    markerBehaviour.gameObject.AddComponent<DefaultTrackableEventHandler>();
    
    // Add an object as a child
    GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
    cube.transform.parent = markerBehaviour.transform;
    cube.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
    cube.transform.localPosition = new Vector3(0.0f, 0.25f, 0.0f);
}

Is below line valid for fetching frame marker in javascript. It is giving me error. Anyone knows why?

var markerTracker : MarkerTracker = (MarkerTracker) TrackerManager.Instance.GetTracker(Tracker.Type.MARKER_TRACKER);

Also QCAR classes are not coming in intellisense in my custom js file. Any idea how to make them available?

FrameMarkers change overlay contents dynamically

July 7, 2013 - 2:06pm #4

To be precise, Frame Markers cannot be "loaded", but rather they can be "created" using the CreateMarker() method of the MarkerTracker class, using the FrameMarker ID, which is a number in the range [0 - 511]

I recommend to read the API reference:

https://developer.vuforia.com/resources/api/unity/class_marker_tracker

and this section of the Developer Guide which explains FrameMarkers in great detail:

https://developer.vuforia.com/resources/dev-guide/frame-markers

also, the best is to look at the Frame Marker sample code, which is quite self-explanatory.

 

 

 

FrameMarkers change overlay contents dynamically

July 6, 2013 - 5:10pm #3

Can you be more specific about loading frame marker dynamically and put video over it. Sample code for frame markers contains hardcoded frame markers and not the one generated dynamically and with video over them.

Plz Help

FrameMarkers change overlay contents dynamically

July 6, 2013 - 12:18pm #2

Hi, my suggestion would be to have a look at the VideoPlayback sample (for Unity), as it contains many of the features that you mention in your questions;

and of couse, our FrameMarkers example is also a precious resource in your case. 

 

Log in or register to post comments