0

I have the code for you as follows:- first of all in the head tag I have following javascript:-

<script type="text/javascript"> 
{ function startmeup(urlname) player.url=urlname }  
</script> 

then I load windows media player

<object id="player" 
 type="video/x-ms-wmv" classid="CLSID:6bf52a52-and the rest" 
 class="style" style="width:273px;height:255px"> 
</object> 

and then in the main body I have individual links for the videos to play

 <span> 
     <a href="#" onclick="startmeup(file='my url name/afghan.avi;);return false"> </a> 
 </span> 

But when I click on the video links it says connecting and then opening media but nothing plays. My video files are stored on a remote server. Can any one help and advise as to what should be done as those files as well as the javascript works ok on my local computer. thanks Vijay

2
  • 2
    Please fix the syntax errors in your examples first. Commented Dec 8, 2009 at 18:14
  • You won't receive good answers if your code cannot work because of lots of syntax errors. Commented Dec 8, 2009 at 19:13

2 Answers 2

1

Certain players will not stream content outside on a local domain for security purposes and bandwidth costs.

Adobe Flash Player security restrictions require that all files in your playlist come from the same domain unless you put a cross-domain policy file on the root of the server that is serving the data files.

Therefore, you must either:

  1. Serve the data file(s) (playlist.xml, captions.xml, skin.swf, plugin, etc.) from the same domain as the movie.
  2. Serve the data files through a proxy at the same domain as the movie, so it appears that they both come from the same domain
  3. Place a cross-domain policy file on the server that is hosting the data file(s).

Here's a link from Adobe on creating cross domain policies.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your reply. You have mentioned about creating a cross domain policy and I am assuming it is only for flash player. As I am using windows media player will this cross domain file help under windows media player. thank
0

You should first correct the syntax errors in your code. A function declaration should be written :

function myFunc(arg1) {
    // do stuff;
}

To get a DOM element by its ID, you should do (without any JS framework):

var elt = document.getElementById("myId");

And strings must be ended by a quote or a double quote, depending on what is at the beginning (quote or double quote).

1 Comment

Hi, Thanks for taking time to reply. As I am not very conversant with javascript could you please tell me what the syntax errors are so that I can fix as well as where and how to include the function and var to put in the document which you have mentioned above. I would really appreciate that as I am really fed up because my videos' are not playing. Thanks Vijay

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.