Peace Unto You! Thank you, even with the adjustments, and with me making a build of the game and trying to run it on my it doesn’t work. Even with the code updates when I run my game on my iOS it’s just a black screen
Also there’s no zip link that’s apparent like in the other link so how am I supposed to use the website version?
Edit:. Okay I fixed my game to match how the example version is. I have the bundle resources right and everything. Now I’m just working on the code to make sure the code works. Still having issues with it. I see now to make this work I have to mimic the example code, and when I did my ipa file size went from 56mb to 200mb so that lets me know the video is now in the game, but now I’m having issues with playing the video. Since I have a mainmenu collection and a main collection, I need help getting the right code. Ima run some tests, but what is the right approach?
NEW EDIT: YAAAAAAY I FIXED IT!!! So one of the reasons it wasn’t showing was my video file was named “INTRO”, but my script said it was called “intro”. Here’s the script that plays the video in the beginning of the game like an intro cutscene. Simply change the id to whatever your video is.
local function log(msg)
print(msg)
end
local function video_callback(self, video, event, data)
log(string.format("VIDEO CALLBACK: video %d evt: %d ", video, event))
if event == videoplayer.VIDEO_EVENT_READY then
log("videoplayer.VIDEO_EVENT_READY")
videoplayer.start(video)
elseif event == videoplayer.VIDEO_EVENT_FINISHED then
log("videoplayer.VIDEO_EVENT_FINISHED")
video_end(self, video)
elseif event == videoplayer.VIDEO_EVENT_FAILED then
log("videoplayer.VIDEO_EVENT_FAILED")
else
log("Unexpected event")
end
end
function video_begin(self)
if videoplayer then
log("Loading...")
local videos = {"intro.mp4"} -- Ensure this matches your file name exactly
self.video = videoplayer.create(videos[1], {play_sound = true}, video_callback)
log(self.video)
else
log("Could not initialize fullscreen videoplayer (on this platform?)")
end
if self.video == nil then
log("Can't create another video")
video_end(self, self.video)
end
end
function video_end(self, video)
log("Video playback ended")
if video ~= nil then
log("Calling videoplayer.destroy", video)
videoplayer.destroy(video)
end
self.video = nil
end
function init(self)
[msg.post](http://msg.post/)(".", "acquire_input_focus")
self.video = nil
self.tick = 1
video_begin(self) -- Start the video as soon as the game initializes
end