hi Guys i m using Video Playback Sample and i want to play Randomized videos.
how can i achieve this functioinality .
any help /suggestion/ comment will be most welocmmed
Hi, do you stop and release the media player of the old video before laoding a new one ?
(see the VideoPlayback sample code mMediaPlayer.stop() and mMediaPlayer.release());
also, you could check in the onError() method (since your class also implements onErrorListener interface) to see if you get any error when you load the second video...
also i want to load multiple videos from sdcard rather then assests folder i tried this thing and it worked for 1 single file loading from sdcard successfully but not the multiple files are loading from sdcard
i`ve use the following chunck of code to load from Sdcard in Videoplayback Sample
canBeOnTexture = true;
mShouldPlayImmediately = playOnTextureImmediately;
I would say check where the mVideoPlayerHelper[i].play() is called in the VideoPlayback sample (see VideoPlayback.java), so that you can use that function (note: you will need to call that Java function from native code, probably from the _renderFrame function, based on trackable detection...)
About how to choose the video randomly, you could just use a random generation function such as rand() in C++ and pick one video out of your array each time, e.g. suppose you have N videos in total, and you have an array of N videos defined in C++ (e.g. you could keep an array of filenames, one for each video):
int random_index = rand() % N;
const char *randomVideo = videos[ random_index ];
That's just an example, of course you can do this in a thousands different ways.
Are you sure you want to delete this message?
Are you sure you want to delete this conversation?