1

I am having problem with jw player. It is not working(player is not shown) in iOS(safari). The video is hosted on s3 with cloudfront. It works good on Mac's safari. Here is my piece of code.

<?php 
echo media_site_play_video_media_files();

function media_site_play_video_media_files(){
   global $base_url;
  drupal_add_js(libraries_get_path('jwplayer') . '/jwplayer.js');

  $output = '<div id="video-player">ENI Video</div>';

  $flash_player_path = $base_url.'/sites/all/libraries/jwplayer/player.swf';


  $output .= "<script>
            jwplayer('video-player').setup({
             autostart: false,
              flashplayer: '".$flash_player_path."',
              width : 220,
              height: 150,
              image: '".$base_url.'/sites/all/themes/evansnewton/images/ENI Logo w Partnership Progress.png'."',
              'provider': 'rtmp',
              'streamer': 'rtmp://s22ljyq61fr9xw.cloudfront.net/cfx/st/',
              'file': 'mp4:ENICorporateUpdate09-2012016large'
            });
            </script>";
  return $output;
}
?>
4

1 に答える 1

1

Amazing!!! I am able to resolve the issue. Just came across that iPAD does not support flash player and I used modes(flash and html5) and it worked great. Here is the new code

<?php 
echo media_site_play_video_media_files();

function media_site_play_video_media_files(){
   global $base_url;
  drupal_add_js(libraries_get_path('jwplayer') . '/jwplayer.js');

  $output = '<div id="video-player">ENI Video</div>';

  $flash_player_path = $base_url.'/sites/all/libraries/jwplayer/player.swf';


  $output .= "<script>
            jwplayer('video-player').setup({
             autostart: false,
              flashplayer: '".$flash_player_path."',
              width : 220,
              height: 150,
              image: '".$base_url.'/sites/all/themes/evansnewton/images/ENI Logo w Partnership Progress.png'."',
              'modes': [
                {   'type': 'flash',
                    'src': '".$flash_player_path."',
                        'config': {
                            'file': 'mp4:ENICorporateUpdate09-2012016large',                            
                            'streamer': 'rtmp://s22ljyq61fr9xw.cloudfront.net/cfx/st/',
                            'provider': 'rtmp'
                        }                    
                },
                {   'type': 'html5',
                        'config': {
                            'file': 'http://eni-video.s3.amazonaws.com/ENICorporateUpdate09-2012016large.mp4'
                        }
                }
              ]
            });
            </script>";
  return $output;
}
?>
于 2012-12-05T07:10:40.983 に答える