Esempio n. 1
0
            player.getOverlay('rpifade').set(1.0, 1.0, 1.0, 1.0)


def unfadeColor():
    if is_RPi:
        player.getOverlay('rpifade').set(alpha=0.0)


def playmovie(args=None):
    player.play(args[0]) if args else player.play()


player.on(['/synctest'], syncTest)
player.on(['/fullsynctest'], fullSyncTest)
player.on(['/ipregie'], setIpRegie)

player.on(['/playmovie'], playmovie)
player.on(['/loadmovie'], lambda args: player.load(args[0]))
player.on(['/attime'], lambda args: player.seekTo(args[0]))
player.on(['/stopmovie'], player.stop)
player.on(['/unpause'], player.resume)

player.on(['/fade'], fadeColor)
player.on(['/unfade'], unfadeColor)

# RUN
hplayer.setBasePath(["/data/media", "/mnt/usb"])  # Media base path
hplayer.persistentSettings(
    "/data/hplayer2-kxkm.cfg")  # Path to persitent config
hplayer.run()
Esempio n. 2
0
from time import sleep
from core.engine import hplayer

# PLAYER
player = hplayer.addplayer('mpv', 'looper-chrd')

# INTERFACES
player.addInterface('http2', 80)

# RUN
hplayer.setBasePath(["/data/media"])
hplayer.persistentSettings("/data/hplayer2-chrd.cfg")
hplayer.run()
Esempio n. 3
0
# PLAYER
player = hplayer.addplayer('mpv', network.get_hostname())
player.doLog['events'] = True
player.doLog['cmds'] = True

# Interfaces
player.addInterface('http', 8080)
player.addInterface('http2', 80)
player.addInterface('serial', "^CP2102")

# SERIAL USB
player.on(['RELOOP'], lambda: player.play("loop*.*"))

# PATH
hplayer.setBasePath(["/mnt/usb"])
hplayer.persistentSettings("/data/hplayer2-flipper.cfg")


# DISABLE automations
def disableAuto(settings):
    player.loop(False)
    player.autoplay(False)
    player.clear()


player.on(['settings-applied'], disableAuto)

# RUN
hplayer.run()
Esempio n. 4
0
from core.engine import hplayer

# PLAYER
player = hplayer.addplayer('mpv', 'myPlayer')

# Interfaces
player.addInterface('osc', 4000, 4001)
player.addInterface('http2', 8080)
# player.addInterface('gpio', [20])

# Example event: HTTP + GPIO events
# player.on(['push1', 'gpio20'], lambda : player.play('media.mp4'))

# RUN
hplayer.setBasePath("/home/mgr/Videos")
hplayer.persistentSettings("/home/mgr/hplayer2.cfg")
hplayer.run()
Esempio n. 5
0
# GPIO on+off
player.on(['turn1', 'gpio26'], lambda state: superDebounce("1_*.*", 1000))


# GPIO RF Remote
def togglePlay():
    if player.isPlaying(): player.stop()
    else: doPlay("0_*.*")


player.on(['remote', 'gpio14-on', 'gpio15-on'], togglePlay)

# PATH
hplayer.setBasePath("/data/media")
hplayer.persistentSettings("/data/hplayer2-gadagne19.cfg")


# DISABLE automations
def disableAuto(settings):
    player.loop(False)
    player.autoplay(False)
    player.clear()


player.on(['settings-applied'], disableAuto)

# SETTINGS (pre-start)
player.imagetime(15)

# RUN