jwPlayer - 当用户在移动设备上点击视频时更改预览图像

时间:2014-06-16 14:47:40

标签: jwplayer

网站加载时,我有一张预览图片,上面写着"点击此处播放" (在代码上命名为iPhoneVideoPreviewImage5),但是当用户点击图像时,在视频播放之前没有任何事情发生(没有"正在加载..." gif或图像) 我希望在视频缓冲时更改图像。 以下是设置代码:

        jwplayer('container').setup({
            plugins: {
                "/scripts/jwplayer/plugins/advanced_google_analytics.min.js": {}
            },
            skin: skinFC,
            playlist: [{
                file: introDownloadVideoUrl,
                provider: 'video'
            }, {
                file: streamingVideoFileName,
                provider: 'rtmp',
                streamer: cloudFrontStreamingDistribution
            }],
            repeat: 'list',
            image: videoPreviewImageUrl,
            autostart: autoStart,
            icons: 'false',
            stretching: 'exactfit',
            volume: '100',
            modes: [
                { type: 'flash', src: '/scripts/jwplayer/player.swf' },
                {
                    type: 'html5',
                    config: {
                        'file': downloadVideoUrl,
                        'provider': 'video',
                        'autostart': 'false',
                        'skin': '/scripts/jwplayer/FBS-FullControls/FBS-FullControls.xml',
                        'image': iPhoneVideoPreviewImage5
                    }
                },
                {
                    type: 'download',
                    config: {
                        'file': downloadVideoUrl,
                        'provider': 'video'
                    }
                }
            ],
            events: { 
                onReady: function () {
                    if (readCookie('VidIndex' + pathName) > 0 && readCookie('VidIndex' + pathName) <= jwplayer().getPlaylist().length + 1) {
                        // resume playing where left off
                        jwplayer('container').playlistItem(readCookie('VidIndex' + pathName));
                    }
                    if (readCookie('VidTimer' + pathName) > 10) {
                        // resume playing where left off
                        jwplayer('container').seek(readCookie('VidTimer' + pathName));
                    }
                    var browserHeight = $(window).height();
                    if (typeof changeVideoSize != "undefined" && browserHeight > 768) {
                        jwplayer().resize(640, 480);
                    }
                },
                onTime: function (evt) {
                    if (typeof (headlineCuePoint) != "undefined" && evt.position > headlineCuePoint && evt.position < headlineCuePoint + 1) {
                        updateHeadline();
                    }
                },
                onComplete: function () {
                    if (jwplayer().getPlaylistItem().file == streamingVideoFileName || jwplayer().getPlaylistItem().file == downloadVideoUrl) {
                        $('#video').slideUp('slow');
                        $('#replay').slideDown('slow');
                    }
                },
                onError: function (err) {
                    logError(err);
                }
            }
        });

一切正常,但用户认为没有任何事情发生,但实际上是视频加载。

0 个答案:

没有答案