Skip to content

Commit

Permalink
Fix video playback block screensaver (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberproton authored Aug 15, 2023
1 parent 02a270c commit 1626562
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/player/video_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ def __init__(self, width, height):
Gtk.DrawingArea.__init__(self)

# Spawn a VLC instance and create a new media player to embed.
self.instance = vlc.Instance()
# Some options need to be specified when instantiating VLC.
# --no-disable-screensaver: Allow screensaver.
vlc_options = ["--no-disable-screensaver"]
self.instance = vlc.Instance(vlc_options)
self.player = self.instance.media_player_new()

def handle_embed(*args):
Expand Down Expand Up @@ -344,8 +347,6 @@ def data_source(self, data_source):
cause the program to stop playback if it's left on for a very long time.
"""
media.add_option("input-repeat=65535")
# Allow screensaver (screen blank) if playback is paused.
media.add_option("no-disable-screensaver")
# Prevent awful ear-rape with multiple instances.
if not monitor.is_primary():
media.add_option("no-audio")
Expand All @@ -364,7 +365,6 @@ def data_source(self, data_source):
for monitor, window in self.windows.items():
media = window.media_new(video_url)
media.add_option("input-repeat=65535")
media.add_option("no-disable-screensaver")
window.set_media(media)
if monitor.is_primary():
window.add_audio_track(audio_url)
Expand Down

0 comments on commit 1626562

Please sign in to comment.