Created
April 16, 2020 21:16
-
-
Save AndyObtiva/2ed89f4f9c3288e65e470a32173558ef to your computer and use it in GitHub Desktop.
Glimmer Video Widget Observers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
def display_video_status(video, status) | |
message_box = MessageBox.new(video.swt_widget.getShell) | |
message_box.setText(status) | |
message = "Video Position: #{video.position} seconds\n" | |
message += "Video Duration: #{video.duration} seconds" | |
message_box.setMessage(message) | |
message_box.open | |
end | |
@shell = shell { | |
minimum_size 800, 500 | |
@video = video(file: video_file, background: :black) { | |
on_playing { | |
display_video_status(@video, 'Playing') | |
} | |
on_paused { | |
display_video_status(@video, 'Paused') | |
} | |
on_ended { | |
display_video_status(@video, 'Ended') | |
} | |
} | |
} | |
@shell.open |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment