Video playlist playing in windowed mode automatically switches to full screen
#1
Hello fellow devs,

I'm writing a script addon to play a video playlist within a video window that covers only a portion of the screen, while the rest of the screen is used to disk play dynamic information about the current video.

I've used a WindowXML skin file to define a video window control that covers only a portion of the screen. I'm successfully able to start playing the video playlist within this window by first creating a playlist composed of listiems (videos) and playing it with xbmc.Player().play(playlist, windowed=True).

However, when the player moves to the next item in the playlist, it switches to full screen mode automatically.

I'm looking for a way to stop that switch from happening and playing every subsequent item in the windowed mode as well. Any help will be appreciated.

P.S. - Kodi version 17.6. Tested this behaviour on OSML on Pi, LibreELEC on Pi and LibreELEC on ODROID C2. Will soon test on Kodi running on a Mac.
Reply
#2
Hello again,

I tried this on a Mac as well, and I get the same result...

So I start playing a playlist inside of a video window (which is smaller than the screen size), but as soon as the player moves to the next item on the playlist it switches to fullscreen.

@FernetMenta Is it possible that I may have found another minor bug? (after: https://forum.kodi.tv/showthread.php?tid=328797)

Or it may also be that the Video Window Control wasn't made for this purpose?

Thanks in advance!
Reply
#3
I can't reproduce. I created a video playlist by queuing some files. Then played it and left fullscreen. It did not switch to fullscreen when the next file was played.
Reply
#4
perhaps the Debug Log will reveal some clues.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
@ronie @FernetMenta 

Extremely sorry for the delayed response. I've been trying to debug this problem, however, even after getting familiar with the debug log file, my efforts to try and decipher it to figure why the video goes to full screen are not leading anywhere.

Here's my code for the addon and the debug file. I hope someone may be able to help me with debugging this behaviour.

Here's a link to the debug file: https://paste.ubuntu.com/p/5tKy6pVJhK/

You can search for "script-healthedplayer.xml" for the relevant lines logging the initialization and de-initialization of the window (with small video window) in question.

xmml:

<?xml version="1.0" encoding="UTF-8"?>
<window>
<controls>
<control type="image" id="1">
</control>
<control type="videowindow" id="2">
<left>214</left>
<top>0</top>
<width>1066</width>
<height>600</height>
</control>
</controls>
</window>

python:

import os
import time
import xbmc
import xbmcaddon
import xbmcgui
ADDON = xbmcaddon.Addon()
CWD = ADDON.getAddonInfo('path').decode('utf-8')
sideImgSrc = '/Users/raunaq/Pictures/sidebar2.png'
bottomImgSrc = '/Users/raunaq/Pictures/bottom-fill.png'
bottomImg2Src = '/Users/raunaq/Pictures/bottom-fill2.png'
_basePath = "/Users/raunaq/Google Drive/Work/Main/HealthEd Media/Research/Point Of Care Marketing/Waiting Room Screen/Content/Maternal/Coursera/Nutrition and Lifestyle in Pregrnancy/Week 2/"

class HEMPlaylist(xbmc.PlayList):
    def __init__(self, n):
        xbmc.PlayList.__init__(self, n)
        self.listData =

    def getPosition(self):
        return self.getposition()

    def setSchedule(self, src):
        names = [name for name in sorted(os.listdir(src)) if not name.startswith('.')]
        for name in names:
            itemPath = os.path.join(src, name)
            listitem = xbmcgui.ListItem()
            listitem.setInfo('video', {
                'path': '{0}/{1}.mp4'.format(itemPath, name)
            })
            listitem.setSubtitles(['{0}/{1}.vtt'.format(itemPath, name)])
            listitem.setProperty('IsPlayable', 'true')
            self.add('{0}/{1}.mp4'.format(itemPath, name), listitem)

class HEMPlayer(xbmc.Player):
    def __init__(self):
        xbmc.Player.__init__(self)
        self.headingControl = None

    def addControl(self, control):
        self.headingControl = control

    def onPlayBackStarted(self):
        xbmc.log('onPlayBackStarted: {0}'.format(playlist.getPosition()))
        self.headingControl.setLabel('TESTING...')

    def onPlayBackStopped(self):
        xbmc.log('onPlayBackStopped: {0}'.format(playlist.getPosition()))

    def onPlayBackEnded(self):
        xbmc.log('onPlayBackEnded: {0}'.format(playlist.getPosition()))

class GUI(xbmcgui.WindowXML):
    def onInit(self):
        self.width = 1280
        self.height = 720
        # sidebar
        bottomBarHeight = 120
        sidebarWidth = 214
        self.sidebar = self.getControl(1)
        self.sidebar.setPosition(0, 0)
        self.sidebar.setWidth(sidebarWidth)
        self.sidebar.setHeight(self.height)
        self.sidebar.setImage(sideImgSrc)
        # bottomBar
        self.bottomBar = xbmcgui.ControlImage(
        x=sidebarWidth,
        y=self.height - bottomBarHeight,
        width=self.width - sidebarWidth,
        height=bottomBarHeight,
        filename=bottomImgSrc
        )
        self.addControl(self.bottomBar)
        # heading label
        self.heading = xbmcgui.ControlLabel(
        x=sidebarWidth + 6,
        y=self.height - bottomBarHeight + 6,
        width=600,
        height=60,
        label='',
        font='font60'
        )
        self.addControl(self.heading)
        player.addControl(self.heading)

    def onAction(self, action):
        xbmc.log('ACTION: %s ' % action.getId())


playlist = HEMPlaylist(0)
playlist.setSchedule(_basePath)
player = HEMPlayer()
ui = GUI('script-healthedplayer.xml', CWD, 'default', '720p')
player.play(
    item=playlist,
    windowed=True
)
ui.doModal()
player.stop()
del playlist
del ui


I apologize again for the delayed response and appreciate everyone who replied. Any help from anyone is appreciated.

Just trying to figure how to play the entire playlist in the window I have defined with the small video window within it (without it switching to fullscreen while playing the next video).
Reply

Logout Mark Read Team Forum Stats Members Help
Video playlist playing in windowed mode automatically switches to full screen0