Created
June 30, 2018 15:09
-
-
Save inclement/d546233aee11e2837512e1675f030ea4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import kivy | |
| from kivy.app import App | |
| from kivy.uix.gridlayout import GridLayout | |
| from kivy.uix.button import Button | |
| from kivy.uix.label import Label | |
| from kivy.uix.textinput import TextInput | |
| import socket | |
| import json | |
| class VideoScreen(GridLayout): | |
| def __init__(self, **kwargs): | |
| super(VideoScreen, self).__init__(**kwargs) | |
| self.cols = 1 | |
| myText = "Current Status: Idle" | |
| self.statusInfo = Label(text=myText, markup=True) | |
| self.add_widget(self.statusInfo) | |
| btnStartVideo = Button(text="Turn On") | |
| btnStartVideo.bind(on_press=streamVideo) | |
| self.add_widget(btnStartVideo) | |
| btnEndVideo = Button(text="Turn Off") | |
| btnEndVideo.bind(on_press=endVideo) | |
| self.add_widget(btnEndVideo) | |
| def streamVideo(instance): | |
| print("Turning On") | |
| myText = "Turning On" | |
| self.statusInfo.text=myText | |
| def endVideo(instance): | |
| print("Turning Off") | |
| myText = "Turning Off" | |
| self.statusInfo.text=myText | |
| class MyApp(App): | |
| def build(self): | |
| return VideoScreen() | |
| if __name__ == '__main__': | |
| MyApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment