Ahmed562718

Hi,

I am new to HD DVD authoring and I want to know how to manage the authoring between scripting and xml.

I saw some examples where no scripting is used and others have both.

So, What I want to know how to use them properly

thx



Re: HD DVD Interactivity Authoring How to use xml and scripting?

Clinic

That is quite a wide open question. It might be best to start looking into the history of these two items (XML, and Script.) You can check out any of this in Wikipedia if you want to get more involved.

XMU History - SMIL 2.0, XPATH1.0, XSL, XML

Generally, Markup (like HTML) is used for Laying out items on a screen.

Since the screen we are working with has time information, some W3C deffinitions like SMIL were incorporated. Since there was a powerful XML query langauge defined, XPATH elements seemed a good incorporation into the HD DVD spec as well. The markup document breaks down into three major areas:

Styling - defining reusable styles (XSL background)

Timing - defining markup sequential or parallel timing (SMIL, and XPATH incorporation)

Content - defining the layout of graphical and other elements on the page.

Javascript - ECMA262, and ECMA327

Generally, javascript is used to perform more complex functions in a non-declarative manner. More powerful API's exist in Javascript to accomplish XMLParsing, FileIO, and some higher level Network functions. Javascript came along in during the browser war days to incorporate interactivity (Dynamic HTML), and programming into previously non-interactive web pages. Javascript (Originally named ECMAScript) has grown, and shrunk, and reformed, and these two derivatives have found themselves mostly incorporated into HD DVD.

I tend to define the layout of the screen with Markup, and hand all functionality through to my script. As a programmer, I like to have all logic in one place. But there are others that prefer to define as much as possible in the Markup to use this declaritive XML system that is allready in place.

So the answer is you can do both, but it is good to know what will suit your needs as an HD DVD programmer. Knowing the boundaries, and intentions of the underlying tech is a good place to start.

... there is some more history going back into DVD ENAV, which was a book added to the DVD spec, for higher interactivity. Though that ship set sail to late to be realized, but it lended its lessons into HD DVD today.






Re: HD DVD Interactivity Authoring How to use xml and scripting?

Peter Torr - MSFT

That's not a simple question, so it doesn't have a simple answer :-|

At a very high level, you use the XML markup language to define the layout, styling, and simple animation of your title. The XML page looks somewhat like HTML (you have nested div, button, and p elements) and you can apply things like colours, background images, borders, transparenct, etc. all with XML. You can also perform simple animations based on the passage of time or some basic user interactions like clicking a button. Lastly, you can trigger script execution by raising events.

Script, on the other hand, is used to define the behaviour and complex animations of your title. It can respond to events generated by the player or the user (play state changed; title began; user pressed a key; etc.), to periodic timers, or to events generated by the XML markup page. The script does things like control playback, switch to different menu pages, and perform complicated animations that cannot be described in simple markup language.

Although you can create a very simple title with only markup, pretty much every interesting title will require script to do things like jump chapters, change audio settings, etc. Similarly, you can create a title that has no markup at all (but then the user gets no feedback about what's happening), or you could dynamically generate all the markup (rather than having it written beforehand), but that will be overly complicated and I wouldn't recommend it at all.

If you look at the HDi Sample Code download at http://www.microsoft.com/windows/windowsmedia/forpros/hddvd/default.aspx you will see two very different approaches to this.






Re: HD DVD Interactivity Authoring How to use xml and scripting?

Clinic

Jump in the saddle and ride!




Re: HD DVD Interactivity Authoring How to use xml and scripting?

JasonG

For me it's helpful to actually print out my XML and Jscript on paper and review them that way (print from Oxygen using inserted schemas for color coding)...For some reason I don't like to read txt files. You get a bigger picture when it is physicaly in front of you ...laid out left to right.