Movie player issue

m1's picture

Hi I'm new to QC so I probably am doing something wrong, but could use some advice. I'm building a video playback tool for a touchscreen interface.

I have 12 videos, represented by 12 thumbnail images floating around on screen. These will be triggered to play fullscreen when touched, but only one at a time. Once the movie is finished, the screen will go back to the floating thumbnails. Seems simple enough, but..

Problems:

1:

Whenever I start up the app, all of the movies play at once! Needless to say it is annoying and not very professional looking. Any ideas here? Attached is 1.png to show how I worked out the playback functionality. To be clear, sprite 23 is the movie file, sprite 7 is the thumbnail.

It appears that all of my sprites are 'enabled' on startup, even if they are set to 'off'. But maybe it's something else? I worked on this all day and can't figure it out.

1.5:

Once I play a movie, is it possible to lock out the controls so no other movie can be chosen?

2:

My thumbnails are all moving in 3d space, I'm using 3d transformation to rotate around them. It looks great. But when I play the movie in that same macro that the 3d transform is controlling, it also gets rotated. So frustrating. Is there some basic tool here that I missed that will let me send outputs outside of the macro?

3:

Since all of the movies will play in the same space, can I use one billboard or sprite, and send the output of the movie importer to it? That leads me to #4...

4:

After about 2 minutes if no one has touched the screen, I would like it to randomly choose a video to play, then wait another 2 minutes-to see if it grabs any one's attention. Is there some kind of massive toggle selector that I missed, or is that where I should use javascript for more control?

Thanks for any help you guys can offer. Much appreciated. I'm kind of stuck.

Thanks, Brian

PreviewAttachmentSize
1.png
1.png90.91 KB

gtoledo3's picture
Re: Movie player issue

1 - If a Sprite's "Enable" port is set to False, then all of your movies aren't playing. What you are conveying can't happen. Maybe you have something connected to the Enable ports that you think is delivering a False value, and simply isn't.

1.5 - Sample and Hold patches, or Multiplexers can be used to lock out, or divert an input after you've "done something". You will probably need to use that in combo with the Virtual Watcher, Signal, and/or Counter patch, depending on your vision.

2 - Not really. If you have consumers in a macro, you can't publish outputs.

Think of it like this though - the only thing that really has to be in a "consumer" environment (like a transform) are your renderer patches (like sprites). Directory Scanners, Movie Players, etc, can all be at the "top" root level, and your Sprites can simply have published inputs that go "up" through the 3D transform. So, with different organization, you can pretty much always do whatever you need to do. That organizational aspect of QC, and the concept that it's a good tendency for Provider/processor patches to be placed outside of Consumer environments as much as possible is something that eludes many.

2.25- There is a workaround patch called the "Spooky" available here, that "can" do this, but it can lead to leaks in many cases, so be careful.

2.5 -Remember that Billboards have no Z value. So, depending on what is going on with that 3D transform, you may be able to just use a Billboard instead of a Sprite, and have it not "move around".

3 - I don't understand this question. Do you mean, do you have to have a separate Billboard for each movie? If so, no. You can hook up your movie paths via a string multiplexer, and feed that to the input of the movie importer. Switch index value to change movie path.

A different route would be to use a bunch of separate movie importers with paths preloaded and multiplex those sources to one Billboard.

Another route would be to use a "Directory Scanner" to return a file list from a folder, get the file path, and by manipulating which index value of the structure you send, you can change file paths.

4 - Well, it sounds like what you can do is to hook up a signal patch(es) or virtual watcher(s) to trigger a Stopwatch everytime someone triggers the control(s). If multiple input parameters need to be watched, all of the watcher (or signal, or pulse...whatever is more appropriate options wise) outputs would lead to a math patch programmed with each value in plus mode, which would then hook to that Stopwatch. That way any input being messed with will start up the Stopwatch.

The output of that would go to a Conditional patch, value 1. Set the second value to the time amount you want to pass in seconds before it outputs a true value. Use that true value to trigger an event to choose a new index value from one of your multiplexers (or whatever route you took).

