View Full Version : Dynamic Frames

Irish Witch
09-17-2005, 04:44 AM
Probably a simple task but not as simple as I thought.

I have a page set up using two frames with the classic setup:

<frameset cols="229,*" >
<frame name="contents" target="main" src="filelist.html" scrolling="no" noresize>
<frame name="main" src="VideoPlayer.html">

<p>This page uses frames, but your browser doesn't support them.</p>


I want to create links in the Filelist.html that will open up video files to play in the second frame. This means the text in the second frame need to be updated dynamically to play a different file.

The video frame reads like this:
<TABLE cellSpacing=0 cellPadding=0 border=0 width="455">
<TD colSpan=3 width="473">
<p align="center"><IMG height=46 alt="" src="TV files/tv02.gif"
width=522 border=0></p>
<TD width="93"><IMG height=240 alt="" src="TV files/tv03.gif"
width=100 border=0></TD>
<TD align="center" width="320" padding="0" bgcolor="#000000">
<OBJECT ID="mediaPlayer" width="320" height="240"
STANDBY="Loading Microsoft Windows Media Player components..."
<param name="Filename" value="videos/playlist.m3u">
<TD width="69"><IMG height=240 alt="" src="TV files/tv05.gif"
width=102 border=0></TD></TR>
<TD colSpan=3 width="473">
<p align="center"><IMG height=46 alt="" src="TV files/tv06.gif" width=522 border=0></p>

the TV giff files create a frame that looks like a telivision nothing more.
What I need to update is the "Value" of the media player object and then refresh the page. The result will go on a disk of DIVX video files.

I would have asked if I could just tell the Media player object to cycle through the platlist file from the web page but something tells me that would be harder.

09-17-2005, 08:22 AM
There may be a way to do this with javascript, but then non javascript enabled browsers will have problems viewing the different videos. One of the main reasons for using frames in the first place is to be able to load in different pages to a given frame. I'd suggest making up separate pages for each video say:


etc. Then loading them in with links on the filelist.html. You could use javascript to prevent history stacking (which is the only user apparent effect you would achieve with your idea):

<a href="VideoPlayer1.html" target="main" onclick="parent.main.location.replace(this.href);return false;">Movie Title</a>Non javascript browsers will experience history stacking but, at least get to see the videos.

Irish Witch
09-28-2005, 03:31 PM
Thanks for the reply although the issue is not actually one of java vs non-java. The destination for the project is a data DVD containing a collection of about 20 to 40 divx files plus photos. Think wedding style setup only not. My intention was to have have the disk boot up into a webpage where you can both view the picture galleries or go to this section and simply show a filelist on one side and a movie player on the other. Oh, and I may want to re-use the system for other disks. The hint to illiminate it from the history stacking is cool and I'll keep that in mind (and might have to use that alternative) but it would be nice if I could script the process with javascript... Standard compatibility for IE NS or Firefox (the browsers I know it will be on).

I saw scripts in dynamic drive for generating popup pages on the fly, is there any way I could make a generated page like that apear in my second frame maybe??

Oh, sorry for so long between replies.
<-- is shift worker.


09-28-2005, 06:26 PM
I'm not aware of a script for that:

I saw scripts in dynamic drive for generating popup pages on the fly, is there any way I could make a generated page like that apear in my second frame maybe??on DD here, which one? It is possible though but, as far as I know a page like that cannot be put inside a frame. However, a single 'stock' page can be made up, a template. Then certain values on the template can be filled in using variables passed to it on its url. This still involves javascript or some other scripting language. This method is full of potential pitfalls on the internet but, if you are releasing this only on a disk and are sure all browsers will be either modern IE (5+) or modern Mozilla based like NS6+ and FF1.0+, it should be OK. Another problem will arise in IE though. Using javascript in locally run material will pop-up a security warning in the alert bar and/or a security violation 'page cannot be loaded' unless 'the mark of the web' is on all the pages. I still think a separate page for each video is the way to go but, if you want to try this out, 'the mark of the web' can be given to a page by putting:

<!-- saved from url=(0014)about:internet -->just below the <html> tag. This must be done to all pages used in the presentation. Then a link can look like this:

<a href="VideoPlayer.html?vidList=videos/playlist.m3u">Link Text</a>Pulling that variable out is easy enough, applying it inside your OBJECT tag may be a little tricky and you may need to expand that tag to be an object/embed tag to work in Mozilla, not sure. OK, the script on the receiving page to catch this one variable could be:

<script type="text/javascript">
var vidList=location.href.split('=')[1]
</script>and be placed in the head of the VideoPlayer.html page. Then for your OBJECT tag, you could use document.write:

<TD align="center" width="320" padding="0" bgcolor="#000000">
<script type="text/javascript">
document.write('<OBJECT ID="mediaPlayer" width="320" height="240"\n\
STANDBY="Loading Microsoft Windows Media Player components..."\n\
<param name="Filename" value="'+vidList+'">\n\
</TD>Right there in the body where the tag normally would go.

Irish Witch
10-02-2005, 09:27 AM

It works It Works...
A little fine tuning and I'll post the finished product here as an attachment so you can see what I was doing.

Irish Witch
10-03-2005, 06:17 AM
Here w3 go.

One top of the line CD/DVD index system for display of pictures and videos.
Now that I have a template I've already burned three disks with this.
- This one (which was mainly a test)
- One of my cousins wedding photo's and videos
- and a collection of pictures on their own cause mum is trying to made a digital gallery of family photos.

Unzip and take a look.
I had to remove the GIFs to create a TV look. I'd stole the ones from http://www.grif.tv/ and modified the bottom part to not have a frame so you get the picture.
And at the moment only Video List and Gallery are linked up..

Not frame, stand.. Bah, you get what I mean..

Irish Witch
10-03-2005, 07:24 AM
Since I'm not going to post twice here's a link.
This is what I'm using to Autoboot the CD onto the web page.