native.newVideo(): table index is nil

Hi.

I’m trying to play remote video: (Solar2D Documentation — API Reference | Libraries | native | newVideo)

My solar2d is newest, (2024.3703) my system is Linux Mint 19.3

I get error:

ERROR: Runtime error
/root/parts/solar2d/src/platform/resources/init.lua:988: table index is nil
stack traceback:
	/root/parts/solar2d/src/platform/resources/init.lua:988: in function 'newVideo'
	/home/michal/Documents/Solar2D Projects/AppTV/main.lua:9: in main chunk

Theres code: (error means 1’st line [newVideo()])

local video = native.newVideo( display.contentCenterX, display.contentCenterY, 640, 360 )
  
local function videoListener( event )
    print( "Event phase: " .. event.phase )
  
    if event.errorCode then
        native.showAlert( "Error!", event.errorMessage, { "OK" } )
    end
end
  
-- Load a remote video
video:load( "https://coronalabs.com/video/bbb/BigBuckBunny_640x360.m4v", media.RemoteSource )
 
-- Add video event listener 
video:addEventListener( "video", videoListener )
 
-- Play video
video:play()

What can it be? What shall I do?

Thanks
Mike.

In Gotchas, it says “Windows isn’t supported”. My guess is Linux is also not supported. That should explain the error you get on the first line where the API is called.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.