So I seem to be having an issue with Kivy , I have a video player added into one of my screens. I have setup the video player in the KV file with the code below
Screen:
name: "VideoPlayer"
id: VideoScreen
BoxLayout:
orientation: 'vertical'
VideoPlayer:
id: video_player
allow_stretch: True
size_hint: (1, .9)
source: ''
allow_fullscreen: True
options: {'eos': 'stop'}
keep_ratio: False
player_state: 'play'
Button:
size_hint: (1,.1)
text: "Exit"
on_press:
video_player.state = "stop"
video_player.source = ""
on_release: root.mainmenu()
However the video will not fill the box, it won't stretch when I re size the window it gets to a certain size then stops getting any bigger, as you can see from the screen shot below there is lots of room and the video should take up all that room. But it won't. What am I doing wrong?
EDIT 1::
Its even worse with an m3u8 stream
The allow_stretch
option (or fit_mode
) controls the stretching of the video texture. But those options must be included in the options
dictionary as they are options for the underlying Video
instance. Try changing:
options: {'eos': 'stop'}
to:
options: {'eos': 'stop', 'fit_mode': 'fill'}
Or you could use contain
instead of fill
to maintain aspect ratio.