Guest User

Untitled

a guest
Jan 6th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. def createMultipleButton(self, dt):
  2. root = Widget()
  3. size_y=150;
  4. size_x=150;
  5.  
  6. for i in range(1):
  7. folderList = os.listdir(picture_path)
  8. if len(folderList)==0:
  9. time.sleep(1)
  10. break
  11. fileList = os.listdir(picture_path)
  12. print fileList
  13.  
  14. for file in fileList:
  15.  
  16. x = (picture_path+"/"+file)
  17.  
  18. 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)
  19. button.bind(on_release=lambda btn:self.VideoContainer(str(file))
  20.  
  21.  
  22. print file
  23. self.scrollview.content_layout.add_widget(button)
  24.  
  25.  
  26. def VideoContainer(self,name):
  27.  
  28. mylist=name.split('.')
  29. video = VideoPlayer(source="/home/linux/kivyFiles/kivyLogin/videoAssets/"+mylist[0]+".mp4", play=True)
  30. video.allow_stretch=True
  31. video.size=(500,500)
  32. video.pos=(400,400)
  33. self.add_widget(video)
Add Comment
Please, Sign In to add comment