mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 08:21:59 +02:00
examples: Start playback after assembling app window
This is the correct order of how things should be done, so teach what is right
This commit is contained in:
@@ -24,9 +24,6 @@ def on_activate(app):
|
||||
# more than simply inverting fullscreen on the whole window).
|
||||
video.connect('toggle-fullscreen', on_toggle_fullscreen, win)
|
||||
|
||||
# Enable autoplay
|
||||
video.props.player.set_autoplay(True)
|
||||
|
||||
# Create and add media for playback. First added media item to empty
|
||||
# playback queue will be automatically selected.
|
||||
item = Clapper.MediaItem(uri='http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4')
|
||||
@@ -37,6 +34,9 @@ def on_activate(app):
|
||||
win.set_child(video)
|
||||
win.present()
|
||||
|
||||
# Start playback
|
||||
video.props.player.play()
|
||||
|
||||
# Create a new application
|
||||
app = Adw.Application(application_id='com.example.ClapperSimple')
|
||||
app.connect('activate', on_activate)
|
||||
|
Reference in New Issue
Block a user