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

New Contributor
Posts: 9
Registered: ‎10-19-2010
My Device: 9700

BlackBerry Browser not playing video



We are developing a Widget Application for BB 5.0 devices, and we need to play some Video files from the application.


But, it seems like the BB browser is unable to play the video, I tried with m4v and mp4 formats.


I am using <EMBED> tag as follows -

<embed type="video/mp4" src="big_buck_bunny.mp4" ></embed>  It gives me Null Pointer Exception.


I have also tried with the <OBJECT> tag but no luck at all.


Amazing thing is, my video plays just fine when I give it as HREF to <A> tag.


Seems like the root problem lies in <EMBED> & <OBJECT> tag.


If anyone can tell me what the secret formula is, or point me to a real web page that shows how a Blackberry can directly play an embedded mp4 or any other video file, I would greatly appreciate it.

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

Re: BlackBerry Browser not playing video

Unfortunately this is due to is a known issue with embedding the media player directly within a BrowserField object (BrowserField is the Class is used by the WebWorks framework to display web content in the standalone app).


This issue has been logged as a defect and is being worked on.  No ETA on when a fix is available. Have your voice heard by logging this and voting on it in the Developer Issue Tracker.


For the time being, a workaround is to invoke the native BlackBerry media player application, rather than embedding the content directly in the app.  Some of the benefits of this are that the media player is able to handle caching / buffering, users have access to input controls and of course the video plays on a larger screen area.  Since the BlackBerry is a multi-threaded OS, the media player simply sits on top of your application while the user is interacting with the video.  When they are finished and close the video, they are returned to your app.


The cleanest solution is to either create a direct hyperlink to the video file (as you mentioned in your post) or use the WebWorks invoke API to launch the media URL to the browser application.  This launches the browser, which identifies the content as video media and then launches the media player.  As background to those interested, behind the scenes, the browser is using the content handler API (CHAPI) to perform this analysis.




Follow me on Twitter: @n_adam_stanley
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
New Developer
Posts: 3
Registered: ‎05-12-2009
My Device: Not Specified

Re: BlackBerry Browser not playing video

This approach conflicts with a bug in the 9800 simulator - it cannot open more than one webkit instance (fails with the error "Failed to create a second process", and thus cannot resolve the URL into something playable by the media app.


Bit of a pain when developing, tbh Smiley Sad

Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: BlackBerry Browser not playing video

Which version of the 9800 simulator? I know there were some early versions of the simulator that had some integration issues with the WebKit browser.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter