Use new player via <asciinema-player> tag
parent
dbf517d90c
commit
b373963497
@ -1,2 +1,2 @@
|
||||
//= require base
|
||||
//= require player
|
||||
//= require asciinema-player
|
||||
|
@ -1,45 +0,0 @@
|
||||
//= require asciinema-player
|
||||
|
||||
function tryCreatePlayer(parentNode, asciicast, options) {
|
||||
function createPlayer() {
|
||||
asciinema.player.js.CreatePlayer(
|
||||
parentNode,
|
||||
asciicast.url,
|
||||
{
|
||||
width: asciicast.width,
|
||||
height: asciicast.height,
|
||||
poster: options.poster || asciicast.snapshot,
|
||||
speed: options.speed,
|
||||
autoPlay: options.autoPlay,
|
||||
loop: options.loop,
|
||||
preload: options.preload,
|
||||
startAt: options.startAt,
|
||||
fontSize: options.fontSize,
|
||||
theme: options.theme,
|
||||
title: options.title,
|
||||
author: options.author,
|
||||
authorURL: options.authorURL,
|
||||
authorImgURL: options.authorImgURL
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function fetch() {
|
||||
$.get('/api/asciicasts/' + asciicast.id + '.json', function(data) {
|
||||
asciicast = data;
|
||||
checkReadiness();
|
||||
});
|
||||
}
|
||||
|
||||
function checkReadiness() {
|
||||
if (asciicast.url) {
|
||||
$('.processing-info').remove();
|
||||
createPlayer();
|
||||
} else {
|
||||
$('.processing-info').show();
|
||||
setTimeout(fetch, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
checkReadiness();
|
||||
}
|
Loading…
Reference in New Issue