Skip to content

Commit 5638b16

Browse files
JE-Random-Techwillprice
authored andcommitted
Add set_layer method (#191)
1 parent f1b361f commit 5638b16

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

omxplayer/player.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,17 @@ def set_position(self, position):
574574
self._player_interface.SetPosition(ObjectPath("/not/used"), Int64(position * 1000.0 * 1000))
575575
self.positionEvent(self, position)
576576

577+
@_check_player_is_active
578+
@_from_dbus_type
579+
def set_layer(self, layer):
580+
"""
581+
Set the layer of the Video (default 0). Higher layers are above lower layers
582+
583+
Args:
584+
layer (int): The Layer to switch to.
585+
"""
586+
self._player_interface.SetLayer(Int64(layer))
587+
577588
@_check_player_is_active
578589
@_from_dbus_type
579590
def set_alpha(self, alpha):

tests/unit/test_omxplayer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def test_root_interface_properties(self, popen, sleep, isfile, killpg, atexit, c
6868
['stop', 'Stop', [], []],
6969
['seek', 'Seek', [100], [dbus.Int64(100 * 1e6)]],
7070
['set_position', 'SetPosition', [1], [dbus.ObjectPath("/not/used"), dbus.Int64(1000000)]],
71+
['set_layer', 'SetLayer', [1], [dbus.Int64(1)]],
7172
['list_subtitles', 'ListSubtitles', [], []],
7273
['mute', 'Mute', [], []],
7374
['unmute', 'Unmute', [], []],

0 commit comments

Comments
 (0)