Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tracking make; add direct load a video #

  • Loading branch information...
commit 63dcbf20d7d61b53321fb54932ba124464f197d3 1 parent a54e6c7
@octatone authored
Showing with 55 additions and 1 deletion.
  1. +4 −1 js/tv.js
  2. +51 −0 make/make_loading_gif.sh
View
5 js/tv.js
@@ -218,7 +218,7 @@ var loadVideo = function loadVideo(video) {
if(over18()){
cur_video = this_video;
}
- }else if (cur_video > 0 && video != 'next'){
+ }else if (cur_video > 0 && video == 'prev'){
cur_video--;
while(over18() && cur_video > 0){
cur_video--;
@@ -234,6 +234,9 @@ var loadVideo = function loadVideo(video) {
}
}
}
+ if(typeof(video) == 'number'){ //must be a number NOT A STRING - allows direct load of video # in video array
+ cur_video = video;
+ }
if(this_video != cur_video || video == 'first') {
$('#video-embed').empty();
var title = $.unescapifyHTML(videos[cur_chan].video[cur_video].title);
View
51 make/make_loading_gif.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+fg=${1:-'#acffac'}
+bg=${2:-'transparent'}
+dstfile=${3:-'loading.gif'}
+size=64x64
+framenum=20
+delay=5
+blur=50
+swirl=150
+
+echo "Creating $dstfile with:"
+echo " Foreground color: $fg"
+echo " Background color: $bg"
+echo " Size: $size"
+echo " Number of frames: $framenum"
+echo "Delay between frames: $delay"
+echo
+
+set -e
+
+convert -size 500x500 xc:"$bg" -draw \
+ "fill none
+ stroke-width 80
+ stroke $fg
+ ellipse 250,250 200,200 0,80" \
+ loading_base.png
+
+stepsize=$((360/$framenum))
+for i in $(seq $framenum); do
+ rotation=$(($i*$stepsize))
+ framename="frame_$(printf %03d $i)of${framenum}_${size}_r${rotation}"
+ echo "Creating frame $framename ..."
+
+ # rotate
+ filename=
+ if [ ! -e "$framename.png" ]; then
+ convert loading_base.png \
+ -matte \( +clone -background "$bg" -rotate $rotation \) \
+ -gravity center -compose Src -composite "$framename.png"
+ fi
+
+ if [ ! -e "$framename.gif" ]; then
+ convert "$framename.png" -filter triangle -resize $size \
+ -radial-blur $blur -swirl $swirl "$framename.gif"
+ fi
+done
+
+gifsicle --disposal bg --delay=$delay --loop frame_*of${framenum}_${size}_*.gif > "$dstfile"
+
+rm frame_* loading_base.png
Please sign in to comment.
Something went wrong with that request. Please try again.