Page 1 of 1

show and hide video-window

Posted: 27 Jul 2006 13:12
by DonBilbo
hello. I'm developing a skin for vlc but I've got a problem now. Is it possible to show or hide video-window by pressing a button.
For example I want to make the video visible if they press the "Play-Button" an let it hide by pressing the "Stop-Button".

Thanks.
DonBilbo

Posted: 27 Jul 2006 15:08
by ipkiss
Sure. Several existing skins do that already.
Extract from the doc:
  • WindowID.show(): Show the Window whose id attribute is 'WindowID'.
  • WindowID.hide(): Hide the Window whose id attribute is 'WindowID'.
And you can chain several actions using ';' as a delimiter.


Note that in the particular case of the video window, there may be a better solution, using the vlc.hasVout boolean variable. So the video window could simply have the visible="vlc.hasVout" attribute...

how to use the boolean variable

Posted: 28 Jul 2006 02:17
by DonBilbo
hello ipkiss.
I suppose that I didn`t explain my problem exactly.
the command: "windowID.show()" is for windows I have build on my own, for example the playlist-window.
But this video-screen is a special option (a black screen) where you can watch the videos. The command for it:
<Video width="..." height="..." x="..." y="..." id="..." />
At the moment this window is always visible eventhoug when I write in the code:
visible="false" or visible="vlc.hasVout"
I want to make this video-screen visible when I press the play-button and hide it when I press the stop-button.

I hope you have understood it. Sorry for my english :-)

PS.: I didn't understand the variable vlc.hasVout. How do I use and where do I have to type it (in the action for play-button???). what does it mean.

Posted: 28 Jul 2006 08:52
by ipkiss
the command: "windowID.show()" is for windows I have build on my own, for example the playlist-window.
But this video-screen is a special option (a black screen) where you can watch the videos. The command for it:
<Video width="..." height="..." x="..." y="..." id="..." />
If you used the Video control, you have necessarily created a window yourself, so you can use windowID.show().
At the moment this window is always visible eventhoug when I write in the code:
visible="false" or visible="vlc.hasVout"
Strange. What is your version of VLC?
PS.: I didn't understand the variable vlc.hasVout. How do I use and where do I have to type it (in the action for play-button???). what does it mean.
Some tag attributes (such as 'visible') require a 'boolean expression', i.e. an expression that can evaluate to true or false (even though the resulting value can change, depending on the context). 'vlc.hasVout' is such an expression: it evaluates to true when there is a video output running, and to false otherwise. The list of boolean expressions can be found there: http://www.videolan.org/vlc/skins2-create.html#boolexpr

Posted: 28 Jul 2006 13:29
by Asim
At the moment this window is always visible eventhoug when I write in the code:
visible="false" or visible="vlc.hasVout"
Strange. What is your version of VLC?

i've had that problem w/ VLC 0.8.5

even though my skin is set to "hide" the video when it stops.. that does not happen.

it was working with one of the 0.8.5 betas pre-april 26th..... but it does not work any more with the final 0.8.5 itself...

Posted: 28 Jul 2006 20:28
by DonBilbo
I'm using vlc 0.8.4a.

Posted: 28 Jul 2006 20:38
by DonBilbo
But even with the newest version, I downloaded yesterday, it doesn't work.
I wrote the code in the command:

Code: Select all

<Video width="..." .... visible="vlc.hasVout" />

Posted: 29 Jul 2006 07:23
by DJ
Could this have something to do with it?

viewtopic.php?t=24241

Posted: 29 Jul 2006 16:38
by ipkiss
The 'visible' attribute is for the Window tag, not the Video one.

Posted: 29 Jul 2006 19:37
by DonBilbo
i'm not talking about the video in a self-made window.
Huhhhh. How can I explain it ????

first:
+------------------------------------+
| _ x |
| +------------------------+ |
| | | |
| | Informatoin | |
| | | |
| | | |
| +------------------------+ |
| |<< << (>) >> >>| | <- menu
+-----------------------------------+

This is my main-window. In this window I want to watch the movies. When I start Vlc, I want this information to be visible. It is not in a separate window. It is drawn in the the main-window.

later:
+------------------------------------+
| _ x |
| +------------------------+ |
| | | |
| | running_video | |
| | | |
| | | |
| +------------------------+ |
| |<< << (>) >> >>| | <- menu
+-----------------------------------+

So, when I hit the Play-button (>), I want the play-screen to appear infront of these information and hide them. The play-screen is also not a separate window. You can show it with the command:
<Video width="..." .... />

The advantage is, that my play-screen is always moving with my mainwindow. If my play-screen would be on a separate window, it wouldn't go with the main-window.

Hope you'll understand it now :-)

Posted: 29 Jul 2006 19:41
by DonBilbo
first:
+---------------------------------------+
| ............................................ _ x|
|.... +------------------------+ |........|
| ....| .................................|....... |
| ....| .........Informatoin...... |....... |
| ....| .................................|....... |
| ....| .................................|....... |
| ....+------------------------+ |........|
| ......|<< << (>) >> >>| ............|....... <- menu
+--------------------------------------+

later:
+---------------------------------------+
| ............................................ _ x|
|.... +-------------------------+........|
| ....| .................................|....... |
| ....| ........running............. |....... |
| ....| .........movie...............|....... |
| ....| .................................|....... |
| ....+--------------------------+........|
| ......|<< << (>) >> >>| ............|....... <- menu
+--------------------------------------+

Posted: 30 Jul 2006 01:15
by Asim
i believe you're basically saying this:


When there is no video playing, and the video is in the same window as the play button, then there should be now black video bar displaying. e.g. if your background is white... then there should be no black bars around where the video is supposed to be. the black bars should be "hidden"

however, once you press play, the video window should appear again... does that sound right?

if so, i believe ipkiss has answered it by saying there is no "visible" attribute for the video element... which kinda sucks

- Asim

Posted: 30 Jul 2006 13:10
by ipkiss
if so, i believe ipkiss has answered it by saying there is no "visible" attribute for the video element... which kinda sucks
In fact, there _is_ a 'visible' attribute for the Video tag (see "Attributes common to all the controls" in the doc). So i was wong in my previous post, and what you are trying to do should work.

I hope to have some time to look at all the reported problems concerning the Video control next week...

Posted: 01 Aug 2006 22:46
by DonBilbo
Thanks for the answers.

@ @$im: thats exactly what I wanted to explain with my little images :-)

@ ipkiss:
In fact, there _is_ a 'visible' attribute for the Video tag (see "Attributes common to all the controls" in the doc). So i was wong in my previous post, and what you are trying to do should work.
yes but how. How can I make the video bar visible or hide it????

Posted: 02 Aug 2006 08:36
by ipkiss
Currently, i think that your only option is to wait for a bug fix :-)

Posted: 02 Aug 2006 11:53
by DonBilbo
o.k. then. Thanks for the ansewers.
I think I'll leave this option :-)