Javascript-форум (https://javascript.ru/forum/)
-   Events/DOM/Window (https://javascript.ru/forum/events/)
-   -   jwPLayer Video Screen Snapshot (https://javascript.ru/forum/events/65045-jwplayer-video-screen-snapshot.html)

myshara 22.09.2016 09:22

jwPLayer Video Screen Snapshot
 
Добрый день.

Есть вопрос по снятию скриншотов с jwPlayer.

Пробовал организовать через:
html2canvas($('#playerMyCam'), {
                onrendered: function (canvas) {
                    var img = canvas.toDataURL('image/png').replace("image/png", "image/octet-stream");
					console.log($('#'+$('#admin-screen').attr('data-cam')).prev().attr('src',img));
                   // window.location.href = img;                     
                }
            });


Но получается только черный фон области блока без картинки изображения на плеере.

Попробовал подключить плагин Video Screen Snapshot

function showMyCam(camName){
 jwplayer('playerMyCam').setup({
 file: 'rtmp://172.31.255.199:1935/'+camName+'/stream',
 width: '100%',
 aspectratio: '4:3',
 plugins: {
    "https://static.electroteque.org/js/jw7/snapshot-4.1.0.js": {
    savelocal: true,
    type: "jpg",
    quality: 0.8,
    dockButtonUrl: "../images/snapshoticon.png",
    previewClass: "snapshot localpreview",
    //html5 only
    originbaseurl: "http://crossorigin.electroteque.org/video/"
    }
    }
 });
}


Браузер выдает сообщение :
Domain not allowed

и в консоли ошибка:
VM928:1 Uncaught SyntaxError: Unexpected token ILLEGAL

Что делаю не так?

Спасибо!


Часовой пояс GMT +3, время: 17:09.