Forum Discussion

Helaman's avatar
Helaman
Channel Surfer
2 years ago

roVideoPlayer SetContentList function not working

This may seem like a super basic question, but I just can't figure it out! πŸ˜‚

One the app I am creating I am using a basic Video xml element to play a given video, however I need to be able to check to see if I get a 404 when trying to play a video. The problem lies in the fact that the Video object will just repeatedly request a video from my server even if it only gets 404s back.

So, I decided to swap to a `roVideoPlayer` object instead since it gives me more control and can hopefully tell me what the response code of the given video is, that way I can have the player stop playing and display an error message if it gets a 404. The problem is that I just CAN NOT get the `SetContentList` function working! No matter how many different combinations of arrays, associative arrays, etc. I try, it just tells me that "Interface not a member of BrightScript Component". I've checked the 3+ sources of documentation and scoured the forum, but I just can't figure it out. As far as I know, it's supposed to be an array of `roAssociativeArray`s, and each associative array contains the details of a video to be played.

My code has been multiple different variations of this, but never works:

```video = { Title: "Video Title", Stream: { url: videoUrl }, StreamFormat: "mp4" } videoPlayer.SetContentList([video])```

Alternatively, if there is a way to check if a Video SceneGraph element fails to play a video due to a 404 error being returned from the server, that would solve the original problem.

 

Thank you for your help πŸ™‚

9 Replies

  • renojim's avatar
    renojim
    Community Streaming Expert

    Is there a reason why you're using SetContentList and not just SetContent?

    For a video node, do you have an observer on the "state" of the video node?  It should fire on any error.

    • Helaman's avatar
      Helaman
      Channel Surfer

      SetContentList is the function mentioned in the documentation, although I have tried SetContent. In terms of observing the state of the Video player, I can observe that it is buffering, playing, paused, etc. my problem is that I can't detect if its getting a 404 when trying to buffer a non-existent video.

      Thank you for help btw

      • renojim's avatar
        renojim
        Community Streaming Expert

        I don't know why your "state" observer isn't working.  I tried setting the URL to a nonexistent video on my server and my server returned a 404, my "state" observer fired, GetData() returned "error". and my video node "errorCode" was set to 404.

        Edit:  "errorCode" is set to -1.  "errorStr" shows the 404.