Expression Encoder template
Last post 05-10-2008 4:35 PM by shawn6699. 4 replies.
Sort Posts:
05-07-2008 7:21 AM
Expression Encoder template

 Hi,

   I want to use the template code in the Encoder. It works when I used all the codes in the same folder. But if I want to keep all the files except default.htm in a separate folder, what should I do? I tried. I modified the code in the default.htm to link to the files in the Silverlight folder, like, ~/Silverlight/player.js , or  Silverlight/player.js.  

But can not make it run. 

 


-default.htm

-Silverlight(startplayer.js, player,js, and etc)

 Thanks

 

  
 

shawn6699

Joined on 05-01-2008
Posts 3
05-07-2008 10:09 AM
Re: Expression Encoder template

easiest way I found is to use an iframe to host your silverlight player page.

Greg
www.GJHDigital.com

gjhdigital

Joined on 12-25-2005
Posts 203
05-07-2008 7:51 PM
Re: Expression Encoder template

 

GJHDigital:

easiest way I found is to use an iframe to host your silverlight player page.

 

Hi,

    I am sorry I didn't make it clear.  The default setup in the template is that all the files are in the same folder. It worked fine when I ran it. What I want to do is to call the .js files and .xaml file in the silverlight folder from the outside of the folder.  For example, the files structure is as followed:

 ---default.htm

---Silverlight folder including all .js files and .xaml file

I tried to make it work  by modifying the link to .js files and .xaml file in the Silverlight folder  like "src='Silverlight/.js'" or "src='~/Silverlight/.js'". But it didn't work.

 

Thanks for help 


 


 
shawn6699

Joined on 05-01-2008
Posts 3
05-09-2008 2:50 AM
Marked as Answer
Re: Re: Expression Encoder template

Hello, do the following:

Modify Default.html, so that all script reference refers to the Silverlight folder, such as:

<script type='text/javascript' src="Silverlight/MicrosoftAjax.js"></script>

Modify StartPlayer.js, so that the source parameter passed to createObjectEx will refer to the correct XAML file:

 Silverlight.createObjectEx( { source: 'Silverlight/player.xaml',

If you've put the video file to another folder, also modify get_mediainfor function:

function get_mediainfo(mediainfoIndex) {switch (mediainfoIndex) {

case 0:
return { "mediaUrl": "yourfolder/test.wmv",

The essential idea is: All paths are relative to the html file.

 

shanaolanxing - Please mark the posts as answers if they help and unmark if they don't.

Yi-Lun Luo - MSFT

Joined on 10-29-2007
Posts 1,084
05-10-2008 4:35 PM
Re: Re: Re: Expression Encoder template
Thanks. That's what I need!
shawn6699

Joined on 05-01-2008
Posts 3