Skip to content

Commit

Permalink
Add Boris' video, remove placeholder video, make video skippable
Browse files Browse the repository at this point in the history
  • Loading branch information
MrApplejuice committed Sep 16, 2023
1 parent 0efde3c commit 97040ab
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
1 change: 0 additions & 1 deletion introvideo/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
/org_*
Binary file added introvideo/org_480p.mp4
Binary file not shown.
Binary file removed introvideo/public-domain-placeholder.mp4
Binary file not shown.
8 changes: 2 additions & 6 deletions web/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ INSTALL_PREFIX ?= install/

.PHONY: all build export testserver buildloop video install

all: build export video
all: build video

video_files ?= public-domain-placeholder.mp4 org_360p.mp4 org_480p.mp4 org_720p.mp4
existing_video_files = $(foreach f,$(video_files),$(shell [ -e ../introvideo/$(f) ] && echo ../introvideo/$(f) ))
Expand All @@ -23,17 +23,13 @@ resources/video/intro.mp4: $(video_source)
build:
$(TRANSCRYPT) -b -m -n -k -o -g main.py

export:
mkdir -p export
cp -r index.html pixi* jquery* resources __target__ export/.

buildloop:
while true ; do inotifywait -e create -e modify -r . ; make all ; done

testserver:
FLASK_APP=flask_server:app flask --debug run -h $(BIND_HOST) --port $(BIND_PORT)

install: build
install: build video
mkdir -p $(INSTALL_PREFIX)
rm -rf $(INSTALL_PREFIX)/*
cp -r $(install_files) \
Expand Down
29 changes: 26 additions & 3 deletions web/pixi_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def __init__(self):
g.setTransform(200 - 25, 100)
g.scale = pixipt(1, 0.6)


self._instvid__play_container.addChild(arrow)

start_text = do_new(
Expand All @@ -96,9 +95,30 @@ def __init__(self):

self._instvid__play_container.interactive = True
self._instvid__play_container.cursor = 'pointer'

self._instvid__play_container.on("pointertap", self._instvid__start_clicked)

g = self._instvid__skip_container = do_new(PIXI.Graphics)
g.beginFill(0x101010).drawRoundedRect(0, 0, 150, 40, 10)
g.anchor = pixipt(0.5, 0.5)
g.position = pixipt(400 - 75, 550 - 10)

skip_text = do_new(
PIXI.Text,
"Skip video",
{
"fontFamily": "Arial",
"fontSize": 24,
"fill": "#FFFFFF",
}
)
skip_text.position = pixipt(75, 20)
skip_text.anchor = pixipt(0.5, 0.5)
g.addChild(skip_text)

self._instvid__skip_container.interactive = True
self._instvid__skip_container.cursor = 'pointer'
self._instvid__skip_container.on("pointertap", self._instvid__cleanup)

def _instvid__start_clicked(self):
VIDEO_URL = "resources/video/intro.mp4"

Expand All @@ -120,11 +140,14 @@ def _instvid__start_clicked(self):
self._instvid__video_sprite.texture.baseTexture.resource.source.addEventListener(
"ended", self._instvid__cleanup
)

self.pixi.stage.addChild(self._instvid__skip_container)

def _instvid__cleanup(self):
self.pixi.stage.removeChild(self._instvid__play_container)
self.pixi.stage.removeChild(self._instvid__skip_container)

if self._instvid__video_sprite != None:
self._instvid__video_sprite.texture.baseTexture.resource.source.pause()
self.pixi.stage.removeChild(self._instvid__video_sprite)
self._instvid__video_sprite.destroy()
self._instvid__video_sprite = None
Expand Down

0 comments on commit 97040ab

Please sign in to comment.