You would have a random patch set to max and min values that correspond to your possible index range of movie choices, leading to a sample and hold, which would then hook to the main index port on your movie path multiplexer. When that conditional gets triggered by the stop watch, it's going to pulse a true, which will make that sample and hold sample a random value for a moment. That will change the index value on the multiplexer that you've setup with your different movie paths or movie players (or index value from a directory scanner structure).

The sample and holds will have resets, as will the stop watch (or counter). Depending on what your conception of this is, you may need to do resets at some point. Remember that you can use smooths to make lags in reset time after a given event (this sometimes comes in very handy). You can also use the math expression "!x" to invert any boolean value. This sometimes comes in handy, because you can make a True event, have an "!x" coming off of that True event, which creates a False, but smooth that, so that, to cause Reset a given amount of time after your True event.

m1's picture
Re: Movie player issue

Thanks you so much your answers helped immensely!!

1- I think my issue with the movie playback on startup is one of my conditionals or something, still working on that.

2- Figured out number 2, just needed to use the macros properly. All good.

3- Per your suggestion, using a single sprite actually, outside of the 3D transform patch.

4- Totally confused.

m1's picture
Re: Movie player issue

I have a few thumbnails that are selectable via the mouse 'interaction'. When selected they are sent to this java script to play 1 of 3 movies.

function (__string movIndex) main (__boolean inputNumber[3]) { var result = new Object();

if(inputNumber[0] == true){ result.movIndex = "1.mov"; } else

if(inputNumber[1] == true){ result.movIndex = "2.mov"; } else

if(inputNumber[2] == true){ result.movIndex = "3.mov"; } else{ }

return result; }

I'm sending the path to the image importer. In the actual app I made, there are many movies, so I wanted to use 1 importer and 1 billboard to make things much simpler. I've already tried using multiple billboards and selecting between them, but the actual project is pretty complex, with fades and other triggers.

My problem is this: I can play movies just fine with this method, but only if the same movie isn't selected twice in a row. In that case, nothing happens as the same path is sent, while the movie importer just sits there doing nothing. Is there some kind of addition that I can add to make the movie importer reset and retrigger the movie to start again?

I've been pulling my hair out on this one. You can download a sample project folder here with movies to show what happens (or doesn't happen)

http://db.tt/Klp8iCL

Much Thanks, Brian

PreviewAttachmentSize
Screen shot 2010-11-01 at 8.04.57 PM.png
Screen shot 2010-11-01 at 8.04.57 PM.png169.07 KB

gtoledo3's picture
Re: Movie player issue

This should likely help.

I've annotated the changes, so that things should be self explanatory. It's somewhat straightforward, but not at the same time. I don't know if everyone would do it this way, but certain things that I'm doing reduce flakiness, and keep paths loading correctly. This approach lets you keep everything in asynch like you have it, so you can have sound, etc.

Let me know if you have any questions, concerns, etc.

I have to add though... it seems like the reset input parameter on the movie loader being set to true should trigger it to play again. It doesn't. I haven't given a lot of thought to that, but it seems slightly odd.

There is also a movie player plugin made by Vade.... google "v002 movie player". That may be worth investigating as well, depending on your needs, as it has a few additional features.

PreviewAttachmentSize
playertest.zip10.98 MB

m1's picture
Re: Movie player issue

Thanks George! That is so helpful. Totally makes sense and works great! I added it to my patch and everything is good. I did try to the reset trigger, but it made no difference to playability.

My only other issue with the player now, is that my thumbnails are actually floating around the screen in a circular fashion back and forth on the Y and Z space. It looks really cool, kind of like a barrel coming toward you, especially when the camera is moving as well. That actual issue is that the interactions overlap, when the movies overlap. The front most thumbnail selected is not always correct. QC will sometimes select one of the thumbnails in the background. Any thoughts on this issue? Seems like a QC bug. Maybe it's just me. I'll try to put something together to add to the forum.

Thanks again for the help.

Brian

cybero's picture
Re: Movie player issue

Just downloaded and tried out this movie player.

I really like the 'hidden' workarounds, such as the Billboard to ensure evaluation of the JS, forced reloading, the simple Mouse Down catch all & the brute Boolean on the Movie Sprite, :-).

[not forgetting the Stopwatch triggered by the Mouse Down switch].