-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0bdfda
commit 906d5de
Showing
4 changed files
with
117 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
local white = Color.new(255,255,255) | ||
|
||
-- Init video device | ||
Video.init() | ||
|
||
-- Loading and starting our video file | ||
Video.open("ux0:/data/lpp-vita/samples/Video/video.mp4") | ||
Video.openSubs("ux0:/data/lpp-vita/samples/Video/video.vtt") | ||
|
||
local modes = { | ||
NORMAL_MODE, | ||
FAST_FORWARD_2X_MODE, | ||
FAST_FORWARD_4X_MODE, | ||
FAST_FORWARD_8X_MODE, | ||
FAST_FORWARD_16X_MODE, | ||
FAST_FORWARD_32X_MODE | ||
} | ||
|
||
local mode_idx = 1 | ||
local oldpad = 0 | ||
|
||
-- Main loop | ||
while true do | ||
|
||
-- Blend instructions | ||
Graphics.initBlend() | ||
Screen.clear() | ||
frame = Video.getOutput() | ||
if frame ~= 0 then | ||
w = Graphics.getImageWidth(frame) | ||
h = Graphics.getImageHeight(frame) | ||
Graphics.setImageFilters(frame, FILTER_LINEAR, FILTER_LINEAR) | ||
Graphics.drawScaleImage(0, 0, frame, 960 / w, 544 / h) | ||
end | ||
Graphics.debugPrint(20, 20, "Time (ms): " .. Video.getTime(), Color.new(255, 255, 255)) | ||
Graphics.debugPrint(20, 40, "Speed: x" .. modes[mode_idx] / 100, Color.new(255, 255, 255)) | ||
Graphics.debugPrint(20, 500, Video.getSubs(), Color.new(255, 255, 255)) | ||
Graphics.termBlend() | ||
Screen.waitVblankStart() | ||
Screen.flip() | ||
|
||
-- Check for input | ||
local pad = Controls.read() | ||
if Controls.check(pad, SCE_CTRL_CIRCLE) and Video.isPlaying() then | ||
Video.pause() | ||
elseif Controls.check(pad, SCE_CTRL_SQUARE) and not Video.isPlaying() then | ||
Video.resume() | ||
elseif Controls.check(pad, SCE_CTRL_TRIANGLE) then | ||
Video.close() | ||
break | ||
elseif Controls.check(pad, SCE_CTRL_LTRIGGER) and not Controls.check(oldpad, SCE_CTRL_LTRIGGER) then | ||
mode_idx = mode_idx - 1 | ||
if mode_idx < 1 then | ||
mode_idx = 1 | ||
end | ||
Video.setPlayMode(modes[mode_idx]) | ||
elseif Controls.check(pad, SCE_CTRL_RTRIGGER) and not Controls.check(oldpad, SCE_CTRL_RTRIGGER) then | ||
mode_idx = mode_idx + 1 | ||
if mode_idx > #modes then | ||
mode_idx = #modes | ||
end | ||
Video.setPlayMode(modes[mode_idx]) | ||
elseif Controls.check(pad, SCE_CTRL_LEFT) and not Controls.check(oldpad, SCE_CTRL_LEFT) then | ||
local cur_time = Video.getTime() | ||
jump_time = cur_time - 10000 | ||
if jump_time < 0 then | ||
jump_time = 0 | ||
end | ||
Video.jumpToTime(jump_time) | ||
elseif Controls.check(pad, SCE_CTRL_RIGHT) and not Controls.check(oldpad, SCE_CTRL_RIGHT) then | ||
Video.jumpToTime(Video.getTime() + 10000) | ||
end | ||
|
||
oldpad = pad | ||
end |
Binary file not shown.
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,40 @@ | ||
WEBVTT | ||
00:02.170 --> 00:04.136 | ||
Emo, close your eyes | ||
|
||
00:04.136 --> 00:05.597 | ||
Why? | ||
NOW! | ||
|
||
00:05.597 --> 00:07.405 | ||
Ok | ||
|
||
00:07.405 --> 00:08.803 | ||
Good | ||
|
||
00:08.803 --> 00:11.541 | ||
What do you see at your left side Emo? | ||
|
||
00:11.541 --> 00:13.287 | ||
Well? | ||
|
||
00:13.287 --> 00:16.110 | ||
Er nothing? | ||
Really? | ||
|
||
00:16.110 --> 00:18.514 | ||
No, nothing at all! | ||
|
||
00:18.514 --> 00:22.669 | ||
Really? and at your right? What do you see at your right side Emo? | ||
|
||
00:22.669 --> 00:26.111 | ||
Umm, the same Proog | ||
|
||
00:26.111 --> 00:28.646 | ||
Exactly the same! Nothing! | ||
|
||
00:28.646 --> 00:30.794 | ||
Great | ||
|
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