Using jwplayer 6.11 video not Play on ipad

2019-02-28 17:25发布

We using JW Player 6.11 for video play .mp4 & .flv but not work on.

  1. ios7
  2. iPhone

How can I fix this one for at that time for iPad?

function playvideo() {
        jwplayer("mediaplayer").setup({
            playlist: [{

                    sources: [
                    { file: "<?php echo $this->getUrl().'Content/video/'.trim($_product->getVideourl());?>",
                        //type: 'html5',
                    }
            ],

            title: "Play"
        }
        ],

        controlbar: "none",
        height:388,
        width: 610,
        streamer: "rtmp://s14flalja9b5hr.cloudfront.net/cfx/st",
        startparam: "ec_seek",
        fallback: false, 
        repeat: false, 
        autostart: true, 
        primary: 'flash', 
        bufferlength: '30',
        stretching: 'fill',
        onpause: 'true',
        events: {
            onReady: function() { 
                    var t = setInterval(function() {
                            jwplayer("mediaplayer").play();
                            clearInterval(t);
                    }, 500); 
            },
            onComplete: function() { 
                    var t = setInterval(function() {
                            jwplayer("mediaplayer").remove();
                            clearInterval(t);
                    }, 500); 

            },
        }
        });

jwplayer

2条回答
干净又极端
2楼-- · 2019-02-28 17:57

RTMP is a Flash-only protocol. It requires Flash, no matter what player script you use. It can't be used on a mobile device (iOS, Android) because none of them supports Flash.

There is also no autostart on any mobile device - that's the way the devices themselves are designed, and you can't override that.

查看更多
走好不送
3楼-- · 2019-02-28 18:07

@RaviPatel, You should use the following code to play rtmp in flash devices like PC, Laps also html5 in unsupported flash devices..

    jwplayer("myElement").setup({
        playlist: [{
            image: "/assets/myVideo.jpg",
            sources: [{ 
                file: "rtmp://example.com/application/mp4:myVideo.mp4"
            },{
                file: "/assets/myVideo.mp4"
            }]
        }],
        height: 360,
        primary: "flash",
        width: 640
    });

Here,

file: "rtmp://example.com/application/mp4:myVideo.mp4" is used for  flash mode

and

file: "/assets/myVideo.mp4"is used for mobile devices like iOs and android..

This is the solution for you, Try this and hope it helps.

查看更多
登录 后发表回答