Log in or register to post comments

Multiple videos on same marker

October 24, 2012 - 12:58am #1

Hi,

I have a question that how can I have multiple videos on same marker for e.g. I see in videoplayback sample we have 1 video for Stone and 1 video for Chips. Can you please tell me where do I need to change in code to make play 3 different videos for Stone in any order. I see in code that there are loops like following code where we load video ith video corresponding to each target so there is one to one relationship. Can anybody tell where I need to make changes to make it work for multiple videos for single marker.

for (int i = 0; i < NUM_TARGETS; i++)

                {

                   // load or requestload to videoplaybackrenderer

                        if (!mReturningFromFullScreen)

                            mRenderer.requestLoad(i, mMovieName[i], mSeekPosition[i], true);

                        else

                            mRenderer.requestLoad(i, mMovieName[i], mSeekPosition[i], mWasPlaying[i]);

                }

Multiple videos on same marker

May 14, 2016 - 6:46am #6

Moderators, 

Any update on this thread?

Multiple videos on same marker

October 2, 2013 - 4:49am #5

hi, thanks for ur effort.

will you plz explain the code u pasted below.

because simple copy pasting it is not working for me.what is the "Movies movie"? it is giving error.

Multiple videos on same marker

October 24, 2012 - 9:04am #4

Hi, sounds good. I would just suggest that you check the occurrences of mVideoPlayerHelper[i].load, mVideoPlayerHelper[i].play in the VideoPlayback sample to see if you need to adapt your code in more than one place;

the code is a bit spread across different classes/files, so check on VideoPlayback.java but also in VideoPlaybackRenderer.Java;

for the rest the overll logic is really application specific.

 

Multiple videos on same marker

October 24, 2012 - 8:01am #3

I am able to do that with following code but I dont know whether it is the correct approach. Just paste the code below renderFrame() call

 

for (int i = 0; i < VideoPlayback.NUM_TARGETS; i++)

        {

            // Ask whether the target is currently being tracked and if so react to it

            if (isTracking(i))

            {        

            //mLostTrackingSince[i] = -1;

            if (mVideoPlayerHelper[i] != null)                 

                { 

               MEDIA_STATE state = mVideoPlayerHelper[i].getStatus();

               if(state != MEDIA_STATE.PLAYING && state != MEDIA_STATE.LOADED) {

                Movies movie = mMovieName.valueAt(i);                

                if(movie.movies.size() > 0) {

                Random random = new Random();

                    String movieName = movie.movies.get(random.nextInt(movie.movies.size()));

                    if(Constants.getFileExtension(movieName).equals("m4v")) {

                    Log.v("MOVIE_NAME", movieName);

                    mVideoPlayerHelper[i].unload();

                        mVideoPlayerHelper[i].load(movieName, MEDIA_TYPE.ON_TEXTURE, true, 0);

                    }                    

                }

                 

               }            

            //mVideoPlayerHelper[i].play(false, -1);

                }

            }

            else

            {

                if (mVideoPlayerHelper[i] != null)

                {

                    mVideoPlayerHelper[i].pause(); 

                }

            }

        }

Multiple videos on same marker

October 24, 2012 - 1:21am #2

Also I am unable to track that when marker is detected in VideoPlayback.cpp renderframe which method is called in Java to play particular movie? Because I want to apply algo to the list of movies I have for that marker.

Log in or register to post comments