Kodi Community Forum

Full Version: How to play video from my list
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi, Everybody of XBMC Forum

This is my first post.

i have problem, i want create script for play video from my list video.

Example
my list
1. A
2. B
3. C

Now, my script can play video A,Next i want it to play video A,B,C and repeat A,B,C again.

I don't known it. i must do at python file or XML file

p.s. I am not good at English. Sorry for any wrong sentence composition which may occur.
Help me please -_-!
1) queue the videos
2) enable loop
3) start the playlist
How to?
please suggest me, i must write script what?
queue videos using 'q'.
hit space to go to the playlist.
player controls in the lhs menu.
start the video.
Oh thanks for your answer it's have useful for me...
but sorry again how to write script Python or XML file for play continue video in playlist A B and C..

Thx so much
Hope u answer me soon
and sorry if i'm mistake about grammar or vocabulary cause i'm don't know much about english ^^,
the player controls in the left hand side menu has an option to loop playlists.
Code:
import xbmc,xbmcgui
import os

CWD = os.getcwd()
print CWD
__language__ = xbmc.Language(CWD).getLocalizedString
print xbmc.getLanguage()
ACTION_EXIT_SCRIPT      = (9, 10)

class MainGUI(xbmcgui.WindowXML):
        def __init__(self,*args,**kwargs):
                xbmcgui.WindowXML.__init__(self)
        file = 'D:\ManU-Chel.ts'
        xbmc.Player().play(file, '', 1)
        #file2 = 'D:\Manchester.United.VS.Newcastle][August.16,2010].mpg'

        
        def onInit(self):
                pass
        def onAction(self,action):
                if (action in ACTION_EXIT_SCRIPT):
                        self.close()
        def onClick(self,controlId):
                pass
        def onFocus(self,controlId):
                pass

if __name__ == '__main__':
        ui = MainGUI("main.xml",CWD)
        ui.doModal()
        del ui

this is my script for play file "ManU-Chel.ts" until finish. After that, i need continue to play file "Manchester.United.VS.Newcastle][August.16,2010].mpg" immediate.

this code!!! How to script code to play automatic video without click to play....

Hope You answer me soon!!!
okay, so you DO want to use a script no matter Smile i thought you wanted to avoid it.

use executebuiltin('xbmc.playercontrol(repeatall)') to enable playlist looping.
use the python functions to build the playlist with the files, then play the playlist.
thanks for your answer.

i will try to do it.
Code:
import xbmc,xbmcgui
import os

CWD = os.getcwd()
print CWD
__language__ = xbmc.Language(CWD).getLocalizedString
print xbmc.getLanguage()
ACTION_EXIT_SCRIPT      = (9, 10)

class MainGUI(xbmcgui.WindowXML):
        def __init__(self,*args,**kwargs):
                xbmcgui.WindowXML.__init__(self)
        
        playList=xbmc.PlayList(1)
        playList.clear()

        listitem = xbmcgui.ListItem('Man u 1',
        thumbnailImage='D:\man_u_logo2_2.gif')
        url = 'D:\ManU-Chel.ts'
        playList.add(url, listitem)

        listitem = xbmcgui.ListItem('Man u 2',
        thumbnailImage='D:\t90111.gif')
        url = 'D:\Manchester.United.VS.Newcastle][August.16,2010].mpg'
        playList.add(url, listitem)

        xbmc.Player().play(playList,'', 1)
        
        
        def onInit(self):
                pass
        def onAction(self,action):
                if (action in ACTION_EXIT_SCRIPT):
                        self.close()
        def onClick(self,controlId):
                pass
        def onFocus(self,controlId):
                pass

if __name__ == '__main__':
        ui = MainGUI("main.xml",CWD)
        ui.doModal()
        del ui

Now, my script makes video A, B, C can play continue but it don't repeat all.

Image

from this picture, I set it follow picture. it can repeat all video.

But i'd like video can repeat all with my script only. Don't click in XBMC program like this picture.

How to edit script code automatically repeat all in my playlist.
help me, please
i have already given you the answer.
How to?
You help Explain with me.please
spiff Wrote:okay, so you DO want to use a script no matter Smile i thought you wanted to avoid it.

use ***executebuiltin('xbmc.playercontrol(repeatall)')*** to enable playlist looping.
use the python functions to build the playlist with the files, then play the playlist.

* added to highlight............
Pages: 1 2