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开发者_StackOverflow社区.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
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:
- Serve the data file(s) (playlist.xml, captions.xml, skin.swf, plugin, etc.) from the same domain as the movie.
- 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
- 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.
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).
精彩评论