ia_video plays linear media files (.flv and .swf) under XML control in FPP. Its main use is for playing transition movies between pans. Contributed by FPP forum user Rick Workman. Version 1.0, free.
This plugin has three assignable attributes (see your FPP documentation for more info on "Assignments and motion tweens"). The below:
[name]=[value],[time],[type] [onDone],[onInterrupt]
Becomes something like:
onClick="external.ia_video.url=Movies/Pan1ToPan2.flv,1000,fade,loadPan2,loadPan2"
url="path/to/media/file"
Causes media file to be loaded and playing commenced.
*
visible="0" or visible="1"
If 0, causes movie to be stopped and removed from display.
if 1, causes movie to be redisplayed and started.
*
interactive="0" or interactive="1"
If 0, mouse clicks and keyboard have no effect on movie.
if 1, mouse click or spacebar cause pause/resume, double click stops movie.
Currently, the only tween supported is "fade" with a positive time value. Any fades will use current pano qualityMotion setting; restored to qualityStatic when fade is completed
On completion, onDone is executed; on interruption (see mouse behaviour below), onInterrupt is executed.
Other notes:
1. Any fades will use current pano qualityMotion setting; restored to qualityStatic when fade is completed.
2. Fades are done at 12 fps. (This may eventually get parameterized.)
3. The default value of interactive is 1; i.e., the user can pause or terminate the video.
4. This plugin is loaded like any other; i.e., via a layer parameter assignment. Make sure its layer number is high enough to make it visible when playing.
Two mouse interactions are implemented:
Mouse click cause the movie to pause if playing, and resume if paused.
Mouse double click interrupts the movie (and executes interruptFunctionName).
*
Example of usage in a panorama xml file for Pan 1 to play a transition movie :
Pan1 xml:
<panorama>
<parameters>
layer_10 = plugins/ia_video.swf
</parameters>
<hotspots>
<global>
<box id="goToPan2" url="images/BlueWireFrame.png" align="B"
pan="180" tilt="1" orientation="sphere" rotationX="0" rotationY="0"
onClick="external.ia_video.url=Movies/Pan1ToPan2.flv,1000,fade,loadPan2,loadPan2"
loadPan2="loadPano(xml_file=Pans/Pan2.xml,0,none)"
/>
</global>
</hotspots>
</panorama>
Pan2 xml:
<panorama>
<parameters>
layer_10 = plugins/ia_video.swf
</parameters>
<hotspots>
<global
onTransitionEnd="external.ia_video.visible=0,1000,fade"
>
</global>
</hotspots>
</panorama>
So this example has a single hotspot "goToPan2". When clicked, a transition movie ("Pan1ToPan2.flv" in the "Movies" folder) is played with an initial fade in of 1 second.
When the movie has finished (or is interrupted), "loadPan2" is executed which loads the destination pan ("Pan2.xml" in folder "Pans"). Note that at this point the end (or interrupted point) of the movie is still visible.
When the new pan is loaded, FPP executes the global onTransitionEnd, which then fades the movie away (again 1 sec.) revealing the newly loaded pan.
Please leave comments or questions below!
DOWNLOAD (includes ia_ambientmix Ambient sound mixer/player Plugin)
Rick: So the transition
Rick:
So the transition movie plays, and then the next panorama is loaded? Is it possible for the movie to play while the next panorama is loading, for a smoother transition between (ie, less wait)?
If not, then maybe using this in conjunction with Zephyr's Cache plugin would be interesting...
Yes, this can be done
Yes, this can be done (loading pan in parallel with playing transition movie), but the scripting gets tricky. Rather than serializing two asynchronous activities, they're executing in parallel. And I see no obvious way of sycnhcronizing the completion, i.e., how do you know when both activities have ended, if that matters. So whether this is effective may depend on timing issues.
Other issues:
1. If you fade the movie in in concert with loading, you may see the new pan momentarily before the movie becomes completely opaque. This can probably be solved by introducing a timer after starting the movie to delay initiating the load.
2. You have to be careful where completion functions are placed. The original pan's hotspots typically are unloaded, so they shouldn't go there. Only other place is in the globals, so you just have to make sure they aren't overwritten by the new pan.
Bottom line is I've tried this and it seems to work, but it's a bit tricky to script properly. (Typical of asynchronous programming.)
That's not to say that Zephyr's Cache plugin wouldn't also be useful in this context; it probably would ensure that the new pan is ready before the transition ends or is stopped. And it may circumvent the tricky nature of the problem since you could revert back to doing things in sequence.
Rick
February 22, 2008: Updated
February 22, 2008: Updated to v1.0a (expanded documentation)
Rick, This looks quite
Rick,
This looks quite useful. Are there any examples of its use floating around?
As for the parallel loading issue I may have a solution: Pass the URL(s) for the new pano to iaVideo. Once the video starts playing make a URLRequest for the new pano so it loads into cache. Don't execute the done function until both the transition and URL loading complete. When loadPano executes it will find the new pano already in cache.
Does that make sense?
Scott
Scott, Well obviously I've
Scott,
Well obviously I've started to use it some, but since I'm primarily focused on offline usage, I don't have a Web example to point you at. To tell you the truth, one of the reasons I posted it was to get some reaction from Web oriented designers.
The main context for this kind of plugin is where you want something more than a simple cross fade between pans, i.e., there's a travel element as you move from place (pan) to place (another pan), that can be captured in linear media (video footage, slideshow, ..). To tell you the truth, I haven't seen very many examples of such interactive movies (pans and complex transitions) on or off the Web.
I think I understand your suggestion (correct me if I'm wrong) and it certainly could be done. By cache, I assume you mean the browser's cache, so it only applies to online applications. In essence, it's a combination of the current plugin and a subset of Zephyr's cache plugin. And the reason for the combination is solely to support calling the doneFunction when both functions (playing video and loading URL) are complete.
I'll think about this some more; it would be nice to have a cache mechanism that also works in the offline case, which, I think, means it really needs to be supported at the FPP level (or below). On the other hand, it may not be much of an advantage for the offline case, so just making it optional is good enough.
Rick
For interested folks, here
For interested folks, here are a couple places using neat transitions -- one is QuickTime based and the other is a homegrown Flash player. Not sure if the QT one will even work anymore.
http://travel.supertour.com/miamibeach.aspx
http://www.virtualwhistler.com/
Rick, Sorry for the tardy
Rick,
Sorry for the tardy reply. I thought I would get automatic notification when someone a replied to me.
For offline use there would probably be little advantage to browser caching. One exception would be to avoid any delay in reading from the CD (assuming that is how this is being distributed) vs the HD such as browser cache. In any case it is nothing like the advantage online viewers might see.
Can't say if my suggestion uses Zephyr's pre-caching technique since I don't think his code is revealed anywhere.
The benefit, for online viewers at least, isn't just coordination of the done function. Rather it gives loading the next pano a head start so there is less or no waiting between the end of the transition and loading the next pano.
Since this may be of little benefit to you, if you wanted to share your code others could possibly extend it with a pre-caching algorithm and share that here.
I plan to shoot something that could be used to test this kind of transition in the next week so who knows. Maybe I will be able to get an online example up in a few weeks.
Scott
Hi Scott, Well I think
Hi Scott,
Well I think anybody can write a plugin, independent of this video plugin, which loads a url. Then the browser will find it in its cache when the loadpano function is called. It can even provide notification via a doneFunction call when the url has loaded. Am I missing something?
And, as far as I can tell, you can do this using Zephyr's plugin as is. The only drawback is that pre-loading can only be done when the pan containing the parameters is initially loaded, i.e., you can't decide later on the basis of some user action, to preload, e.g., the next set of pan images. (This might be a useful addition to the cache plugin.)
Now, if playing the movie and url loading are proceeding in parallel, i.e., head start, the trick is to know when both operations are complete, which is why a "combo" plugin is needed, unless someone can think of a clever way to write XML to achieve this. (Maybe by assignment to global functions which get modified by doneFunctions?)
So this is why I think the only benefit to adding it to this plugin is doneFunction synchronization, and this could certainly be done. But it seems like poor design; why should a video player have anything to do with browser caching? A better, and more general, solution, in my view, is dynamic caching (i.e., not just at pano load time) plus a synchronization mechanism (a separate plugin) for asynchronous activites (any tween assignment with a time value).
Comments?
Rick
The transition stucks at the
The transition stucks at the last frame of the video .
I think
onTransitionEnd="external.ia_video.visible=0,1000,fade"
did not work well to close the video .
I tried to re-write code to only one XML file :
Quang's question has a
Quang's question has a fairly lengthy thread in the FPP forums:
http://flashpanoramas.com/forum/showthread.php?t=1361