-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from MrEliptik/video
Implementing ability to play trailer in ogv format using a button #40
- Loading branch information
Showing
8 changed files
with
150 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
extends Node | ||
|
||
signal shortcut_close_game_pressed() | ||
signal game_launched() | ||
signal game_closed() |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
extends VideoStreamPlayer | ||
|
||
class_name VideoPlayer | ||
|
||
@export var timeout_before_play: float = 10.0 | ||
|
||
var game_running: bool = false | ||
|
||
@onready var timer: Timer = Timer.new() | ||
|
||
func _ready() -> void: | ||
SignalBus.game_launched.connect(func(): game_running = true) | ||
SignalBus.game_closed.connect(func(): | ||
game_running = false | ||
#timer.start() | ||
) | ||
|
||
#add_child(timer) | ||
#timer.one_shot = true | ||
#timer.wait_time = timeout_before_play | ||
#timer.start() | ||
#visible = false | ||
# | ||
#timer.timeout.connect(on_timer_timeout) | ||
|
||
func _input(event: InputEvent) -> void: | ||
if game_running or not visible: return | ||
|
||
# Check if any input to stop the player and restart the timer | ||
if event is InputEventMouseButton or event is InputEventJoypadButton \ | ||
or event is InputEventKey: | ||
stop_video() | ||
#timer.start() | ||
# Prevent the rest of the app from reacting to this event | ||
get_viewport().set_input_as_handled() | ||
|
||
func play_video() -> void: | ||
show() | ||
play() | ||
|
||
func stop_video() -> void: | ||
hide() | ||
stop() | ||
|
||
func on_timer_timeout() -> void: | ||
return | ||
if game_running: return | ||
visible = true | ||
play() |
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="CompressedTexture2D" | ||
uid="uid://dr4kg5w8jskhd" | ||
path="res://.godot/imported/play.png-0e338f240fd05097c5b13b1d530d0f46.ctex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://shared/visuals/play.png" | ||
dest_files=["res://.godot/imported/play.png-0e338f240fd05097c5b13b1d530d0f46.ctex"] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/high_quality=false | ||
compress/lossy_quality=0.7 | ||
compress/hdr_compression=1 | ||
compress/normal_map=0 | ||
compress/channel_pack=0 | ||
mipmaps/generate=false | ||
mipmaps/limit=-1 | ||
roughness/mode=0 | ||
roughness/src_normal="" | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/normal_map_invert_y=false | ||
process/hdr_as_srgb=false | ||
process/hdr_clamp_exposure=false | ||
process/size_limit=0 | ||
detect_3d/compress_to=1 |