jplayer 2.6:无法播放MP4视频文件

3

I have coded and installed the sample video html file as described on the jplayer.org web site. Using the sample videos provided by jplayer, the video plays as it should with IE, Chrome, & Pale Moon, though I am not certain which version (m4v or ogv) plays. -- www.bbhq.com/first2.htm

However, when I change the video coding to my mp4 (rather than m4v) and ogv files as shown below, the player plays, but defaults to the ogv version in IE, Chrome, & Pale Moon. On my Kindle Fire HDX, it displays the message indicating that I need to install the flash plugin, which, of course, is not available for the Kindle Fire HDX, and thus, does not play at all:

www.bbhq.com/first3.htm

$(document).ready(function(){                
  $("#jquery_jplayer_1").jPlayer({         
    ready: function () {                          
      $(this).jPlayer("setMedia", {          
        title: "my title",       
        mp4: "http://www.bbhq.com/vfiles/mine.mp4",        
        ogv: "http://www.bbhq.com/vfiles/mine.ogv",           
        poster: "http://www.bbhq.com/vfiles/mine.png"       
      });            
    },               
    swfPath: "/jp",                     
    supplied: "mp4, ogv"            
}); 

My preference is to play the mp4 version whenever possible, and skip having to use the ogv file, if possible.

I have encoded my mp4 file as I have done for other players (H.264) using Handbrake.

Either my mp4 encoding is not correct, or my coding for the html page are not correct. Can you help me with this?

Thank you.

1个回答

6

在jwplayer中没有mp4关键字可以传递mp4文件,但可以使用m4v关键字并将supplies值更改为“m4v”。因此,如果您想播放mp4视频,请按以下方式更改您的代码

  $(document).ready(function(){                
  $("#jquery_jplayer_1").jPlayer({         
    ready: function () {                          
      $(this).jPlayer("setMedia", {          
        title: "my title",       
        m4v: "http://www.bbhq.com/vfiles/mine.mp4",  //mp4 key changed      
        ogv: "http://www.bbhq.com/vfiles/mine.ogv",           
        poster: "http://www.bbhq.com/vfiles/mine.png"       
      });            
    },               
    swfPath: "/jp",                     
    supplied: "m4v, ogv"   // instead of mp4 pass m4v        
  });  

媒体支持

HTML5:mp3、mp4(AAC/H.264)、ogg(Vorbis/Theora)、webm(Vorbis/VP8)、wav Flash:mp3、mp4(AAC/H.264)、rtmp、flv 为了实现跨浏览器的支持,在 HTML5 和 Flash 中必须提供一种格式。 可以提供可选的其他格式来增加跨浏览器的 HTML5 支持。


如果它能正常工作并且有用,请将答案标记为有用,以使其他用户也能受益。 - Shafeeq
在IE和我的Kindle Fire HDX上可以运行,但在Win 7上运行的Chrome 34.0上无法运行。然而,在运行Win XP的Chrome 34.0上可以运行。我不知道...也许是Chrome设置的问题。但我认为我在两个环境中的设置是相同的。但如果我自己不能使其工作,我就不能指望访问我的网站的访客使其工作。我所尝试做的就是让一个相对灵活的视频播放器在所有主要浏览器中都能够运行。这真的让我崩溃! - user1852336

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接