Open playlist as XML from file or specific location
Hello,
since I started working with the 3D Nvision Plugin I wondered if it is not possible to fill the playlist from a file inculded in the Silverlight project or from a specified location. This will add the possibility to add content without changing the project itself. The specified location will allow other users to add content without permission of the Silverlight application. This is only usefull when you have a simple website.
At the moment I still have trouble with the external located XML file. It doesn't open the file correctly and maybe someone can help me. First I show the source with the working code with an included XML file. My XML file looks like this:[code]
<?xml version='1.0'?>
<playlist>
<playlistitem name="My 3D sample">
<mediaurl>http://myserver.net/example.ism/Manifest</mediaurl>
<thumburl>http://myserver.net/example_Thumb.jpg</thumburl>
<deliverymethod>3</deliverymethod>
<S3DEyePriority>1</S3DEyePriority>
<S3DFormat>1</S3DFormat>
<S3DContent>1</S3DContent>
<S3DLeftEyePAR>2</S3DLeftEyePAR>
<S3DRightEyePAR>2</S3DRightEyePAR>
</playlistitem>
</playlist>
[/code]
In the mainpage.xaml I only added this:
[code]
// load XML document
XDocument doc = XDocument.Load("Playlist.Xml");
loadPlaylist(doc);
[/code]
And added following includes
[code]using System.Xml;
using System.Xml.Linq;[/code]
The code for the loadplaylist() function is added to this post in the full project. The only thing to do now is add the "Playlist.xml" file to your silverlight application. This works fine for me!
Now I tried to download a XM file and fill the playlist with that content. Therefore I used this example from Microsoft [url="http://msdn.microsoft.com/en-us/library/cc645034%28v=vs.95%29.aspx"]Link[/url]. Following the example I added this code:
[code]
WebClient wc = new WebClient();
wc.OpenReadCompleted += wc_OpenReadCompleted;
wc.OpenReadAsync(new Uri("http://cms-server.ti-mmlab.haw-hamburg.de/typo4/fileadmin/user_upload/stephan/3DPlayer/Playlist.Xml"));
[/code]
and this function:
[code]
private void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
if (e.Error != null)
{
return;
}
using (Stream s = e.Result)
{
XDocument doc = XDocument.Load(s);
loadPlaylist(doc);
}
}
[/code]
The problem is that I allways get an error. Mayb someone is interested in this kind and can help me.
since I started working with the 3D Nvision Plugin I wondered if it is not possible to fill the playlist from a file inculded in the Silverlight project or from a specified location. This will add the possibility to add content without changing the project itself. The specified location will allow other users to add content without permission of the Silverlight application. This is only usefull when you have a simple website.
At the moment I still have trouble with the external located XML file. It doesn't open the file correctly and maybe someone can help me. First I show the source with the working code with an included XML file. My XML file looks like this:
The code for the loadplaylist() function is added to this post in the full project. The only thing to do now is add the "Playlist.xml" file to your silverlight application. This works fine for me!
Now I tried to download a XM file and fill the playlist with that content. Therefore I used this example from Microsoft Link. Following the example I added this code:
It seems that the clientaccesspolicy.xml is required to be added/created at the IIS root on your host.
<host local drive>/inetpub/wwwroot/clientaccesspolicy.xml
In fiddler web debugging tool, when the application is executed, the log shows error while looking for http://cms-server.ti-mmlab.haw-hamburg.de/clientaccesspolicy.xml.
Could you try creating a clientaccesspolicy.xml file at <host local drive>/inetpub/wwwroot/clientaccesspolicy.xml and add the following to it:
[code]
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*" />
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true" />
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
[/code]
It seems that the clientaccesspolicy.xml is required to be added/created at the IIS root on your host.
<host local drive>/inetpub/wwwroot/clientaccesspolicy.xml
In fiddler web debugging tool, when the application is executed, the log shows error while looking for http://cms-server.ti-mmlab.haw-hamburg.de/clientaccesspolicy.xml.
Could you try creating a clientaccesspolicy.xml file at <host local drive>/inetpub/wwwroot/clientaccesspolicy.xml and add the following to it:
since I started working with the 3D Nvision Plugin I wondered if it is not possible to fill the playlist from a file inculded in the Silverlight project or from a specified location. This will add the possibility to add content without changing the project itself. The specified location will allow other users to add content without permission of the Silverlight application. This is only usefull when you have a simple website.
At the moment I still have trouble with the external located XML file. It doesn't open the file correctly and maybe someone can help me. First I show the source with the working code with an included XML file. My XML file looks like this:[code]
<?xml version='1.0'?>
<playlist>
<playlistitem name="My 3D sample">
<mediaurl>http://myserver.net/example.ism/Manifest</mediaurl>
<thumburl>http://myserver.net/example_Thumb.jpg</thumburl>
<deliverymethod>3</deliverymethod>
<S3DEyePriority>1</S3DEyePriority>
<S3DFormat>1</S3DFormat>
<S3DContent>1</S3DContent>
<S3DLeftEyePAR>2</S3DLeftEyePAR>
<S3DRightEyePAR>2</S3DRightEyePAR>
</playlistitem>
</playlist>
[/code]
In the mainpage.xaml I only added this:
[code]
// load XML document
XDocument doc = XDocument.Load("Playlist.Xml");
loadPlaylist(doc);
[/code]
And added following includes
[code]using System.Xml;
using System.Xml.Linq;[/code]
The code for the loadplaylist() function is added to this post in the full project. The only thing to do now is add the "Playlist.xml" file to your silverlight application. This works fine for me!
Now I tried to download a XM file and fill the playlist with that content. Therefore I used this example from Microsoft [url="http://msdn.microsoft.com/en-us/library/cc645034%28v=vs.95%29.aspx"]Link[/url]. Following the example I added this code:
[code]
WebClient wc = new WebClient();
wc.OpenReadCompleted += wc_OpenReadCompleted;
wc.OpenReadAsync(new Uri("http://cms-server.ti-mmlab.haw-hamburg.de/typo4/fileadmin/user_upload/stephan/3DPlayer/Playlist.Xml"));
[/code]
and this function:
[code]
private void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
if (e.Error != null)
{
return;
}
using (Stream s = e.Result)
{
XDocument doc = XDocument.Load(s);
loadPlaylist(doc);
}
}
[/code]
The problem is that I allways get an error. Mayb someone is interested in this kind and can help me.
THX
Stephan
since I started working with the 3D Nvision Plugin I wondered if it is not possible to fill the playlist from a file inculded in the Silverlight project or from a specified location. This will add the possibility to add content without changing the project itself. The specified location will allow other users to add content without permission of the Silverlight application. This is only usefull when you have a simple website.
At the moment I still have trouble with the external located XML file. It doesn't open the file correctly and maybe someone can help me. First I show the source with the working code with an included XML file. My XML file looks like this:
In the mainpage.xaml I only added this:
And added following includes
The code for the loadplaylist() function is added to this post in the full project. The only thing to do now is add the "Playlist.xml" file to your silverlight application. This works fine for me!
Now I tried to download a XM file and fill the playlist with that content. Therefore I used this example from Microsoft Link. Following the example I added this code:
and this function:
The problem is that I allways get an error. Mayb someone is interested in this kind and can help me.
THX
Stephan
It seems that the clientaccesspolicy.xml is required to be added/created at the IIS root on your host.
<host local drive>/inetpub/wwwroot/clientaccesspolicy.xml
In fiddler web debugging tool, when the application is executed, the log shows error while looking for http://cms-server.ti-mmlab.haw-hamburg.de/clientaccesspolicy.xml.
Could you try creating a clientaccesspolicy.xml file at <host local drive>/inetpub/wwwroot/clientaccesspolicy.xml and add the following to it:
[code]
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*" />
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true" />
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
[/code]
It seems that the clientaccesspolicy.xml is required to be added/created at the IIS root on your host.
<host local drive>/inetpub/wwwroot/clientaccesspolicy.xml
In fiddler web debugging tool, when the application is executed, the log shows error while looking for http://cms-server.ti-mmlab.haw-hamburg.de/clientaccesspolicy.xml.
Could you try creating a clientaccesspolicy.xml file at <host local drive>/inetpub/wwwroot/clientaccesspolicy.xml and add the following to it:
thanks a lot, it works fine now!!!
greetz
Stephan
thanks a lot, it works fine now!!!
greetz
Stephan