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
Contributor
zelaza
Posts: 44
Registered: ‎02-15-2010
My Device: Blackberry Storm 9530

Re: Blackberry Browser cannot Play Embedded MP4 Videos

[ Edited ]

jimlongo,

 

There are so many reasons why those links are not going to work on your Blackberry that it's not worth getting into it.

 

Your only hope is to try to find an rtsp link to your video on youtube.  The rtsp link will look something like:

 

<a href="rtsp://v2.cache6.c.youtube.com/CkYLENy73wIaPQmWvf-DOg-vZBMYESARFEIJbXYtZ29vZ2xlSARSBXdhdGNoWg5DbGlja1RodW1ibmFpbGD9wYrkhKfO0ksM/0/0/0/video.3gp">

 

The challenge here is that you won't be able to just browse to your video in a normal browser, look at the HTML source code and find the link.  I think youtube will only render the page with an rtsp link (instead of an http link) when it detects a Blackberry browser.  So to find the rtsp link, you may have to build something that imitates a Blackberry browser (i.e. sends a User-Agent header like 

"BlackBerry9530/5.0.0.328 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/105") and displays the html that comes back from youtube.  Personally, I built a little vb.net program that does just that.

 

Once you have the rtsp link you can just embed that in a web page as a normal <a /> link (as shown above) and it should work.

 

- zelaza
Contributor
zelaza
Posts: 44
Registered: ‎02-15-2010
My Device: Blackberry Storm 9530

Re: Blackberry Browser cannot Play Embedded MP4 Videos

Jim,

 

Try embedding the following link in a web page and pointing your blackberry at it:

 

<a href="rtsp://v3.cache5.c.youtube.com/CkYLENy73wIaPQnI7ix7vigZyRMYESARFEIJbXYtZ29vZ2xlSARSBXdhdGNoWg5DbGlja1RodW1ibmFpbGD-1Mb8w7jP0ksM/0/0/0/video.3gp">

 

I think that's the rtsp link to your video.

 

Let me know if it works.

 

- zelaza
New Contributor
jimlongo
Posts: 7
Registered: ‎03-18-2010
My Device: 8300

Re: Blackberry Browser cannot Play Embedded MP4 Videos

[ Edited ]

yes that works on a phone, not on most computers.

 

Contributor
zelaza
Posts: 44
Registered: ‎02-15-2010
My Device: Blackberry Storm 9530

Re: Blackberry Browser cannot Play Embedded MP4 Videos

Ok, good.

 

If your web server supports PHP, it's very simple to write a short PHP script that will play the RTSP link at Blackberries and an HTTP <OBJECT><EMBED><EMBED /><OBJECT /> construct at everything else....

 

- zelaza
Contributor
zelaza
Posts: 44
Registered: ‎02-15-2010
My Device: Blackberry Storm 9530

Re: Blackberry Browser cannot Play Embedded MP4 Videos

[ Edited ]

 

Try adding .php to the name of your index file, updating your .htaccess to point to it and then put something like the below in the html (note: obviously replace the rtsp and http links with your real ones, and put in the correct height and width, etc):

 

<body>
<?php if (stristr($_SERVER['HTTP_USER_AGENT'], "blackberry")) : ?>
	<a href="rtsp://v3.cache5.c.youtube.com/CkYLENy73wIaPQnI7ix7vigZyRMYESARFEIJbXYtZ29vZ2xlSARSBXdhdGNoWg5DbGlja1RodW1ibmFpbGD-1Mb8w7jP0ksM/0/0/0/video.3gp">
	<img src="media/prs_poster_ns.jpg"></a>
<?php else : ?>
	<object id="qtobject" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" height="240" width="320">
		<param name="controller" value="false">
		<param name="autoplay" value="true">
		<param name="showlogo" value="true">
		<param name="cache" value="false">
		<param name="target" value="myself">
		<param name="data" value="http://www.youtube.com/v/yRkovnss7sg&hl=en_US&fs=1&rel=0">
		<param name="src" value="http://www.youtube.com/v/yRkovnss7sg&hl=en_US&fs=1&rel=0">
		<param name="type" value="video/3gpp">
		<embed height="240" width="320"
			autoplay="true"
			target="myself"
			controller="false"
			src="http://www.youtube.com/v/yRkovnss7sg&hl=en_US&fs=1&rel=0"
			qtsrc="http://www.youtube.com/v/yRkovnss7sg&hl=en_US&fs=1&rel=0"
		/>
	</object>
