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

Web and WebWorks Development

Reply
Developer
Posts: 124
Registered: ‎07-11-2011
My Device: 8900
My Carrier: Airtel

Playing Video Problem from URL which is UserId and Password Protected

[ Edited ]

Hi All,

 

I am trying to play video hosted at server in blackberry device OS 7(9810). However, it's not getting rendered.

 

Below is sample code which i am trying.

 

Config.xml

<?xml version="1.0" encoding="UTF-8"?>

<widget xmlns="http://www.w3.org/ns/widgets"
        xmlns:rim="http://www.blackberry.com/ns/widgets"
        version="1.0.0.0">  
    <name>Video Test</name>
    <author>My name</author>
    <description>Video Test display</description>
    <icon src="images/icon.png"/>
    <content src="index.html"/>
	<access uri="http://userId:password@10.15..66.4" subdomains="true" />
    <rim:permissions>  
		<rim:permit>access_internet</rim:permit>
        <rim:permit>read_geolocation</rim:permit>
    </rim:permissions>    
</widget>

 

JS function getting called on button click:

function playVideo() { var video = document.createElement('video'); video.src='http://userId:password@10.15..66.4/media/test.mp4'; video.controls = true; document.body.appendChild(video); }

 

Code is working fine with below URL(whitelisted in config):

 

http://video-js.zencoder.com/oceans-clip.mp4

 

But the URL which has to use is userId and password protected and not working.

 

http://userId:password@10.15..66.4/media/test.mp4

 I tried following options for whitelisting:

 

1. http://userIdSmiley Tongueassword@10.15..66.4/media/test.mp4

2. http://userIdSmiley Tongueassword@10.15..66.4

3. http://10.15..66.4

4. http://userIdSmiley Tongueassword@10.15..66.4/media

 

Also, i have tried wihitlisting all URI using * as follows:

<access uri="*" subdomains="true" />

 Also, same code is working fine on Ripple emulator.

 

But didn't get success.

Please help me in getting through this.

 

Thanks in advance.

 

Highlighted
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Playing Video Problem from URL which is UserId and Password Protected

Just noticed this posted didn't get a reply. Sorry about that!

 

I am getting HTTP 206 (partial content) when trying to access that MP4 video.  is that resource still valid?

 

The only thing that stands out to me is the IP address has an extra period in i.  try 10.15.66.4 instead?

 

For this content, I would recommend first trying your content in the browser to make sure everything is streaming okay. Then move on to solving the whitelisting issue.  I'd recommend using the * wildcard character for BBOS (of which only #3 listed above is close to correct).

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.