Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def createMultipleButton(self, dt):
- root = Widget()
- size_y=150;
- size_x=150;
- for i in range(1):
- folderList = os.listdir(picture_path)
- if len(folderList)==0:
- time.sleep(1)
- break
- fileList = os.listdir(picture_path)
- print fileList
- for file in fileList:
- x = (picture_path+"/"+file)
- button = Button(id=str(file),text="" + str(file),size_hint=(None, None),height=size_y,width=size_x, pos_hint={'x': 0, 'y': 1},background_normal=x)
- button.bind(on_release=lambda btn:self.VideoContainer(str(file))
- print file
- self.scrollview.content_layout.add_widget(button)
- def VideoContainer(self,name):
- mylist=name.split('.')
- video = VideoPlayer(source="/home/linux/kivyFiles/kivyLogin/videoAssets/"+mylist[0]+".mp4", play=True)
- video.allow_stretch=True
- video.size=(500,500)
- video.pos=(400,400)
- self.add_widget(video)
Add Comment
Please, Sign In to add comment