Use new player via <asciinema-player> tag
parent
a04d788e63
commit
fe02704599
@ -1,2 +1,2 @@
|
||||
//= require base
|
||||
//= require player
|
||||
//= require asciinema-player
|
||||
|
@ -1,44 +0,0 @@
|
||||
//= require asciinema-player
|
||||
|
||||
function tryCreatePlayer(parentNode, asciicast, options) {
|
||||
function createPlayer() {
|
||||
asciinema_player.core.CreatePlayer(
|
||||
parentNode,
|
||||
asciicast.url,
|
||||
{
|
||||
width: asciicast.width,
|
||||
height: asciicast.height,
|
||||
snapshot: asciicast.snapshot,
|
||||
speed: options.speed,
|
||||
autoPlay: options.autoPlay,
|
||||
loop: options.loop,
|
||||
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 && asciicast.snapshot) {
|
||||
$('.processing-info').remove();
|
||||
createPlayer();
|
||||
} else {
|
||||
$('.processing-info').show();
|
||||
setTimeout(fetch, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
checkReadiness();
|
||||
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue