Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
squirreltown
Roku Guru

Dropbox https

trying to play a video from Dropbox in the customvideoplayer example in the SDK
I know i need to put the cert somewhere. Is this the right place?:
	
this.player.SetMessagePort(this.port)
this.player.SetLoop(true)
this.player.SetPositionNotificationPeriod(1)
this.player.SetDestinationRect(this.layout.left)
this.player.SetCertificatesFile("common:/certs/ca-bundle.crt")
this.player.InitClientCertificates()
this.player.SetCertificatesDepth(3)

this.player.SetContentList([{

Stream: { url: "https://www.dropbox.com/s/5sf90bps47yd009/flexiflyer.mp4" }
StreamFormat: "mp4"
SwitchingStrategy: "full-adaptation"
}])

this.player.Play()


return this
End Sub


Here is the error showing in the debugger:
11, 0: startup progress
11, 66: startup progress
11, 0: Service does not support range requests.
11, 132: startup progress
9,-1: There was an error in the HTTP response. This could mean that malformed HTTP headers or an HTTP error code was returned.
16, 0: Playback completed.
11, 0: end of playlist


Thanks
Kinetics Screensavers
0 Kudos
2 REPLIES 2
RokuChris
Roku Employee
Roku Employee

Re: Dropbox https

I don't think the cert is the problem. The clue is this line:

11, 0: Service does not support range requests.


Videos must be hosted on servers that support range requests.

But in this case it's a bit more involved. The URL you're using does not point directly to an mp4 file. As best I can tell, it points to an HTML page, but sometimes will get redirected to the actual mp4 depending on the user-agent header you send with the request. Below are two curl requests to your URL. One gets redirected and one doesn't. And I was able to play the video using the URL that the second one redirects to, but I just copy/pasted

You might be able to set a custom user-agent on your roVideoScreen to get it to work. Or you might have to find a way to resolve that redirect manually in BrightScript before passing it to the video screen. In the latter case a good place to start might be roURLTansfer's HEAD request capabilities: http://sdkdocs.roku.com/display/sdkdoc/ ... dasDynamic

curl --user-agent "Roku" --head "https://www.dropbox.com/s/5sf90bps47yd009/flexiflyer.mp4"
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 29 May 2013 00:07:02 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
set-cookie: locale=en; expires=Mon, 28 May 2018 00:07:02 GMT; Path=/
set-cookie: gvc=Mjk4Mjg0MzQ4ODMwNzU5OTA4NzgzMzIyNjY1NDY2MzA0MzE4MjU2; expires=Mon, 28 May 2018 00:07:02 GMT; Path=/; httponly
set-cookie: t=Dq--a7UOc74bYH2wZT7sjgIr; Domain=dropbox.com; expires=Fri, 28 Jun 2013 00:07:02 GMT; Path=/; secure; httponly
strict-transport-security: max-age=2592000; includeSubDomains
x-server-response-time: 94
x-dropbox-request-id: c05e15a1c206f836
pragma: no-cache
cache-control: no-cache
x-dropbox-http-protocol: None
x-frame-options: SAMEORIGIN
X-RequestId: 1ed88dd864195fa8800591b9da6f5a4a

curl --head "https://www.dropbox.com/s/5sf90bps47yd009/flexiflyer.mp4"
HTTP/1.1 302 FOUND
Server: nginx
Date: Wed, 29 May 2013 00:07:17 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
set-cookie: locale=en; expires=Mon, 28 May 2018 00:07:17 GMT; Path=/
set-cookie: gvc=MTA0NDIzOTM0MDE5MjQ3Mjc4OTI4NzY2MjM0OTAwNTg3MzY2NTQ0; expires=Mon, 28 May 2018 00:07:17 GMT; Path=/; httponly
set-cookie: t=XncbJQep7QIcFVoUKzvKVjNP; Domain=dropbox.com; expires=Fri, 28 Jun 2013 00:07:17 GMT; Path=/; secure; httponly
strict-transport-security: max-age=2592000; includeSubDomains
location: https://dl.dropboxusercontent.com/s/5sf90bps47yd009/flexiflyer.mp4?token_hash=AAEbGaE8V7PKk99a4LdlRDe8S8YS0HsSKIqEMMqtTys_Rw
pragma: no-cache
cache-control: no-cache
x-dropbox-http-protocol: None
x-frame-options: SAMEORIGIN
x-dropbox-request-id: 56fa4500a5551724
X-RequestId: 9196d9a413f4d89b376b51909055d568
0 Kudos
squirreltown
Roku Guru

Re: Dropbox https

Thank you very much Chris, I wouldn't have figured any of that out.
I'll get on it.
Kinetics Screensavers
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.