Start Video as Overlay and not in Fullscreen?
#1
Hi all,

I'm want to start a video out of a python script in overlay mode and not in Fullscrren.
Is there a command to start the videoplayer windowed?
At this time i have a bad hack around:

Catch the onPlaybackstarted event and then wait until the player.getTime is 2sec., then send the screen toggle command "xbmc.executehttpapi("Action(18)")"
So it happens, that the player goes fullscreen for about 2seconds an the changes into overlay mode. This is not really nice Wink

Is there a better way to start in overlay mode?

There is although an other problem:

Always when I change from Fullscreen back to the scriptwindow the onInit() Event from the Scriptwindow is called. And after the windowchange the "ScriptWindow" List is empty. This is realy bad for me, because my queryresult is hold in the WindowList. After a videoplayback the list is empty ;-(

Is there a solution for this problem?

Thanks,

Sebastian
Reply
#2
yes and no.

there is an advancedsetting for toggling this behaviour on and off. that is not really a solution to this problem, but it is something a patch could be based on.

as for the second issue, this is not really an issue. a script is a window in itself, so it makes sense that the gui is reinited when we change windows. you would have to save the state somehow and reupdate..
Reply
#3
a patch would be great. But I think that the XBMC-Team has no priority on a patch like this.

But a feature like starting videoplayback windowed could be helpfull for a lot of Internet Streaming Apps like Youtube streaming and so on.
I've greated a small youtube script and the content looks so ugly in Fullscreen but it looks nice in an overlay window. Than you can also show some extra data during the Playback...

Sebastian
Reply
#4
I'm just trying to implement the patch by my self, but I still think about the concept to do this.

When I set the value of
Code:
g_advancedSettings.m_fullScreenOnMovieStart = false;
the player starts the next video in overlay mode.

So everything seems fine, but how to set the player back into the default value? (m_fullScreenOnMovieStart = true) Since the player has its on thread I can't set the value of m_fullScreenOnMovieStart back during the python player call.

So at the moment I think about a few ways to solve this:

Make a extra function which sets the the m_fullScreenOnMovieStart to false at begin of the script and set it back at the End of the script. Is the script crashing all next player calls will start in overlay until a restart of xbmc.

or

make a new boolean for CApplication:TonguelayFile the python script will set it (start in overlay) and the CApplication:TonguelayFile will reset it after playback start.

Can anyone give me a hint what a good solution would be?

Thanks!

Sebastian
Reply
#5
separate function would be bad, the problem is what if a scripter sets it false, and doesn't reset it.

if somehow you could set it as an option in xbmc.Player().Play() that it would need to reset itself when playing stopped.

but have you tried just activating your script window after playing starts. then if you have a window.xml script. make sure you have allowoverlays enabled or maybe havea control like this. not sure if it will work though.

Quote:
<control type="videowindow">
<posx>200</posx>
<posy>200</posy>
<width>250</width>
<height>250</height>
</control>
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#6
yes the separate function is bad (but the easiest wayWink)...

When you use a window.xml scipt you can use the VideoOverlay control (without any setters and getters out of the script but just as defined in the xml). But you are not able to catch the right moment to activate the scriptwindow again.
When you e.g. try to stream a video from the internet you fire xbmc.Player().Play() the player starts buffering the stream. Then the Player fires onPlayBackStarted() (i haven't found out when the player fires this exactly) but he is still buffering and when you open a window in that moment the player will change to fullscreen after buffering is finished.
To handle this i think about the patch.....
Reply
#7
Ther'es the Player.Caching visibility condition.

But i like the idea of being able to start a video minimized.

But i would recommend against a method that requires the scripter to reset the setting.

about the <control type="videowindow">, it should set auto, but i don't know if it will work.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#8
I have submitted a patch through Trac. See this Ticket for details: http://trac.xbmc.org/ticket/5624

You can now use the xbmc.PLayer().play(url,playlist,windowed) boolean option to start a video windowed.
If this optional Argument is set true the player will start windowed. If it is false the player starts fullscreen.

Please look over the coding style. I have insert a new Variable in settings.h and insert this in the Application.cpp Playerfunction as a condition for fullscreen equal to the advanced fullscreen option...

Sebastian
Reply
#9
nice, will have a play
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#10
works good, here is a quick example of using the "videowindow" allowoverlays is still enabled, so you see the minimized video, but works good.

i need to change the python method, so will probably get it in tomorrow.

good job.

Image
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply

Logout Mark Read Team Forum Stats Members Help
Start Video as Overlay and not in Fullscreen?0