@@ -42,13 +42,14 @@ Used by the following scripts:
4242
4343# used by usage() in lib/utils.sh
4444# shellcheck disable=SC2034
45- usage_args=" <video_file>"
45+ usage_args=" <video_file> [<player_specific_commandline_options>] "
4646
4747help_usage " $@ "
4848
49- num_args 1 " $@ "
49+ min_args 1 " $@ "
5050
5151video=" $1 "
52+ shift || :
5253
5354# Will be tried in this order
5455linux_commands=(
@@ -69,16 +70,19 @@ if is_mac; then
6970 if [ -z " ${PLAY_VIDEO:- } " ]; then
7071 opts+=(" --pause=yes" )
7172 fi
73+ if [ -z " ${BACKGROUND_VIDEO:- } " ]; then
74+ opts+=(" --focus-on=never" )
75+ fi
7276 fi
73- " $DEFAULT_VIDEO_PLAYER " " ${opts[@]} " -- " $video " &
77+ " $DEFAULT_VIDEO_PLAYER " " ${opts[@]} " " $@ " -- " $video " &
7478 else
7579 if [ -n " ${BACKGROUND_VIDEO:- } " ]; then
7680 opts+=(-g)
7781 fi
7882 if [ -n " ${DEFAULT_VIDEO_PLAYER:- } " ]; then
7983 opts+=(-a " $DEFAULT_VIDEO_PLAYER " )
8084 fi
81- open " ${opts[@]} " " $video "
85+ open " ${opts[@]} " " $@ " " $ video"
8286 if [ -n " ${PLAY_VIDEO:- } " ]; then
8387 osascript -e " tell application \" ${DEFAULT_VIDEO_PLAYER:- QuickTime Player} \" to play document 1"
8488 fi
@@ -88,7 +92,7 @@ else # assume Linux
8892 for linux_command in " ${linux_commands[@]} " ; do
8993 if type -P " $linux_command " & > /dev/null; then
9094 found=1
91- " $linux_command " -- " $video " &
95+ " $linux_command " " $@ " -- " $video " &
9296 break
9397 fi
9498 done
0 commit comments