Forum Discussion

crazeekennee's avatar
crazeekennee
Channel Surfer
2 years ago
Solved

SOLVED: StaticAnalysis Error:: "end of playlist" status message of roAudioPlayerEvent is deprecated.

Hello, hopefully someone can help me here.

I'm developing a Roku app that plays different audio streams, using an Audio node.  When I submit my Beta application for Static Analysis, it always fails with the Error:  "end of playlist" status message of "roAudioPlayerEvent" is deprecated.

I'm confused because I don't use the status message of the Audio node.  My Audio node usage is:

  • creating the Audio node
  • creating and assigning its Content Node
  • reading the player state, so the application can determine appropriate Ui display/features
  • setting the player control field, to stop/start audio playback
  • setting the player content's url field to change stream sources

Why would I be failing the static analysis, and how can I resolve ?

Thank you !

 

 

  • crazeekennee's avatar
    crazeekennee
    2 years ago

    I stumbled upon a fix . .and it wasn't all what I expected.  Here's what i did:

    I copied the entire project to another directory, and started off by making a zipfile with minimal content, uploading to the Roku player, downloading the package file, uploading to the Beta Channel, saving, and running Static Analysis.  As long as I had the image files specified in the manifest, Static Analysis reported zero Errors.  I worked my way up to zipping a complete (and exact) copy of the project, and Static Analysis reported zero errors.

    For comparison, I re-zipped and uploaded a new package file from the original project .. and the error came back again.   Weird, since the projects were exactly the same, built on identical copies of the same source code.

    The only difference were in the names of the zipfiles themselves.  One had a "_2" appended on the end, like project.zip and project_2.zip.  That's it.

    I went back to my original project, changed the zipfile name, re-zipped, uploaded to my Roku, downloaded the Packaged file, uploaded it to my Beta channel .. and it passed Static Analysis.

    So, the workaround is to .. change the name of your zipfile before sideloading on your Roku device ???   I have no idea why it works .. maybe something is cached somewhere, and tied to the zipfile name .. ?

    But, tl;dr .. I'm not seeing any errors on Static Analysis.

    Hopefully this very strange workaround helps someone else down the line.  Back to developing !

10 Replies

  • renojim's avatar
    renojim
    Community Streaming Expert

    You can't use the old roAudioPlayerEvent on an audio node.  It's not clear if you're trying to or not.  Does "roAudioPlayerEvent" and/or "end of playlist" appear in your code?

    • crazeekennee's avatar
      crazeekennee
      Channel Surfer

      Hello renojim,

      Thank you for your response !   No, I am neither using a roAudioPlayerEvent nor does "end of playlist" appear in my code.  That's what's confusing me .. I don't know how I'm triggering this error. 

      Here's where I initialize the Audio node:

      sub initializeAudioPlayer()
          m.constants = getConstants()
          m.audioPlayer = createObject("roSGNode", "Audio")
          m.audioPlayer.id = "AudioPlayer"
          audiocontent = createObject("RoSGNode", "ContentNode")
          m.audioPlayer.content = audiocontent
      end sub

       

      When the user inputs a new control signal (Play/Stop), I read the Audio player state, and use it to determine what signal to send the player:

      if m.audioPlayer.state = m.constants.PLAYER_STATE_STOPPED
         startAudioPlayer()
      end if
      
      ...
      
      if m.audioPlayer.state <> m.constants.PLAYER_STATE_STOPPED
         stopAudioPlayer()
      end if

       

      And I start/stop the player like so:

      sub stopAudioPlayer()
          m.audioPlayer.control = m.constants.PLAYER_CONTROL_STOP
      end sub
      
      sub startAudioPlayer()
          m.audioplayer.content.url = m.currentlyPlayingShow.streamurl
          m.audioPlayer.control = m.constants.PLAYER_CONTROL_PLAY
      end sub
      
      sub toggleAudioPlayer()
          if m.audioPlayer.state = m.constants.PLAYER_STATE_STOPPED
              startAudioPlayer()
          else if m.audioPlayer.state = m.constants.PLAYER_STATE_PLAYING
              stopAudioPlayer()
          end if
      end sub

       

      In one of my UI Logic components, we do Observe the Audio Player state.

      m.audioPlayer.ObserveField("state", "OnAudioPlayerStateChange")

       

      Could the error be triggered by reading m.audioPlayer.state directly or Observing it ?

      Any advice is most welcome !

       

      • renojim's avatar
        renojim
        Community Streaming Expert

        I don't think there's anything wrong with your code.  Doesn't Static Analysis give you the line number and file name where the error occurs?  I don't think Static Analysis is very sophisticated - it just scans your source code looking for certain strings.  I just tried an experiment where all I had to do was add print "end of playlist" to my code and I triggered that error, but it told me exactly where it was.