1

I want to make that everybody would watch flash(flv) format expect if they don't have flash they would see html5(mp4/m4v) videos.

I was using JWPlayer 5, but because of some bugs I need to change it to JWPlayer 6.

   jwplayer('mediaplayer').setup({
    'flashplayer': 'http://www.domain.com/jwplayer/player.swf',
    'id': 'playerID',
    'autostart': 'false',
    'image': 'http://domain-images.s3.amazonaws.com/domain/picture.png', 
    'autostart': 'false',
    'controlbar': 'bottom',
    'width': '640',
    'height': '<?php /*echo $video_player_height;*/ ?>',
    'dock': 'false',
    'stretching': 'fill',
    'icons': 'false',
    'mute': 'false',    
    'volume': '100',            
    'quality': 'false',
    'modes': [
        { type: 'flash', 
          src: 'http://www.domain.com/jwplayer/player.swf', 
          config: {
          'file': '<?php /*echo $media_files[$id]['video']*/ ?>.flv',
          'provider': 'video'
            } 
        },
        { type: 'html5',
          config: {
          'file': '<?php /*echo $media_files[$id]['video']*/ ?>.mp4',
          'provider': 'video'
          }
        },
        { type: 'download',
          config: {
          'file': '<?php /*echo $media_files[$id]['video']*/ ?>.mp4', 
          'provider': 'video'
          }
        }  
    ]
});

Everything was good, but I didn't find how to make same in JWPlayer. Seems that I've read all the documentation, but didn't find the way expect if I'm using RTMP or HLS protocols.

  • Why not just provide an MP4? That will be viewable in HTML5 mode on every platform/browser except for IE8 and Firefox on WinXP, which will drop back to showing the MP4 with Flash. There's no need for an FLV at all, ever. It's an obsolete format. – MisterNeutron May 22 '15 at 23:39
  • We have like 5% of visitors with – user2285522 May 23 '15 at 00:03
  • MP4 Works in IE8 and below too in Flash since Flash 9... – emaxsaun May 26 '15 at 04:34
  • Ok. But I still want to do the fallback for flash (.flv) primary format and if it doesn't work to use HTML5(.mp4) file, because .mp4 format files loads significantly longer than .flv format files. – user2285522 May 26 '15 at 18:55
  • There should be no loading time difference between an FLV and the same thing converted to MP4, assuming you've got the moov atom in the right place. If you're seeing a difference, your MP4's are probably not encoded properly. – MisterNeutron May 26 '15 at 20:56

1 Answers1

2

Provide only an MP4, and a simple setup: http://misterneutron.com/JW6video/

Visitors with modern browsers will see the MP4 played with native HTML5. Visitors with older browsers (like IE8 and earlier) will see the MP4 played with Flash. Visitors who have older browsers but don't have Flash installed will be offered a download.

The JW Player script takes care of all of this for you, automatically. You don't need to provide multiple formats, and you don't need any sort of "modes" attributes (which don't exist in JW6).

To make sure your MP4 streams properly, the moov atom must be at the beginning of the file - if it isn't, the whole file will have to download before it starts playing. If it's in the right place, the player will need only the first few seconds of the file before it starts playing.

To convert another format to MP4, use Handbrake: http://handbrake.fr/. Take the default options, but also check Web optimized. If you're using ffmpeg, use the -movflags faststart attribute. If you have an MP4 that has the moov atom at the end, and you just want to move it, use MP4 FastStart, which has only one purpose - it quickly alters the file to place the moov atom properly: http://www.datagoround.com/lab/

MisterNeutron
  • 3,359
  • 3
  • 17
  • 20
  • Thanks for updating. I will check if the problem is in badly converted videos. Too many videos to reconvert. Are you for sure that JW6 doesn't have fallback? – user2285522 May 27 '15 at 19:45
  • JW6 does have a fallback. We're just trying to convince you to let go of an obsolete format. There's no reason to cling to it. It's like someone asking for directions for driving from New York to Boston, but insisting that he should use the old Boston Post Road, instead of I-95. With Handbrake, you can convert entire folders full of videos. Just select the folder, hit the Start button, and walk away. – MisterNeutron May 27 '15 at 21:12
  • I have used MP4 FastStart to move the moov atom, but I don't really see a big difference. Still not loading as fast as it was before. Could you provide a script with fallback for two files .flv and .mp4 that I could check it out? @MisterNeutron – user2285522 May 28 '15 at 16:55
  • 1
    It's all in the JW Player documentation: http://support.jwplayer.com/customer/portal/articles/1710454-configuring-multiple-sources. But it's still the absolutely wrong thing to do. Enjoy your stay in 1998! – MisterNeutron May 28 '15 at 17:50
  • I checked Fallback, but seems that regular way works fine. Thanks for your help @MisterNeutron – user2285522 May 29 '15 at 19:24