From: "Fred Doddridge" <[EMAIL PROTECTED]>
Subject: Re: callback example wanted

We're doing something very similar with our player.

I'm assuming that you want to flip the layer when a url event is passed.
Here's what I'd do:

In the applet, catch the url events and then call a javascript function to
flip the layer.  You could probably just do it in the applet as well, but
javascript saves you from having to recompile the applet for every change
you make.

in your callback class:
RAPlayer player;
JSObject window;
JSObject doc;

public void init() {
     window = JSObject.getWindow(this);
     doc = (JSObject) window.getMember("document");

     player = (RAPlayer) doc.getMember("player"); // <---- name of the
embedded player
     int pckts = player.GetPacketsTotal();

     player.AdviseG2((RMObserve)this);
     player.SetAutoGoToURL(false);

}

// ......

public void onGoToURL(String url, String target) {
     try {
         String parms[];
         parms = new String[2];
         parms[0] = url;
         parms[1] = target;
         window.call("onGoToURL", parms);
     } catch (Exception e) {
         ....
     }

}

then create a javascript function:
function onGoToURL(url, target) {
     // flip the frame...
     //
}

Hope this helps...
Fred

----- Original Message -----
From: RealForum <[EMAIL PROTECTED]>
Sent: Monday, November 22, 1999 5:07 PM
Subject: callback example wanted


 > From: bill <[EMAIL PROTECTED]>
 > Subject: callback example wanted
 >
 > Hi.
 >
 > I'm trying to synchronize realaudio events with a javascript function that
 > displays dhtml layers as the audio plays. I thought I had an ingenious way
of
 > doing this by
 >
 > 1) using regular url events to a access a urls such as
 > http://www.foo.com/target/f.html?target=1
 > http://www.foo.com/target/f.html?target=2
 > http://www.foo.com/target/f.html?target=3
 >
 > 2) put a javascript funtion in the event's target frame source that parses
out
 > the "target=x" element of the url and passes the x to another function
that
 > displays the corresponding dhtml layer.
 >
 > This worked, but, I found that no matter how I constructed the event URLs,
the
 > browser would *always* go back to the host and re-access the f.html file,
 > rather that pull the page from the browser cache (is this a realpayer
issue?).
 > This meant that depending on the user connection speed, or load on the
host,
 > the div layers would not be consistently synchronized with the audio
content.
 > So, It looks like the only way to get a dhtml layer to display precisely
on que
 > is to use the callback methods.
 >
 > I've got callbacks working with vbscript without much pain. I also managed
to
 > get the callback.java code compiled despite the mistaken call to the
 > GetPacketsTotal method.
 >
 > int tempPcks = ra.GetPktsTotal();
 >
 > on lime 41 should be:
 >
 > int tempPcks = ra.GetPacketsTotal();
 >
 > The question: how do I make this thing work? The extension docs are
complete,
 > but lack any examples of implementation. I believe there *was* and example
of
 > this somewhere on the real.com site, but apparently it has disappeared.
 >
 > Thank you,
 > Bill
 >


*******************************************************
The RealForum is an email discussion group focused on using RealNetworks
products. The RealForum is a place to post messages about the best methods
for creating content using RealNetworks technologies and the planning and
implementation of streaming-media web sites.  Archives of RealForum can
be found at http://realforum.real.com

If you ever want to remove yourself from this mailing list,
you can send mail to <[EMAIL PROTECTED]> with the following
command in the body of your email message:

    unsubscribe realforum

or from another account, besides the address you subscribed with:

    unsubscribe realforum <[EMAIL PROTECTED]>

Reply via email to