开发者

jwplayer file name from C:

开发者 https://www.devze.com 2023-03-13 12:56 出处:网络
I have an application which plays a media with jwplayer.. and i have this code: jwplayer(\"VideoContainer\").setup({

I have an application which plays a media with jwplayer.. and i have this code:

 jwplayer("VideoContainer").setup({
                autostart: true,
                flashplayer: "swf/player.swf",
                file: "name.flv",
                height:开发者_StackOverflow中文版 270,
                width: 480

      });

when i put my name.flv in the application, the file recognizes the path, but when i have a file from C:.. its not loading the file for ex : file:"C:\....\name.flv"..how can i solve this problem? thanks alot


Client machines cannot play media files available locally on their drive with online flash players (with url = http://servername/playerapplication/playerpage), for security reasons, unless they upload the files to the server.

Check these links: http://www.longtailvideo.com/support/forums/jw-player/feature-suggestions/910/can-read-from-a-absolute-path#comment-57954; http://www.longtailvideo.com/support/forums/jw-player/setup-issues-and-embedding/8872/local-media-files

But you still can play a media file available on the server's C:\ drive, online from any machine, by using a streaming server like Wowza Media Server or Red5.

For Wowza server, you have to do the following:

  1. Create a new empty folder for your application (e.g. myplayerapp) under [wowza-install-dir]/applications
  2. Create another new empty folder (myplayerapp) under [wowza-install-dir]/conf, that includes Application.xml (Copy [wowza-install-dir]/conf/Application.xml), where you set Streams/StorageDir to C:

http://www.streamalot.com/wowza-tips&tricks-jwplayer.shtml

And your code will be like this:

 jwplayer("VideoContainer").setup({
                autostart: true,
                flashplayer: "swf/player.swf",
                file: "name.flv", //if your file is under C:\test, it will be file: "test/name.flv"...
                height: 270,
                width: 480,
                bufferlength: 2,
                streamer: "rtmp://servername/myplayerapp"
      });

Note that the Wowza Media Server should be started before running the player page.

Otherwise, to open local files on any machine, you need to open the player offline from every machine (e.g. C:\webserver\playerapplication\playerpage) and all the files (swf, js, media files) must have their locations set as local paths, as follows:

 jwplayer("VideoContainer").setup({
                autostart: true,
                flashplayer: "file:///C:/webserver/playerapplication/swf/player.swf", //or "C:\\...\\player.swf" or "C:/.../player.swf"
                file: "file:///C:/name.flv",
                height: 270,
                width: 480
      });


Did you try:

jwplayer("VideoContainer").setup({                 
    autostart: true,                 
    flashplayer: "swf/player.swf",                 
    file: "C:\\name.flv",                 
    height: 270,                 
    width: 480        
}); 
0

精彩评论

暂无评论...
验证码 换一张
取 消