I have followed a YouTube video to try to play video in my app, however, it kept failed.
The error is like that:

The link of the YouTube video :
https://www.youtube.com/watch?v=nNrBAE39MS0
--Declare the visible width and height of the video \_W = display.viewableContentWidth \_H = display.viewableContentHeight local background = display.newRect(0, 0, \_W, \_H) background:setFillColor(255,255,255) local Button ={}; Button.new = function(params) local btn = display.newGroup(); local offIMG = params and params.off or ""; local onIMG = params and params.on or ""; local off = display.newImageRect(offIMG, 120, 120); local on = display.newImageRect(onIMG, 120, 120); on.alpha = 0 ; btn:insert(off); btn:insert(on); btn.x = params and params.x or 0; btn.y = params and params.y or 0; function btn:touch(e) if(e.phase == "began") then on.alpha = 1; display.getCurrentStage():setFocus(self); self.hasFocus = true; elseif(self.hasFocus) then if (e.phase == "ended") then --execute the callback function, if present if (params) then if (params.callback) then params.callback(e); end end on.alpha = 0; display.getCurrentStage():setFocus(nil); self.hasFocus = false; end end end btn:addEventListener("touch",btn); return btn; end --end Button class declaration local videoButton = Button.new({ off = "images/playVideo.png", on = "images/playVideoOver.png", x = \_W \* 0.5, y = \_H \* 0.5, callback = function(e) media.playVideo( "rainbow\_loom.mp4" ,true, function(e) print("Video ended"); end) end })
Please help. Thanks so much!