Kivy演示视频播放器在Win732 Python 3.4.4 Kivy 1.9.1中不工作,无错误消息

2024-04-26 11:56:31 发布

您现在位置:Python中文网/ 问答频道 /正文

I have been spending the day trying to get the demo video player to work. I have tried different types of videos and the default Softboy. It looks fine loading, shows the matching picture, and no error messages. Clicking on the start arrow it tuns into a spinner and it spins forever. It has not crashed , I can click on audio on of (but no sound) and start-stop. It works normally, just no video playing and no audio. The videos play fine on my PC.
I have spent decades writing embedded assembly code but Python & Kivy are new to me and the learning curve is painful.

import kivy
kivy.require('1.2.0')

from sys import argv
from os.path import dirname, join
from kivy.app import App
from kivy.uix.videoplayer import VideoPlayer

class VideoPlayerApp(App):

    def build(self):
        if len(argv) > 1:
            filename = argv[1]
        else:
            curdir = dirname(__file__)
#            filename = ('Vid_Demon.avi')
#            filename = ('Vid_Wire.mp4')
#            filename = ('Vid_Archer.mov')
#            filename = ('Vid_Bowl.mp4')
#            filename = ('Softboy.mpg')
            filename = ('Softboy.avi')

        return VideoPlayer(source=filename, state='play')

if __name__ == '__main__':
    VideoPlayerApp().run()

Tags: andthetonofromimportonhave