Webconverger / webc

Webconverger's curated chroot from which updates originate
https://webconverger.org/upgrade/
73 stars 37 forks source link

Attract loop #168

Closed kaihendry closed 11 years ago

kaihendry commented 11 years ago
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=131423
# https://github.com/Webconverger/base/blob/master/kioskresetstation/idle.c
# http://git.suckless.org/xssstate/

idle_too_long() {
    timeout="$1"
    sleepfor=$( expr $timeout \- $( idleseconds ) )
    if test "$sleepfor" -gt 0
    then
        echo "Sleeping for $sleepfor"
        sleep $sleepfor
        return 1
    fi
    return 0
}

while true; do
    idle_too_long 10 || continue
    xloadimage -shrink -fullscreen -background black -border black -quiet /tmp/test.jpg
done
kaihendry commented 11 years ago

I've figure a way of overriding the Fullscreen API!

<script>
function test() {
video = document.createElement('video');
video.setAttribute('src', 'movie.ogv');
video.setAttribute('loop', 'loop');
document.body.appendChild(video);
video.play();
// http://s.natalian.org/2013-10-11/1381485816_1366x768.png
video.mozRequestFullScreen();
}
</script>
<body onload=test()>
kaihendry commented 11 years ago

Demo running here:

homepage=http://attract.webconverger.com
prefs=http://ppd.webconverger.com/2013/attract.js

Source code is here: https://github.com/Webconverger/Screensaver

kaihendry commented 11 years ago

Just to add we are having trouble limiting the fullscreen request permissions to just the homepage.

Using

Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/NetUtil.jsm");
Services.perms.add(NetUtil.newURI("http://attract.webconverger.com/"), "fullscreen", 1);
pref("full-screen-api.allow-trusted-requests-only", false);

Does not work because:

  1. an annoying "webconverger.com is now fullscreen" message...
  2. when one hits escape, the video is then playing non-fullscreen. It takes another keypress to remove it from the DOM
kaihendry commented 10 years ago

More documentation: http://webconverger.org/screensaver