Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Following code works in IE9 and Opera but does not work in Firefox.

In Firefox, I am clicking another link and going back to the page that contains the video. Then, the video is starting. Otherwise, the video is not starting (again not starting when refreshing the page):

function output_video_URL(id, local_path_of_video, remote_path_of_video) {
    var http_check = getHTTPObject();

    var local_URL = local_server + local_path_of_video;
    var remote_URL = remote_server + remote_path_of_video;"HEAD", local_path_of_video);
    http_check.onreadystatechange = handleHttpResponse_check;

    function handleHttpResponse_check() {
        if (http_check.readyState == 4){
            if (http_check.status == 200) {
                var video = document.getElementById(id);
                video.src = local_URL;
                video.parentNode.Filename = local_URL;
            else if (http_check.status == 404) {
                var video = document.getElementById(id);
                video.src = remote_URL;
                video.parentNode.Filename = remote_URL;

            <object width="364" height="266" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="mediaplayer1">
                <param name="Filename" value="filmler/canakkeleklipkucuk.wmv" />
                <param name="AutoStart" value="True" />
                <param name="ShowControls" value="false" />
                <param name="ShowStatusBar" value="false" />
                <param name="ShowDisplay" value="false" />
                <param name="AutoRewind" value="false" />
                <embed id = "canakkeleklip" type="application/x-mplayer2" pluginspage="" width="320" height="240" src="filmler/canakkeleklipkucuk.wmv" autostart="True"  showcontrols="false" showstatusbar="false"  showdisplay="false" autorewind="false"> </embed>
            <script type = "text/javascript"> output_video_URL('canakkeleklip', 'videos/canakkeleklipkucuk.wmv', 'filmler/canakkeleklipkucuk.wmv'); </script>
share|improve this question
so the video is never working in firefox? – albert Sep 29 '11 at 8:00
The video is playing only if I go another page and back. When the page is newly loaded in new tab or the page is refreshed the video is not playing. – rasitburak Sep 30 '11 at 6:41

is there any particular reason that you are using wmv? have you considering using and multiple elements, serving up separate files for separate browsers?

You can convert your files @ online or download a tool to do it for you; i use Miro Video Converter alot.

share|improve this answer
First of all thanks a lot for your advice. The answer is yes, I should use wmv for this work. Maybe I can use converter later. In this work, I am trying to change the src of video. – rasitburak Oct 3 '11 at 5:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .