diff --git a/app/tools/media.py b/app/tools/media.py
index 9fad7984..93466aeb 100644
--- a/app/tools/media.py
+++ b/app/tools/media.py
@@ -287,6 +287,10 @@ class VlcPlayer(Player):
widget.add(area)
if sys.platform == "linux":
self._player.set_xwindow(area.get_window().get_xid())
+ elif sys.platform == "darwin":
+ self.set_nso(area)
+ else:
+ log("Video widget initialization error: platform '{}' is not supported. ".format(sys.platform))
def set_nso(self, widget):
""" Used on MacOS to set NSObject.
@@ -307,7 +311,7 @@ class VlcPlayer(Player):
pointer = ctypes.pythonapi.PyCapsule_GetPointer(widget.get_window().__gpointer__, None)
self._player.set_nsobject(get_nsview(pointer))
- def on_drawing_area_draw(self, widget, cr):
+ def on_drawing_area_draw(self, widget, cr):
""" Used for black background drawing in the player drawing area. """
allocation = widget.get_allocation()
cr.set_source_rgb(0, 0, 0)
diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py
index 5d251b68..0f155727 100644
--- a/app/ui/main_app_window.py
+++ b/app/ui/main_app_window.py
@@ -2649,14 +2649,16 @@ class Application(Gtk.Application):
self._playback_window.resize(width, height)
self._playback_window.connect("delete-event", self.on_player_close)
- self._player_prev_button.set_visible(False)
- self._player_next_button.set_visible(False)
box = Gtk.HBox(visible=True, orientation="vertical")
self._player_event_box.reparent(box)
- self._player_box.remove(self._player_tool_bar)
- box.pack_end(self._player_tool_bar, False, False, 0)
- self._playback_window.add(box)
+ if not self._settings.is_darwin or self._settings.stream_lib == "gst":
+ self._player_prev_button.set_visible(False)
+ self._player_next_button.set_visible(False)
+ self._player_box.remove(self._player_tool_bar)
+ box.pack_end(self._player_tool_bar, False, False, 0)
+
+ self._playback_window.add(box)
self._playback_window.set_application(self)
self._playback_window.show()
diff --git a/app/ui/settings_dialog.glade b/app/ui/settings_dialog.glade
index 1e530d97..58c43599 100644
--- a/app/ui/settings_dialog.glade
+++ b/app/ui/settings_dialog.glade
@@ -1997,6 +1997,7 @@ Author: Dmitriy Yefremov
False
True
vlc_lib_button
+
False
@@ -2012,6 +2013,7 @@ Author: Dmitriy Yefremov
False
True
gst_lib_button
+
False
diff --git a/app/ui/settings_dialog.py b/app/ui/settings_dialog.py
index 9563da67..958e0d54 100644
--- a/app/ui/settings_dialog.py
+++ b/app/ui/settings_dialog.py
@@ -613,6 +613,11 @@ class SettingsDialog:
if self._main_stack.get_visible_child_name() != "streaming":
return
+ if self._settings.is_darwin:
+ is_gst = self._gst_lib_button.get_active()
+ self._play_in_built_radio_button.set_sensitive(is_gst)
+ self._play_in_window_radio_button.set_active(not is_gst and self._play_in_built_radio_button.get_active())
+
if button.get_active():
self.show_info_message("Save and restart the program to apply the settings.", Gtk.MessageType.WARNING)
@@ -622,6 +627,9 @@ class SettingsDialog:
self._play_in_window_radio_button.set_active(mode is PlayStreamsMode.WINDOW)
self._get_m3u_radio_button.set_active(mode is PlayStreamsMode.M3U)
+ if self._settings.is_darwin and self._settings.stream_lib != "gst":
+ self._play_in_built_radio_button.set_sensitive(False)
+
def get_play_stream_mode(self):
if self._play_in_built_radio_button.get_active():
return PlayStreamsMode.BUILT_IN