Browse Source

#812 code review

Falko Schindler 2 năm trước cách đây
mục cha
commit
e0d2f4f152
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      website/more_documentation/video_documentation.py

+ 2 - 2
website/more_documentation/video_documentation.py

@@ -9,11 +9,11 @@ def main_demo() -> None:
 
 def more() -> None:
     @text_demo('Video start position', '''
-        This demo shows how to use javascript to set the start position of a video.
+        This demo shows how to use JavaScript to set the start position of a video.
     ''')
     def advanced_usage() -> None:
         async def set_time(_):
-            await ui.run_javascript(f'document.getElementById({v.id}).currentTime = 5;', respond=False)
+            await ui.run_javascript(f'getElement({v.id}).$el.currentTime = 5;', respond=False)
 
         v = ui.video('https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4')
         v.on('loadedmetadata', set_time)