最近做的视频上传播放下载功能的时候遇到了问题:
 public string PlayMedia()
    {
       // string url = Request.QueryString["url"].ToString();
        string url = "upload/201305141450.rmvb";
      //  string url = "upload/2013514101206.swf";
        string strScript =
         "<TABLE id=\"Table2\" align=\"center\" border=\"0\" runat=\"server\" width = '480' height ='450'>"
         + "<TR>"
         + "<TD align=\"center\">"
         + "<OBJECT id=\"mdpTrailer\" classid=\"clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" name=\"mdpTrailer\" width='480' height = '450'>"
         + "<PARAM NAME=\"AudioStream\" VALUE=\"-1\">"
         + "<PARAM NAME=\"AutoSize\" VALUE=\"-1\">"
         + "<PARAM NAME=\"AutoStart\" VALUE=\"0\">"
         + "<PARAM NAME=\"AnimationAtStart\" VALUE=\"-1\">"
         + "<PARAM NAME=\"AllowScan\" VALUE=\"-1\">"
         + "<PARAM NAME=\"AllowChangeDisplaySize\" VALUE=\"-1\">"
         + "<PARAM NAME=\"AutoRewind\" VALUE=\"0\">"
         + "<PARAM NAME=\"Balance\" VALUE=\"0\">"
         + "<PARAM NAME=\"BaseURL\" VALUE=\"\">"
         + "<PARAM NAME=\"BufferingTime\" VALUE=\"5\">"
         + "<PARAM NAME=\"CaptioningID\" VALUE=\"\">"
         + "<PARAM NAME=\"ClickToPlay\" VALUE=\"-1\">"
         + "<PARAM NAME=\"CursorType\" VALUE=\"0\">"
         + "<PARAM NAME=\"CurrentPosition\" VALUE=\"-1\">"
         + "<PARAM NAME=\"CurrentMarker\" VALUE=\"0\">"
         + "<PARAM NAME=\"DefaultFrame\" VALUE=\"\">"
         + "<PARAM NAME=\"DisplayBackColor\" VALUE=\"0\">"
         + "<PARAM NAME=\"DisplayForeColor\" VALUE=\"16777215\">"
         + "<PARAM NAME=\"DisplayMode\" VALUE=\"0\">"
         + "<PARAM NAME=\"DisplaySize\" VALUE=\"4\">"
         + "<PARAM NAME=\"Enabled\" VALUE=\"-1\">"
         + "<PARAM NAME=\"EnableContextMenu\" VALUE=\"-1\">"
         + "<PARAM NAME=\"EnablePositionControls\" VALUE=\"-1\">"
         + "<PARAM NAME=\"EnableFullScreenControls\" VALUE=\"0\">"
         + "<PARAM NAME=\"EnableTracker\" VALUE=\"-1\">"
         + "<PARAM NAME=\"Filename\" VALUE=\"" + url + "\">"
         + "<PARAM NAME=\"InvokeURLs\" VALUE=\"-1\">"
         + "<PARAM NAME=\"Language\" VALUE=\"-1\">"
         + "<PARAM NAME=\"Mute\" VALUE=\"0\">"
         + "<PARAM NAME=\"PlayCount\" VALUE=\"1\">"
         + "<PARAM NAME=\"PreviewMode\" VALUE=\"0\">"
         + "<PARAM NAME=\"Rate\" VALUE=\"1\">"
         + "<PARAM NAME=\"SAMILang\" VALUE=\"\">"
         + "<PARAM NAME=\"SAMIStyle\" VALUE=\"\">"
         + "<PARAM NAME=\"SAMIFileName\" VALUE=\"\">"
         + "<PARAM NAME=\"SelectionStart\" VALUE=\"-1\">"
         + "<PARAM NAME=\"SelectionEnd\" VALUE=\"-1\">"
         + "<PARAM NAME=\"SendOpenStateChangeEvents\" VALUE=\"-1\">"
         + "<PARAM NAME=\"SendWarningEvents\" VALUE=\"-1\">"
         + "<PARAM NAME=\"SendErrorEvents\" VALUE=\"-1\">"
         + "<PARAM NAME=\"SendKeyboardEvents\" VALUE=\"0\">"
         + "<PARAM NAME=\"SendMouseClickEvents\" VALUE=\"0\">"
         + "<PARAM NAME=\"SendMouseMoveEvents\" VALUE=\"0\">"
         + "<PARAM NAME=\"SendPlayStateChangeEvents\" VALUE=\"-1\">"
         + "<PARAM NAME=\"ShowCaptioning\" VALUE=\"0\">"
         + "<PARAM NAME=\"ShowControls\" VALUE=\"-1\">"
         + "<PARAM NAME=\"ShowAudioControls\" VALUE=\"-1\">"
         + "<PARAM NAME=\"ShowDisplay\" VALUE=\"0\">"
         + "<PARAM NAME=\"ShowGotoBar\" VALUE=\"0\">"
         + "<PARAM NAME=\"ShowPositionControls\" VALUE=\"-1\">"
         + "<PARAM NAME=\"ShowStatusBar\" VALUE=\"0\">"
         + "<PARAM NAME=\"ShowTracker\" VALUE=\"-1\">"
         + "<PARAM NAME=\"TransparentAtStart\" VALUE=\"0\">"
         + "<PARAM NAME=\"VideoBorderWidth\" VALUE=\"0\">"
         + "<PARAM NAME=\"VideoBorderColor\" VALUE=\"0\">"
         + "<PARAM NAME=\"VideoBorder3D\" VALUE=\"0\">"
         + "<PARAM NAME=\"Volume\" VALUE=\"-600\">"
         + "<PARAM NAME=\"WindowlessVideo\" VALUE=\"0\">"
         + "</OBJECT>"
         + "</TD>"
         + "</TR>"
         + "</TABLE>";        return strScript;
    }
这么写为什么播放不了.rmvb类型的视频呢?而.swf类型的视频就可以。我也不知道类型的关系呢还是我播放的.rmvb的视频太大。请大牛们给看看那个属性设置得不对?asp.net 视频

解决方案 »

  1.   

    因为很多flash播放器本来就只支持swf,flv,mp4等格式你先要把上传的格式转换,然后再播放
      

  2.   

    自己写一个 不如去网上找一个视频播放器 例如: http://www.cuplayer.com/然后你自己写一个视频转换就行了  不用那么麻烦 又要写播放器 又要写转换如果你想直接播放rmvb 那是行不通的
      

  3.   

    1.转码成swf,flv,mp4 使用 Flash 播放器 CkPlayer
    2.不转码,直接使用第三方播放器,需要客户端下载该播放器,类似快播你懂的----百度影音 网站上有调用API
      

  4.   

    得部署服务器,提供协议,ui放出的是http协议,实现不了你要的