Step by Step to add video in the Skin of an HTML5 project

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
User avatar
Hopki
Gnome
Posts: 13026
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
Been asked how to have a popup video in HTML5 until we have a better way of doing it in the skin.

1) You need to get hold of some video converters, please see the start of this post: http://gardengnomesoftware.com/forum/vi ... =HandBrake
You need to output .mp4 and .webm video formats to play in the different web browsers.

+++Edit+++ Version 4.5 has now a built in video converter so you only need one format then process within Pano2VR for the other format.

2) Prepare an html page to embed the videos. The code for the page is:

Code: Select all

<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>HTML5 Video</title>
</head>

<body>

<div style="display:block; float:left; margin: 0px 0px 0px 0px; position: absolute; left: 0px; top: 0px;">

    <video width="464" height="352" controls="controls" autoplay="autoplay">
        <source src="short_tb.mp4" type="video/mp4" />
        <source src="short_tb.webm" type="video/webm" />
        
        Your browser does not support the video tag.
    </video>

</div>


</body>
</html>
You can just copy and paste this in a txt document and save as HTML. Change the file size and names to match your videos, in this example it is using short_tb.mp4 and short_tb.webm. 464 x 352. Now put the videos and the video.html page in a folder.

3) Open Pano2VR build and output your HTML5 project. Once created move the folder containing the videos and html page in the output folder if you have one. If not just make sure the file path to the video folder is correct in the hotspot editor.

4) Open the Hotspot Editor and place a hotspot where you want the video. In the Title add the name of the video, not file name. Then in the Target text box add the iframe code that will open the video html page. Example:

Code: Select all

<iframe width="800" height="600" src="videos/tb.html" frameborder="0"></iframe>
Replacing videos/tb.html with the name of your folder and video html page.

5) Now open the attached project and copy the skins elements that makes up the popup video window and paste them in your own project.
Tweaking the skin: The video_player text box is what displays the video. It is important that it is the correct size of the video. In the case of the attached example the video is 464 x 352 so this text box needs to be the same size. Note that the iFrame code describes a larger window size, this is to stop scroll bars appearing in the video_player text box once published. The video_player text box has no text as it gets it from the Hotspot Editors Target text field and is dynamically written in using a place holder in the hotspot template with the ID hotspot.

This also writes the title of the video when the popup is opened. The Close button removes the text so unloading the video ready for the next.
Enjoy
Hopki
Attachments
video.zip
(4.49 MiB) Downloaded 522 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
User avatar
360Texas
Moderator
Posts: 3684
Joined: Sat Sep 09, 2006 6:06 pm
Location: Fort Worth, Texas USA
Contact:

Alot of views but no replys.

Looks like an interim process.. now to go try it out.

Yes, I did use my cell phone to video record some scenes while in Mexico last September.

Maybe someone can complete this task before me (not HopKi(ins)).

Good or bad results.. will report back here in the forum
Dave
Pano2VR Forum Global Moderator
Image
Visit 360texas.com
OKirstein
Posts: 10
Joined: Tue May 08, 2012 6:22 pm

Hello Hopki,

is this example available for Object2VR? I tried to adapt this to Object2VR but it will not work :(

I would be happy if there would be an example file for Object2VR.

Best regards
Ollie
User avatar
Hopki
Gnome
Posts: 13026
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Ollie,
Please find Object2VR project attached.
Hotspot is his nose :)
Regards,
Hopki
Attachments
Reindeer JPG.zip
(5.35 MiB) Downloaded 314 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
OKirstein
Posts: 10
Joined: Tue May 08, 2012 6:22 pm

Hi Hopki,
thank you very much! It works now perfect on iPad.
Best regards
Ollie
Post Reply