diff --git a/README.md b/README.md index 9a5bbb0..12b4108 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,9 @@ brew tap Roshan-R/termv https://github.com/Roshan-R/homebrew-termv brew install termv ``` +### Android +For Android users with [termux](https://termux.org/) and [mpv-android](https://github.com/mpv-android/mpv-android) installed, it is possible to direct install to a folder in the path + ### Installation by cloning the repository ```sh diff --git a/termv b/termv index 2a5469b..f425d8f 100755 --- a/termv +++ b/termv @@ -84,7 +84,9 @@ update_channelsfile() { } # check if necessary programs are installed -for prog in mpv fzf jq curl gawk; do +DEPENDENCIES="fzf jq curl gawk" +[ "$(uname -o)" != "Android" ] && DEPENDENCIES="mpv ${DEPENDENCIES}" +for prog in ${DEPENDENCIES}; do ! has "$prog" && dependencies_not_installed="${dependencies_not_installed}${prog}, " done @@ -139,6 +141,8 @@ _play() { # shellcheck disable=SC2086 mpv "${*##* }" ${TERMV_MPV_FLAGS} --force-media-title="${*%% *}" --force-window=immediate xdo show "$WID" && xdo activate "$WID" + elif [ "$(uname -o)" == "Android" ]; then + am start -n is.xyz.mpv/is.xyz.mpv.MPVActivity -e filepath "${*##* }" else # shellcheck disable=SC2086 mpv "${*##* }" ${TERMV_MPV_FLAGS} --force-media-title="${*%% *}"