content: ' Main entry point for the Put.io Roku Channel
  sub Main(args as Dynamic)
      ' Initialize the screen and create the main scene
      screen = CreateObject("roSGScreen")
      m.port = CreateObject("roMessagePort")
      screen.setMessagePort(m.port)
      
      ' Create the main scene
      scene = screen.CreateScene("MainScene")
      screen.show()
      
      ' Pass launch arguments to the scene
      if args <> invalid and args.DoesExist("contentId")
          scene.contentId = args.contentId
      end if
      
      ' Main event loop
      while(true)
          msg = wait(0, m.port)
          msgType = type(msg)
          
          if msgType = "roSGScreenEvent"
              if msg.isScreenClosed() then return
          end if
      end while
  end sub
  