Skip to content

Instantly share code, notes, and snippets.

@matham
Created October 5, 2015 18:32
Show Gist options
  • Save matham/f17bd8e04cdf045bee85 to your computer and use it in GitHub Desktop.
Save matham/f17bd8e04cdf045bee85 to your computer and use it in GitHub Desktop.
from kivy.lang import Builder
from kivy.app import runTouchApp
from kivy.clock import Clock
kv = '''
VideoGrid
<VideoGrid@BoxLayout>:
source: r'G:\\Python\\dev2\\kivy27\\examples\\widgets\\softboy.mpg'
state: 'stop'
tiled: False
Video:
source: root.source
state: root.state
opacity: 0 if root.tiled else 1
GridLayout:
cols: 4
rows: 4
Video:
source: root.source
state: root.state
Video:
source: root.source
state: root.state
Video:
source: root.source
state: root.state
Video:
source: root.source
state: root.state
Video:
source: root.source
state: root.state
Video:
source: root.source
state: root.state
Video:
source: root.source
state: root.state
Video:
source: root.source
state: root.state
Video:
source: root.source
state: root.state
Video:
source: root.source
state: root.state
Video:
source: root.source
state: root.state
Video:
source: root.source
state: root.state'''
root = Builder.load_string(kv)
Clock.schedule_once(lambda dt: root.setter('state')(root, 'play'), 5)
runTouchApp(root)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment