mac j

HelloSmile

I need help againSmile

I have two titles: mainMenu and mainMovie.

menu is in playlist application

how i can change the audio track of MainMovie from mainMenu it's easy when i'm in mainMovie, but what i should do to change it from mainMenu

thank you.



Re: HD DVD Interactivity Authoring audio - help

Arthur L

You need to store the track you want to switch to in a variable and then, when the title begins to play you can change the audio track. You can't change the audio of a title unless the title is playing.





Re: HD DVD Interactivity Authoring audio - help

Amy Dullard - MSFT

If you can, I would recommend making your track navigation for your mainMenu look like your mainMovie. (FYI, You can have all your tracks in mainMenu pointing to the same stream.) The player will attempt to maintain the track number, so when you go into your mainMovie, the previously selected track number should hold without any additional scripting.

Take a look at:

http://blogs.msdn.com/ptorr/archive/2007/02/20/the-difference-between-selected-and-current-tracks.aspx

Alternatively, you could save the track information for each title and set it up when the title begins. But, that can get fairly complicated.




Re: HD DVD Interactivity Authoring audio - help

Arthur L

I forgot that I was going to post the code you need to actually change the audio track:

Code Snippet

var track = 1; // some track number

Player.track.selectAudioTrackNumber(track);



So wherever you get the value you want to change the track to just store it and then call the above with it when the title is playing.

I hope that's helpfull.





Re: HD DVD Interactivity Authoring audio - help

mac j

how can i check wich title is now playing from the Markup

$titleNumber doesn't workSad





Re: HD DVD Interactivity Authoring audio - help

Arthur L

Code Snippet

Player.playlist.currentTitle.attributes.titleNumber;



That should give you the number of the currently playing title from script. I realize it's not what you asked for but I hope it's helpful.





Re: HD DVD Interactivity Authoring audio - help

Amy Dullard - MSFT

Referencing $titleNumber in the markup is referencing an XPath variable that you have to set in the script. You will probably want to update that value on the title_begin event...

Code Snippet

addEventListener( "title_begin", handleTitleBegin, false );

function handleTitleBegin(evt){

document.setXPathVariable("titleNumber",Player.playlist.currentTitle.attributes.titleNumber);

}






Re: HD DVD Interactivity Authoring audio - help

mac j

thank you!!!!, i'm going to workSmile





Re: HD DVD Interactivity Authoring audio - help

mac j

something doesn't work Smile

maybe i don't understand somethin what you are saying

i will show you what i want to do

i have something like that in Markup for my Play/Pause button

<par begin="id('proxy')[($playState = 1)]" end="id('proxy')[$playState != 1)]">
<cue select="id('playpause')" dur="1s" fill="hold">

<set style:backgroundFrame="1"/>
</cue>
</par>
<par begin="id('proxy')[($playState = 2)]" end="id('proxy')[($playState != 2)]">
<cue select="id('playpause')" dur="1s" fill="hold">
<set style:backgroundFrame="0"/>
</cue>
</par>

now i want to my button stay always in one position when the title number is 1(main menu)

so now i need to add some more conditions like [($playState = 1) and ($titleNumber = 2)]... or maybe there is some easier way

thank you and i'm sorry that i'm bother you so much





Re: HD DVD Interactivity Authoring audio - help

Amy Dullard - MSFT

$playState means that you have an XPath variable being set in the script. Do you have that code written It would look similar to the code above, except the event is play_state

XPath variables are strings. So you should use [($playState = '1') and ($titleNumber = '2')]

Alternatively, instead of checking both XPath variables, when you set playState, you could set this value based on the titleNumber and avoid using titleNumber in your markup.

And, you don't need to use fill="hold" because you are setting, not animating. And you don't need to have a par for each cue. Instead, do something like:

Code Snippet

<cue select="id('playpause')" begin="id('proxy')[($playState = '1')]" end="id('proxy')[$playState != '1')]">

<set style:backgroundFrame="1"/>

</cue>






Re: HD DVD Interactivity Authoring audio - help

mac j

no, i dont and it worksSmile thats way i thougt that $titleNumber will work too

btw $subtitleVisibility, $currentSubtitleTrackNumber, $currentSubtitleTrackNumber work too and i dont have anything like that in my script - intrinisc HD DVD Xpath Variables (i dont know what that mean - there is not such a word like "intrinisc" in my dictionarySmile

are you sure that function you wrote is correct, because i have some errors

i'll try to fix it

thanks





Re: HD DVD Interactivity Authoring audio - help

Amy Dullard - MSFT

Ah, Annex W (obviously, I was not well versed in this chapter).

Okay, I don't think you will be allowed to set these variables in script, so remove the function above.

For some reason, I'm getting NaN for the value of titleNumber when I use document.getXPathVariable("titleNumber") - although I don't know why...need to investigate.

You could tryin using titleId instead...

Code Snippet

<cue select="id('playpause')" begin="($playState = 1 and $titleId = 'MainMovie')" end="(not($playState = 1 and $titleId = 'MainMovie'))">

<set style:backgroundFrame="1"/>

</cue>






Re: HD DVD Interactivity Authoring audio - help

mac j

i allready did like that and it still doesn't work, now it's allways Play

i'll try something new tomorow

thanks





Re: HD DVD Interactivity Authoring audio - help

Amy Dullard - MSFT

Can you post (or email me) your markup and playlist






Re: HD DVD Interactivity Authoring audio - help

Amy Dullard - MSFT

and just to clarify, you have both cues, right

Code Snippet

<par>

<cue select="id('playpause')" begin="($playState = 1 and $titleId = 'MainMovie')" end="(not($playState = 1))">

<set style:backgroundFrame="1"/>

</cue>

<cue select="id('playpause')" begin="($playState = 2 and $titleId = 'MainMovie')" end="(not($playState = 2))">

<set style:backgroundFrame="0"/>

</cue>

</par>