LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to make mplayer automatically switch videos like media player? (https://www.linuxquestions.org/questions/linux-software-2/how-to-make-mplayer-automatically-switch-videos-like-media-player-234505/)

_UnPrEdictAbLe_ 09-23-2004 06:21 PM

How to make mplayer automatically switch videos like media player?
 
Hi,

I am using FC2 with KDE and mplayer 1.0pre5.

I have configured to play all video files by mplayer on a double click.
(apparently, gmplayer doesnt work on my pc)

so i wanted to know if there is a way if mplayer can automatically switch the video file being played if i double click on some other file while mplayer is still playing a video, just like Windows Media Player can.

And I wanted to know if there is a way to create an event for
"double clicking video toggles full screen"....also similar to WMP.

Please dont get annoyed by me quoting WMP. I know that in the playing capability, mplayer is better, but I just wanted to make these handy features available for me in Linux.

regards
unpredictable

Tinkster 09-23-2004 07:20 PM

If you run mplayer without the GUI you'd probably need
to write a little wrapper-script that kills potential previous
instances of mplayer to achieve stopping the first video
on starting the next. Something like
wmp.sh
Code:

#!/bin/bash
skill -2 mplayer
mplayer -fs $1

should do the trick, including the full-screen. (not tested).

Mplayer doesn't have mouse-bindings for the
double-click, though.


Cheers,
Tink

_UnPrEdictAbLe_ 09-23-2004 08:39 PM

thanks...


i will try the script thing....

i guess i will b able to achieve the effect i wanted with the shell script thing...
(why didnt tht occur to me ?? kill and restart.. :D)

but i dont know how to make the mouse thing work?? do you know of how to write a script for the mouse thing???

regards
unpredictable.

_UnPrEdictAbLe_ 09-23-2004 09:29 PM

Hi

i tried the script....i works fine...but there is a little problem........

when ever there is a space or a dot or a bracket in the filename or its path....

the reason being...whenever the shell encounters a backslash....it considers it as a different parameter..

so is there a way to tell it that the thing with spaces and the dots and the brackets and the backslashes is ONE filename and not different parameters??


regards
unpredictable

Tinkster 09-24-2004 04:38 PM

Put the $1 in quotes ...

"$1"


Cheers,
Tink

_UnPrEdictAbLe_ 09-24-2004 11:35 PM

Hi

I made that work....u need to change the variable called IFS which holds the delimeter..

i just saved it in a temp variable, executed my command and restored it...

Code:

temp=$IFS
IFS=$'\n'
mplayer $1
IFS=$temp

anyway...is there a way to start the mplayer as "Always on top"....even if the command is KDE specific it would do...

regards
unpredictable

deviousubb 09-27-2004 01:44 AM

Full screen = typing f in the terminal running mplayer.
Always on Top = typing T in the terminal.

_UnPrEdictAbLe_ 09-27-2004 03:11 AM

No no....i know how will it be done manually...

i wanted to know if in the command line arguments i could specify...


All times are GMT -5. The time now is 05:04 PM.