If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
pepe_ugalde
Posts: 64
Registered: ‎09-10-2012
My Device: Developer
My Carrier: AMX
Accepted Solution

HLS (HTTP Live Streaming) with SSL

Hi guys

 

Could someone give me any hints/pointers?

 

We've tested HLS with and without AES and both work on BB10.

Then we tested with SSL and the device seems to use/send no certificates.

 

If we have our own SSL certificate, how can we use it through the MediaPlayer or WebView?

 

Regards,

Pepe

Please use plain text.
BlackBerry Development Advisor (Retired)
s_rashid
Posts: 127
Registered: ‎02-27-2012
My Device: Bold
My Carrier: Rogers

Re: HLS (HTTP Live Streaming) with SSL

 

Hello,

 

The Cascades MediaPlayer API currently doesn't allow this functionality. However, you should be able to achieve this if you use the C mm-renderer API instead (the Cascades MediaPlayer API is a wrapper around the C mm-renderer API). This does mean you will have to do some more code set up and handling in C (instead of QML/Qt/C++) so, just for reference, I am pasting some useful links for reference:


* You can check out the funtion : mmr_context_parameters()  - look for all the parameters that you can pass (e.g. OPT_SSL_VERIFYPEER)

Link: https://developer.blackberry.com/native/reference/bb10/mmrenderer_libref/topic/mmr_api/mmr_context_p...


* Overview links of mm-renderer:

https://developer.blackberry.com/native/reference/bb10/mmrenderer_libref/topic/about.html

 

* One sample app which shows the set up mm-renderer contexts: 

https://github.com/blackberry/NDK-Samples/tree/master/VideoPlayback

(note that it doesn't use the mm-renderer event queue to listen to status updates here; but you should use that, instead of BPS event queue)

 

Cheers,

Rashid 

Please use plain text.
Developer
pepe_ugalde
Posts: 64
Registered: ‎09-10-2012
My Device: Developer
My Carrier: AMX

Re: HLS (HTTP Live Streaming) with SSL

Thanks a lot :smileyhappy:

 

I'll check those links. I'm relatively new to C++, so I'm guessing it'll take some time to understand those C functions.

Meanwhile, I'll keep advancing on the UI.

 

Can I send you a PM?

 

Regards,

Pepe

 

Please use plain text.
BlackBerry Development Advisor (Retired)
s_rashid
Posts: 127
Registered: ‎02-27-2012
My Device: Bold
My Carrier: Rogers

Re: HLS (HTTP Live Streaming) with SSL

Sure. PM me if you want; I'll try to reply or help whenever possible.

 

In terms of using C mm-renderer API and making it work with Cascades UI components, you would have to wrap them into Qt/C++ functions; listen to mm-renderer event queue (in C API) and send out the Qt signals to your UI logic, where you can update the UI accordingly (for example: switching between Play/Pause button, updating the progress bar). If you face any specific problems doing that, feel free to open up other forum questions.

Don't forget to "Accept as Solution" to one of the posts here, if this particular question has been answered (helps others focus their efforts into giving or taking answers).

 

Thanks,

Rashid

Please use plain text.
Developer
pepe_ugalde
Posts: 64
Registered: ‎09-10-2012
My Device: Developer
My Carrier: AMX

Re: HLS (HTTP Live Streaming) with SSL

I'm stuck...

 

If I load an .m3u8 movie in the browser, it displays fine. It doesn't require an SSL handshake. (I can't post test links because they are the client's :/ )

 

However, if I attempt to load it from a C app with mmr, the following happens:

 

	if (mmr_input_attach(mmr_context, media_file, "autolist") != 0) {
		printMMRError(mmr_context); //-- this uses mmr_error_info() to print the errors
		return EXIT_FAILURE;
	}

 

If I use "autolist" and "track" in the function, I get this error code:

1 = MMR_ERROR_UNKNOWN and an errno 48 (not supported)


If I use "playlist", I get error code:

5 = MMR_ERROR_UNSUPPORTED_MEDIA_TYPE  and an mmf error 4047, which I can't find anywhere

 

So either way the video is not displayed in the app, but it works in the browser.

 

Any pointers? Maybe I'm not giving enough details, but 'my brain hurts' right now. I'm adapting code from the VideoPlayback sample and at this point, I'm not even attempting to use SSL; I'll post some doubts later in this same thread.

 

Thanks,

Pepe

Please use plain text.
Developer
pepe_ugalde
Posts: 64
Registered: ‎09-10-2012
My Device: Developer
My Carrier: AMX

Re: HLS (HTTP Live Streaming) with SSL

[ Edited ]

Another update

 

We discovered the errno 48 (unsupported format) was appearing because the server that hosts the video streams is filtering user-agents.

The BB10 Browser uses BB10; Touch, which is allowed in the server. The MMR uses io-media, which is not allowed.

By using mmr_context_parameters() we were able to use the BB10 Browser´s user agent, so we were able to stream a movie without SSL.

 

Now the next step is streaming with SSL.

 

Here's the next wall stopping us:

In the mmr_context_parameters() documentation there is a list of parameters that map to libcurl options, including OPT_SSL_VERIFYPEER, as Rashid said earlier, but it does not include OPT_SSLCERTTYPE nor OPT_SSLCERT, which I believe is what we need to send the certificate to the server.

 

We used curl with the BB10 Browser user-agent and a PEM certificate and we were able to download chunks of the stream, so the certificate and user-agent combination does work.

 

BUT then we tried using OPT_SSLCERTTYPE and OPT_SSLCERT with the same certificate and user-agent string in mmr_context_parameters() but we're still getting an error, so I suppose OPT_SSLCERTTYPE and OPT_SSLCERT really don't exist.

 

Is there another way or workaround?

 

Regards

Pepe

 

 

Please use plain text.
Developer
pepe_ugalde
Posts: 64
Registered: ‎09-10-2012
My Device: Developer
My Carrier: AMX

Re: HLS (HTTP Live Streaming) with SSL

Can anyone please help me with this?

 

I need to use mmr_context_parameters() with the OPT_SSLCERTTYPE and OPT_SSLCERT parameters.

 

Also, I'dif it's possible to use .p12 and not just .pem

I found this page http://curl.haxx.se/mail/lib-2005-03/0172.html which says it's possible but it's from 2005 and I don't know if that version of libcurl is the same.

 

Regards

Pepe

Please use plain text.