View Full Version : Could someone help with video code snippet?
Hi Everyone!
I hope someone can help me accomplish the following:
I have a new niece and would like to do a baby announcement that will do the following:
I have a short video (a .wmv or .avi) of the baby and a png of the opening frame of the video. I would like to show the .png when the app opens while the video loads - but not visible - in the background. I'm thinking I can use a timer so that after a short time the video replaces the .png so the video plays. When the video finishes the .png reappears - and the video is not visible. When the .png reappears there will be a play button so the recipient of the app can replay the video. I can't seem to figure out the code that I need to do this ....
I'll also have the baby's stats (weight, birthdate, time, etc.) on the screen - like a printed baby announcement.
Can someone help me with a code snippet or sample for the video and png part - I can do the rest of it ... but the code and timer to change from png to video and back to png has me confused :huh -
Thank you sooooo much for any guidance you can provide!
Sue
yosik
05-24-2005, 04:41 PM
Sue,
First of all, congratulations!
As to what you want. It is simple enough.
You have 3 objects: a video objects (video1) a play button (play_BT) and a png image.
Set the attributes of the video object and the button to invisible.
1. Put your video ontop (exactly!) of your png image.
2. under the onShow Tab of the page, add the following actions:
Video.Load("Video1", "AutoPlay\\Videos\\baby.avi", true);
Video,SetVisible ("video1",true(;
[This will load the video and start playing automatically after it is loaded]
3. Under the onFinish Tab of the video object, add the following actions:
Video.SetVisible("Video1", false);
Button.SetVisible("play_BT",true);
[this will make the video invisible, thus showing the png underneath and make the button visible]
4. Under the onClick Tab on the button, add the following actions:
Video.SetVisible("Video1", true);
Button.SetVisible("play_BT",false);
Video.Play("Video1");
Hope that helps.
Good luck
Yossi
Thanks, Yosik!
Thanks for the response .... I really appreciate it!!! I edited this message because I see how you solved the issue ....
Thanks again .... I think your solution will do what I need!
Sue
Sue,
First of all, congratulations!
As to what you want. It is simple enough.
You have 3 objects: a video objects (video1) a play button (play_BT) and a png image.
Set the attributes of the video object and the button to invisible.
1. Put your video ontop (exactly!) of your png image.
2. under the onShow Tab of the page, add the following actions:
Video.Load("Video1", "AutoPlay\\Videos\\baby.avi", true);
Video,SetVisible ("video1",true(;
[This will load the video and start playing automatically after it is loaded]
3. Under the onFinish Tab of the video object, add the following actions:
Video.SetVisible("Video1", false);
Button.SetVisible("play_BT",true);
[this will make the video invisible, thus showing the png underneath and make the button visible]
4. Under the onClick Tab on the button, add the following actions:
Video.SetVisible("Video1", true);
Button.SetVisible("play_BT",false);
Video.Play("Video1");
Hope that helps.
Good luck
Yossi
Corey
05-24-2005, 06:40 PM
Huzzah for Yossi! :yes :)
Maybe I take the lazy way, but if you do this.
Video.Play("Video1")
Video.Pause("Video1")
The video object will show the first frame of the video, and then there is no need to hide/show an image of the first frame.
yosik
05-25-2005, 10:35 AM
True, Worm. Although there might be a flash.
But what about the function that would freeze to first frame at the end of the movie and the button that would play it again?
Yossi
The hide/show method is definitely the better/cleaner solution. I was more showing how lazy I am than anything :)
:p
I'm all for lazy solutions!!!
..... but one of the most important parts of this need is not showing the initial black screen ....
Thanks for all the input!
Sue
The hide/show method is definitely the better/cleaner solution. I was more showing how lazy I am than anything :)
yosik
05-25-2005, 02:05 PM
Worm,
YOU lazy!!???
Yeah, right...Just after Einstein and Newton.
Yossi
TJ_Tigger
05-25-2005, 02:25 PM
Worm,
YOU lazy!!???
Yeah, right...Just after Einstein and Newton.
Yossi
Hee hee :yes :lol
Corey
05-25-2005, 03:10 PM
Worm,
YOU lazy!!???
Yeah, right...Just after Einstein and Newton.
Yossi
Hee. :yes :)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.