title: how can I get image to show on roku video player
body: <p>I'm trying to get a image to show on roku video player while the video is playing but it does not work. here is my code:</p>
  
  <pre><code>function player(video_id as String,stream as String,streamTitle as String,subtitle_url as String,position as String)
  
      print "play: "+stream
      p = CreateObject("roMessagePort")
      video = CreateObject("roVideoScreen")
      video.setMessagePort(p)
  
      videoclip = CreateObject("roAssociativeArray")
      videoclip.StreamBitrates = [0]
      videoclip.StreamUrls = [stream]
  
      di = CreateObject("roDeviceInfo")
      if di.GetDisplayType() = "HDTV" then 
          videoclip.streamqualities=["HD"]
      else
          videoclip.streamqualities=["SD"]
      end if
  
      videoclip.PlayStart=position.toint()
  
      videoclip.StreamFormat = "hls"
      videoclip.switchingstrategy="full-adaptation"
      videoclip.Title = streamTitle
      if subtitle_url&lt;&gt;invalid
          videoclip.SubtitleUrl = subtitle_url
      end if
  
      lastSavedPos   = 0
      statusInterval = 10
      nowpos=0
  
  
      video.SetPositionNotificationPeriod(10)
      video.SetContent(videoclip)
      video.show()
      showImageCanvas()
      while true
          msg = wait(0, video.GetMessagePort())
          if type(msg) = "roVideoScreenEvent"
              if msg.isScreenClosed() then 'ScreenClosed event
                  return "incomplete"
                  exit while                
              else if msg.isFullResult()
                  SetXtraData(video_id,"0")
                  return "completed"
              else if msg.isResumed()
                  SetXtraData(video_id,nowpos.tostr())
              else if msg.isPlaybackPosition() then
  
                  nowpos = msg.GetIndex()
                  if nowpos &gt; 120
                      if abs(nowpos - lastSavedPos) &gt; statusInterval
                          lastSavedPos = nowpos
                          SetXtraData(video_id,nowpos.tostr())               
                      end if
                  end if
              else if msg.isRequestFailed()
                  showMessage("Information","Something went wrong while we tried to play the video")
              else
                  print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
                   showImageCanvas()
              endif
          end if
      end while
  end function
  
  
  
  
  
  Sub showImageCanvas()
      canvasItems = [
          { 
              url:"http://www.rd.com/wp-content/uploads/sites/2/2016/04/01-cat-wants-to-tell-you-laptop.jpg"
              TargetRect:{x:189,y:300,w:100,h:100}
          }
      ]
  
     canvas = CreateObject("roImageCanvas")
     port = CreateObject("roMessagePort")
     canvas.SetMessagePort(port)
     'Set opaque background
     'canvas.SetLayer(0, {Color:"#FF000000", CompositionMode:"Source"})
     canvas.SetRequireAllImagesToDraw(true)
     canvas.SetLayer(1, canvasItems)
     canvas.Show()
     while(true)
         msg = wait(0,port)
         if type(msg) = "roImageCanvasEvent" then
             if (msg.isRemoteKeyPressed()) then
                 i = msg.GetIndex()
                 print "Key Pressed - " ; msg.GetIndex()
                 if (i = 2) then
                     ' Up - Close the screen.
                     canvas.close()
                 end if
             else if (msg.isScreenClosed()) then
                 print "Closed"
                 return
             end if
         end if
     end while
  End Sub
  </code></pre>
  
  <p>I keep placing this <code>showImageCanvas()</code> everywhere to try and get it to work, but it does not work. Please help.</p>