Guest User

Untitled

a guest
Jan 7th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import browser
  2. from browser import html, document
  3.  
  4. aa = document['main']
  5.  
  6. videotag = html.VIDEO(id='video', width='320', height='240')
  7. aa.html = ""
  8. aa <= videotag
  9.  
  10. from javascript import JSObject
  11. createUrl = JSObject(window.URL.createObjectURL)
  12.  
  13. def OnSuccess(stream):
  14. video = document['video']
  15. video.src = createUrl(stream)
  16. video.play()
  17.  
  18. browser.window.navigator.mediaDevices.getUserMedia(
  19. {"video": True, "audio": False}
  20. ).then(OnSuccess)
Add Comment
Please, Sign In to add comment