windows media encoder scripting
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
windows media encoder scripting

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Encoders
Author Message
Troels Hansen
Guest





Posted: Wed Nov 23, 2005 5:30 pm    Post subject: windows media encoder scripting Reply with quote

I planning a live webcast using windows media.
I wan't to make a player embedded on a webpage (no problem) and have the
webpage show text as the webcast moves on.
I don't know in advance when text shoud be shown, I just know what text
to show. I therefor have to add a marker or something like that, when
encoding and capture the marker on the web embedded player. This should
be no problem either, but how do I add markers to the file?
I know of the script panel, and have played a little with it. If I use
the script panel, is there any way of saving the scripts when I archive
the file for later use?
I would like to reuse the script commands/markers for on demand
broadcasting.


--
Troels Hansen

Back to top
Neil Smith [MVP Digital M
Guest





Posted: Wed Nov 23, 2005 9:30 pm    Post subject: Re: windows media encoder scripting Reply with quote

On Wed, 23 Nov 2005 17:02:56 +0100, Troels Hansen <idle@invalid.email>
wrote:

Quote:
I planning a live webcast using windows media.
I wan't to make a player embedded on a webpage (no problem) and have the
webpage show text as the webcast moves on.
I don't know in advance when text shoud be shown, I just know what text
to show. I therefor have to add a marker or something like that, when

The "something" is called a script command

Quote:
encoding and capture the marker on the web embedded player. This should
be no problem either, but how do I add markers to the file?

You add them in the script panel (you have to define a profile which
uses script events, by selecting the script panel checkbox)

Quote:
I know of the script panel, and have played a little with it. If I use
the script panel, is there any way of saving the scripts when I archive
the file for later use?

The script commands are embedded in the outgoing stream and the saved
file.

Quote:
I would like to reuse the script commands/markers for on demand
broadcasting.

The player fires an onScriptCommand event when a command is received.
You can trap that and show the value of the script event in a (div /
textbox / whatever) as desired.

This is the code I usually use :

<script language="javascript1.2" type="text/javascript">

function ss_addEvent(elm, evType, fn, useCapture) {
// By Scott Andrew
try {
if (elm.addEventListener) {
elm.addEventListener(evType, fn, useCapture);
return true;
}
}
catch (err) {
try {
if (elm.attachEvent) {
var r = elm.attachEvent("on"+evType,
fn);
return r;
}
}
catch (err) {
return false;
}
}
}

function pageLoaded() {
player=document.getElementById("mediaplayer");
player.attachEvent("scriptcommand",handleScriptCommand);
}

function handleScriptCommand(commandType, commandText) {
switch (commandType) {
case "text" :
alert("sent script command "+commandText);
}
}
</script>

HTH
Cheers - Neil
Back to top
Troels Hansen
Guest





Posted: Thu Nov 24, 2005 5:30 pm    Post subject: Re: windows media encoder scripting Reply with quote

Neil Smith [MVP Digital Media] wrote:

Quote:
The script commands are embedded in the outgoing stream and the saved
file.

Shouldn't I be able to see the script commands if I opened the file in
windows media file editor?
I have tried enabeling archiving om the server, and saved the file in
the encoder. Neither of the two files have script commands embedded.

Back to top
Neil Smith [MVP Digital M
Guest





Posted: Thu Nov 24, 2005 9:30 pm    Post subject: Re: windows media encoder scripting Reply with quote

On Thu, 24 Nov 2005 16:39:22 +0100, Troels Hansen <idle@invalid.email>
wrote:

Quote:
Neil Smith [MVP Digital Media] wrote:

The script commands are embedded in the outgoing stream and the saved
file.

Shouldn't I be able to see the script commands if I opened the file in
windows media file editor?

You should, as small markers on the timeline.
How are you generating the script commands ?
I mean, what buttons etc do you press ?

Quote:
I have tried enabeling archiving om the server, and saved the file in
the encoder. Neither of the two files have script commands embedded.
Back to top
Troels Hansen
Guest





Posted: Fri Nov 25, 2005 9:30 am    Post subject: Re: windows media encoder scripting Reply with quote

Neil Smith [MVP Digital Media] wrote:

Quote:
Shouldn't I be able to see the script commands if I opened the file in
windows media file editor?


You should, as small markers on the timeline.
How are you generating the script commands ?
I mean, what buttons etc do you press ?

I have tried following the guide at
http://www.microsoft.com/windows/windowsmedia/howto/articles/adswm.aspx#inserting_event_script_commands_in_the_broadcast_stream__xdbw
I can insert text, url's and script commands fine.
I sype in the text in the script panel, and push insert.
The total scripts counter in the monitor panel counts one up, when I
insert a script.
If i look at the stream in wmp, and insert text commands, it shows up,
so I know it is inserted, but I'm still unable to see the commands in
file editor. If i click the "Script commans..." button the list is empty.


Troels Hansen
Back to top
Neil Smith [MVP Digital M
Guest





Posted: Mon Nov 28, 2005 5:30 pm    Post subject: Re: windows media encoder scripting Reply with quote

On Fri, 25 Nov 2005 09:23:26 +0100, Troels Hansen <idle@invalid.email>
wrote:

Quote:
Neil Smith [MVP Digital Media] wrote:

Shouldn't I be able to see the script commands if I opened the file in
windows media file editor?


You should, as small markers on the timeline.
How are you generating the script commands ?
I mean, what buttons etc do you press ?

I have tried following the guide at
http://www.microsoft.com/windows/windowsmedia/howto/articles/adswm.aspx#inserting_event_script_commands_in_the_broadcast_stream__xdbw
I can insert text, url's and script commands fine.
I sype in the text in the script panel, and push insert.
The total scripts counter in the monitor panel counts one up, when I
insert a script.
If i look at the stream in wmp, and insert text commands, it shows up,
so I know it is inserted, but I'm still unable to see the commands in
file editor. If i click the "Script commans..." button the list is empty.

It's because they're in a "script stream" and need to be in the wmv
file header instead. It's easily fixed, though :

http://www.microsoft.com/windows/windowsmedia/9series/encoder/faq.aspx#2_6

HTH
Cheers - Neil
Back to top
Troels Hansen
Guest





Posted: Mon Nov 28, 2005 5:30 pm    Post subject: Re: windows media encoder scripting Reply with quote

Neil Smith [MVP Digital Media] wrote:
Quote:
It's because they're in a "script stream" and need to be in the wmv
file header instead. It's easily fixed, though :

http://www.microsoft.com/windows/windowsmedia/9series/encoder/faq.aspx#2_6

Ahh, now there was something that worked :-)
Thank you for your help.


--
Troels Hansen
Back to top
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Encoders All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB