jwplayer in fancybox not playing on ipad/iphone

前端 未结 2 1560
逝去的感伤
逝去的感伤 2020-12-11 13:19

I\'m using the following code but videos won\'t play with jwplayer inside fancybox on iOS (ipad/iphone)...works fine otherwise. I appreciate that iOS doesn\'t handle flash,

2条回答
  •  被撕碎了的回忆
    2020-12-11 14:22

    iOS only supports video streaming over the HTTP protocol, unlike Flash where you can use RTMP. A configuration example how to configure JWPlayer using a HTML5 fallback solution can be found in the documentation.

    However, you need to keep care of these lines:

    'provider': 'rtmp',
    'streamer': 'rtmp://rtmp.example.com/application',
    'file': 'sintel.mp4'
    

    As said, iOS only supports streaming over HTTP, so you would need something like:

    'provider': 'http',
    'streamer': 'http://rtmp.example.com/application',
    'file': 'sintel.mp4'
    

    Of course your streaming server must support streaming over HTTP as well.


    EDIT

    In order to setup your JWPlayer in fancybox you can use the methods as usual. There is nothing special using Fancybox and JWPlayer together.

    HTML

    Here the player will be placed

    Javascript (adapted from your question)

    $(document).ready(function() {
      $(".video_popup").fancybox({
      fitToView: false, // to show videos in their own size
      scrolling: 'no', // don't show scrolling bars in fancybox
      afterLoad: function () {
        // get dimensions from data attributes
        var $width = $(this.element).data('width'); 
        var $height = $(this.element).data('height');
    
        // now, use JWPlayer to setup the player instead of embedding Flash
        jwplayer('mediaplayer').setup({
          // configuration code as in the documentation
        });
      }
    });
    

提交回复
热议问题