I am trying to create a video playing app to be run on an single board computer (specifically an OrangePi One/PC using armbian). I have been having issues creating smooth video with the ffpyplayer, the videoplayer used by kivy.
Due to this I have decided to simply run the app which generates button controls in front of the video and attempt to make the background of the app clear so that both the video and kivy buttons are visible. as recommended in the linked post : Kivy Video Player is not working on Raspberry 3B+
I have seen a similar thing done in: https://github.com/kivy/kivy/pull/5252 I am testing the programs on a windows computer before uploading to the single board computers and I have been unable to successfully create a blank background. I have been mainly trying to modify the .kv file however I am unable to find any settings that can adjust to create the desired result.
For simplicity sake I am uploading a shorter code which is layed out in the exact same way as my main code:
Kivy code: my.kv
#:kivy 1.0
<MyGrid>
background_color: 0, 0, 0, 0 # only creates a black colour
#opacity: 0.5 #just affects the widgets not the background
canvas.before:
Color:
rgba: 0, 0, 0, 1
Rectangle:
pos: self.pos
size: self.size
#variable name: ID
name: name #declare global variables
email: email
GridLayout:
cols:1
size: root.width-200, root.height-200 #make the widget fit the screen and then minus a border from it
pos: 100, 100 #offset the position to compensate for the boarder
GridLayout:
cols: 2
Label:
text: "Name: "
TextInput:
id: name
multiline:False
Label:
text: "email: "
TextInput:
id: email
multiline: False
Button:
text: "submit"
on_press: root.btn() #if there was an event. ie button was pressed
Python code:
import kivy
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.uix.textinput import TextInput
from kivy.network.urlrequest import UrlRequest
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty
from kivy.core.window import Window
class MyGrid(Widget): #creates apps layout and contents
#declaire global variables to pass to and from .kv file. note the variables names must be the same between the 2 files
name = ObjectProperty(None) #initialise as none and then after reading the .kv file it will populate it
email = ObjectProperty(None)
def btn(self): #function btn which occurs. it needs to be in here
print ("name: ", self.name.text, " email: ", self.email.text)
self.name.text = ""
self.email.text = ""
class MyApp(App): #creates the app
def build(self):
return MyGrid()
if __name__ == '__main__': #runs the app
MyApp().run()
The attached photo shows the app running with the video using ffpyplayer and is more or less the end goal. The objective is that the green colour would be the desktop. Example Image.
any guidance would be hugely appreciated!