<?php endif ?>
</body>
</html>

 

- zelaza
New Contributor
jimlongo
Posts: 7
Registered: ‎03-18-2010
My Device: 8300

Re: Blackberry Browser cannot Play Embedded MP4 Videos

[ Edited ]

yes that works!!  the rtsp stream link gets shown to the BB and the regular object tag to all others.

 

 

EDIT, re-reading the thread I see you've already given me the rtsp URL, and also described how you got it.  Thanks for your help.

 

Contributor
zelaza
Posts: 44
Registered: ‎02-15-2010
My Device: Blackberry Storm 9530

Re: Blackberry Browser cannot Play Embedded MP4 Videos

Finally it looks like there may be a fix for the blackberry-can't-play-video problem: lots of rumors on the web and elsewhere that Verizon will have the iPhone this summer.

 

So:

 

(a) pray that the rumors are true and

 

(b) don't upgrade your Blackberry - wait until the iPhone is available

 

 

- zelaza
Contributor
elogic
Posts: 15
Registered: ‎04-08-2010
My Device: Storm 9530

Re: Blackberry Browser cannot Play Embedded MP4 Videos

Zelaza,

 

Thanks for pushing the heck out of this issue - very annoying indeed. So one question (and an interesting test that may point to how to get a working 3gp file). 

 

(a) how did you generate that rtsp link for the YouTube video? I'm trying to see if we can dynamically link to a url like that when we detect blackberry users. 

 

(b) Here is a very strange phenomenon - we DID find a way to get a 3gp file to play via http! most 3gp tests we created failed, but this one works on my verizon powered storm (v5.0.0.328 of the OS) (not a storm 2 just the original): 

http://mediacontent.sitecore.net/tours/oms/mobile-qa/OMS1_MobileQA_Small.3gp

 

We're trying to figure out right now specifically how we pulled it off but let me know if this works. I will post any info I discover if we can re-output another file that successfully plays. Interestingly enough it was more random luck then anything because other 3gp files we've output don't work via http...

 

more to come,

Brian 

Contributor
zelaza
Posts: 44
Registered: ‎02-15-2010
My Device: Blackberry Storm 9530

Re: Blackberry Browser cannot Play Embedded MP4 Videos

Brian.

 

First, thanks so much for contributing to this thread.

 

Holy heck, I think you may have stumbled on the magic alchemical formula (even though you don't know exactly what that formula is yet)!!!

 

The darn thing plays over HTTP.  It asks me if I want to OPEN or SAVE, which is only slightly annoying, but when I choose OPEN, it does indeed play on my Storm v5.0.0.328.

 

I notice you are using an <EMBED /> tag rather than an </OBJECT > tag.  Very interesting.  Would be interesting to see how the same 3gp file behaves when embedded with an <OBJECT /> tag...  Would be cool if there were some way to defeat the "OPEN or SAVE" dialog box, but actually, I can live with that if necessary.

 

Dude, you are onto something here.  Please do us all a huge favor and let us know once you figure out the magical incantation you have to do while building the 3gp file to get this to work.

 

Good job!

 

 

- zelaza
Contributor
elogic
Posts: 15
Registered: ‎04-08-2010
My Device: Storm 9530

Re: Blackberry Browser cannot Play Embedded MP4 Videos

I actually think it is the file itself vs. the embed / object tag - I'm just linking directly to a url but didn't do anything special with the link. The downside is that we STILL can't figure out what we did to get this to work - we keep trying different combinations with no luck (arrrgggghhhh!). I will post if we discover anything else. 

 

In the meantime I figured out how to easily grab the youtube streams (just go to http://m.youtube.com and search for your video, right click the video, copy url and boom). However, the streaming server is actually a bit testy so I keep getting halts etc. This may be a throughput issue with the storm but who knows.

 

I will post when break the back of this silly blackberry mystery. AND - I'm with you - my plan is to migrate to Android or iPhone as soon as Verizon decides it wants to release cutting edge phones and not get consistently trumped by AT&T / Sprint etc. 

 

Take it easy,

Brian