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
srk2012
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520

How to play a rtsp stream or open a url with browser launcher on BlackBerry devcie/ mobile ?

How to play a rtsp stream or open a url  with browser launcher on BlackBerry devcie/ mobile ?

Developer
SumiGhosh
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380

Re: How to play a rtsp stream or open a url with browser launcher on BlackBerry devcie/ mobile ?

<feature id="blackberry.invoke" />
<feature id="blackberry.invoke.BrowserArguments" />
<feature id="blackberry.identity" />
Add this feature elements in your config files.....

var args = new blackberry.invoke.BrowserArguments('your link');
blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
Developer
srk2012
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520

Re: How to play a rtsp stream or open a url with browser launcher on BlackBerry devcie/ mobile ?

Can I get any sampe full code/ application   to launch a browser to open a url etc.

 

 

Iam going thru the  last reply of your too.

Developer
srk2012
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520

Re: How to play a rtsp stream or open a url with browser launcher on BlackBerry devcie/ mobile ?

Hi SumiGhosh,

 

 

Please check my index.html and config.xml  andcorrect it  to launch  my url.

 

 

 

index.html

 

 

 

 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,
user-scalable=no">
<title>Hello World</title>
</head>
<body>
<p>Hello World!</p>
</body>
</html>

 

 

 

 

 

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" rim:header="WebWorks Sample">
<name>Hello World</name>
<description>This is HelloWorld.</description>
<feature id="blackberry.invoke" />
<feature id="blackberry.invoke.BrowserArguments" />
<feature id="blackberry.identity" />
var args = new blackberry.invoke.BrowserArguments('www.yahoo.com');
blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
<content src="index.html"/>
</widget>

 

 

 

 

 

Developer
SumiGhosh
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380

Re: How to play a rtsp stream or open a url with browser launcher on BlackBerry devcie/ mobile ?

index.html

 

 

 

 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,
user-scalable=no">
<title>Hello World</title>

<script>

function toBrowser(){

var args = new blackberry.invoke.BrowserArguments('www.yahoo.com');
blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);

}

</script>
</head>
<body>
<p onClick="toBrowser()" >Yahoo</p>
</body>
</html>

 

 

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" rim:header="WebWorks Sample">
<name>Hello World</name>
<description>This is HelloWorld.</description>
<feature id="blackberry.invoke" />
<feature id="blackberry.invoke.BrowserArguments" />
<feature id="blackberry.identity" />

<access uri="http://www.yahoo.com/" subdomains="true" />
<access uri="*" subdomains="true" />


<content src="index.html"/>
</widget>

 

Just check this and let me know the result.....

 

Developer
srk2012
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520

Re: How to play a rtsp stream or open a url with browser launcher on BlackBerry devcie/ mobile ?

I think we are very close to the output.   When I make the said changes and check on the eemulator.

 

 

Iam finding the "Yahoo" text on the screen when I click on the Yahoo nothing is hsappening.

 

 

Iam sending you the screnshot of it.

 

BbScreenshot

Developer
srk2012
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520

Re: How to play a rtsp stream or open a url with browser launcher on BlackBerry devcie/ mobile ?

Success after clicking on the text yahoo on the emulator screen.Iam able to see or open the www.yahoo.com  home page.

 

 

 

Now  in the same way Can I open the  rtsp stream  or play a rtsp stream  ?

Developer
srk2012
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520

Re: How to play a rtsp stream or open a url with browser launcher on BlackBerry devcie/ mobile ?

screenshotBB.jpg

Developer
SumiGhosh
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380

Re: How to play a rtsp stream or open a url with browser launcher on BlackBerry devcie/ mobile ?

Yeah ofcourse it is possible...... just replace the yahoo url with the rtsp url and whitelist the same in configuration file...... the browser automatically calls the player and plays you the video................
Developer
srk2012
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520

Re: How to play a rtsp stream or open a url with browser launcher on BlackBerry devcie/ mobile ?

[ Edited ]

I played to play the  video by replacing the url   with rstsp link but   I got the follwoing error.

 

 

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" rim:header="WebWorks Sample">
<name>Yahoo</name>
<description>This is HelloWorld.</description>
<feature id="blackberry.invoke" />
<feature id="blackberry.invoke.BrowserArguments" />
<feature id="blackberry.identity" />
<access uri="rtsp://cdn.m.yuppcdn.net/liveorigin/abn1/" subdomains="true" />
<access uri="*" subdomains="true" />
<icon src="icons/Yahoo.png" />
<content src="index.html"/>
</widget>

 

 

 

 

 

index.html

 

 

 

 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,
user-scalable=no">
<title>Yahoo</title>
<script>
function toBrowser(){
var args = new blackberry.invoke.BrowserArguments('rtsp://cdn.m.yuppcdn.net/liveorigin/abn1');
blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
}
</script>
</head>
<body>
<p onClick="toBrowser()" >Yahoo</p>
</body>
</html>

 

 

 

 Error:  "  An   Error has occured to play the media.."

 

Error is showin in screenshot

 

 

 

screenshotBB2.jpg