videos(wmv or other video files) are not playing when i hosted in server

Last post 02-24-2009 2:04 AM by XIII. 7 replies.

Sort Posts:

  • videos(wmv or other video files) are not playing when i hosted in server

    02-23-2009, 1:41 AM
    • Member
      4 point Member
    • sneha23
    • Member since 02-04-2009, 5:53 AM
    • Posts 91

     

    Hi i am playing an video file using asp.net,its playing fine in my local PC,But if i host it in the server ,its not playing.

    do you know the reason...let me know the solution for this.


    hope i get the code for my solution...

  • Re: videos(wmv or other video files) are not playing when i hosted in server

    02-23-2009, 7:19 AM
    • All-Star
      124,486 point All-Star
    • XIII
    • Member since 07-01-2002, 3:59 AM
    • Essen, Belgium
    • Posts 13,741
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs
    Hi,

    sneha23:
    hope i get the code for my solution...
     

    Actually it would be better to show your code as it seems to be working fine on your pc. Probably you are playing a file like c:\myvideos\somevideo.wmv

    But on a server you should not provide a hardware path but relative path or a direct url to your video instead. Like:

    /videos/myvideo.wmv or http://www.somesite.com/videos/myvideo.wmv

    for example.

    Grz, Kris.

  • Re: videos(wmv or other video files) are not playing when i hosted in server

    02-23-2009, 7:36 AM
    • Member
      4 point Member
    • sneha23
    • Member since 02-04-2009, 5:53 AM
    • Posts 91

     hi....

    user has to upload video at the time of registration..the uploaded video will stored on USERVIDEOS folder with his name on solution explorer..when he login into his account i want to show his uploaded video. from the folder....its working in my local pc...

    but when i hosted in server the problem arises....here is my code

     

      string myObjectTag = "";
            try
            {            
                sourceUrl = sourceUrl + "";
                sourceUrl = sourceUrl.Trim();

                if (sourceUrl.Length <= 0)
                    throw new System.ArgumentNullException("sourceUrl");

                myObjectTag = myObjectTag + "<object type='video/x-ms-wmv' data='" + sourceUrl + "' width='320px' height='240px'/>";
                myObjectTag = myObjectTag + " <param name='src' value='" + sourceUrl + "' valuetype='ref' type='http://mydomain.com/video.wmv'/>";
                myObjectTag = myObjectTag + "<param name='animationatStart' value='1'> />";
                myObjectTag = myObjectTag + " <param name='transparentatStart' value='1'> />";
                myObjectTag = myObjectTag + "<param name='showcontrols' value='1' />"; //Show play/stop/pause controls.
                myObjectTag = myObjectTag + "<param name='loop' value='0'/>";
                myObjectTag = myObjectTag + "<param name='autoStart' value='1'/>";
                myObjectTag = myObjectTag + "<param name='fullscreen' value='" + isFullSize.ToString() + "' />"; //Start in full screen or not.

                myObjectTag = myObjectTag + "<param name='showdisplay' value='0' />"; //Show or hide the name of the file.
                myObjectTag = myObjectTag + "<EMBED type='video/x-ms-wmv' width='320px' height='240px' showcontrols='1' showdisplay='1' showstatusbar='1'  autostart='False''" + sourceUrl + "' enabled='True' balance='0' currentPosition='0' enableContextMenu='True' fullScreen='False' mute='False' playCount='1' rate='1' stretchTofit='False' uiMode='3'/>";
                myObjectTag = myObjectTag + " <strong>Error:</strong> Embedding <a href='" + sourceUrl + "'</a> with the  Windows Media Plugin</a> />";
                myObjectTag = myObjectTag + "</object>";
            }
            catch (Exception ex)
            {
                lblErrMsg.Text = ex.Message;
            }
            return myObjectTag;
        }

     

  • Re: videos(wmv or other video files) are not playing when i hosted in server

    02-23-2009, 7:53 AM
    • All-Star
      124,486 point All-Star
    • XIII
    • Member since 07-01-2002, 3:59 AM
    • Essen, Belgium
    • Posts 13,741
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    Hi,

    how does sourceurl look like? Can you give some examples when you do a view source of the rendered page (deployed on your server where it doesn't work) ?

    Grz, Kris.

  • Re: videos(wmv or other video files) are not playing when i hosted in server

    02-24-2009, 12:42 AM
    • Member
      4 point Member
    • sneha23
    • Member since 02-04-2009, 5:53 AM
    • Posts 91

     in the source url im getting the path .....i.e....

    ..........\Uservideos\ username\sumvideo.wmv

  • Re: videos(wmv or other video files) are not playing when i hosted in server

    02-24-2009, 1:43 AM
    • All-Star
      124,486 point All-Star
    • XIII
    • Member since 07-01-2002, 3:59 AM
    • Essen, Belgium
    • Posts 13,741
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    Hi,

    actually it was the ....... that I was interested in since I think it's something like c:\somefolder\someotherfolder\uservideos\.... right?

    Ok, if that's the case change it as it's not going to work. You need a path like

    /Uservideos/username/sumvideo.wmv

    for example instead.

    Or like

    http://www.somesite.com/Uservideos/username/sumvideo.wmv

    Try it out on your site with the correct relative paths filled in properly and it should normally work.

    Grz, Kris.

  • Re: videos(wmv or other video files) are not playing when i hosted in server

    02-24-2009, 1:59 AM
    • Member
      4 point Member
    • sneha23
    • Member since 02-04-2009, 5:53 AM
    • Posts 91

     that is in my website.....the uservideos folder is creating at the time of registration in my solution explorer....

    when im retreving the path is......c://mywebsitename/UserVideosfolder/Usernamefolder/clock.wmv 

  • Re: videos(wmv or other video files) are not playing when i hosted in server

    02-24-2009, 2:04 AM
    • All-Star
      124,486 point All-Star
    • XIII
    • Member since 07-01-2002, 3:59 AM
    • Essen, Belgium
    • Posts 13,741
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    Hi,

    sneha23:
    .c://mywebsitename/UserVideosfolder/Usernamefolder/clock.wmv 
     

    Yes, and that's wrong like I already said.

     Ok, then change the paths like this (depending on where your folder UserVideosfolder is you'll need to add or remove the first / character)

    /UserVideosfolder/Usernamefolder/clock.wmv

    Grz, Kris.

Page 1 of 1 (8 items)