Commit fbd86482 authored by Ahmed Hendawy's avatar Ahmed Hendawy
Browse files

add the loop checklist property

parent c155ee97
......@@ -19,6 +19,8 @@ class YouTubePlayer:
def on_start(self):
''' [Optional] Called at the beginning when the block starts. '''
self.loop=self.get_property("loop")
self.url = self.get_property('URL')
self.framerate = self.get_property('FrameRate')
......@@ -58,7 +60,10 @@ class YouTubePlayer:
image = from_ndarray(frame, header)
self.publish('output_image',image)
else:
while(not self.loop):
time.sleep(0.5)
self.cap = cv2.VideoCapture("/video.mp4")
time_to_sleep = 1/self.framerate - (time.time() - start)
if time_to_sleep > 0:
......@@ -76,6 +81,9 @@ class YouTubePlayer:
if 'FrameRate' in affected_properties:
self.framerate = self.get_property('FrameRate')
if 'loop' in affected_properties:
self.loop=self.get_property('loop')
if 'URL' in affected_properties:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment