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
New Contributor
aideAterix
Posts: 9
Registered: ‎08-04-2011
My Device: BlackBerry Torch 9800
My Carrier: Telcel

Play a youtube video in webworks application using html and javscript

Hi!

 

I'm developing a web application using webworks (html, javaScript ) and I need to know how I can play a video from a youtube url in my web page, I have tried using:

 

<object>,

<embed>,

<iframe src='url'>,

<script> location.href = 'url'

youtube api

 

and I don't have had success, I would greatly appreciate your help

Please use plain text.
Developer
SumiGhosh
Posts: 424
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: Play a youtube video in webworks application using html and javscript

hi,

 

    Did u get an output,  I'm also in the same situation to integrate a video in webworks application. If you have one please post it...

Please use plain text.
Contributor
keraisureshv
Posts: 48
Registered: ‎03-04-2009
My Device: Not Specified

Re: Play a youtube video in webworks application using html and javscript

facing same problem..

Please use plain text.
Developer
SumiGhosh
Posts: 424
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: Play a youtube video in webworks application using html and javscript

The mobile youtube site uses rtsp. And in webworks we wont able to play an rtsp video within the application but possible to push it to the browser and showing it.  In BBOS7 you can play http video within the application. 

Please use plain text.
Administrator
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Play a youtube video in webworks application using html and javscript

Here is a working example of how to embed a YouTube video in a WebWorks application:

 

http://blackberry.github.com/WebWorks-Samples/kitchenSink/html/browser/flashplayer.html

 

Here is the snippet being used to display this video:

 

<object width="640" height="385" style="border: dotted 1px black">

	<param name="movie" value="http://www.youtube.com/v/eAaez_4m9mQ?fs=1&amp;hl=en_US"></param>

	<param name="allowscriptaccess" value="always"></param>

	<embed src="http://www.youtube.com/v/eAaez_4m9mQ?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" width="640" height="385"></embed>

</object>

 

 

Reminder: you need to properly whitelist any external domains you will be accessing in your config.xml document.

 

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
New Contributor
aideAterix
Posts: 9
Registered: ‎08-04-2011
My Device: BlackBerry Torch 9800
My Carrier: Telcel

Re: Play a youtube video in webworks application using html and javscript

I use launch BlackBerry Browser with the YouTube url, but the last code is useful.

Please use plain text.
Developer
panchopepe
Posts: 30
Registered: ‎06-22-2012
My Device: Blackberry Curve 8520
My Carrier: Movistar

Re: Play a youtube video in webworks application using html and javscript

[ Edited ]

Hello how should  I to configure the access to youtube in the config.xml ? thanks

Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Play a youtube video in webworks application using html and javscript


panchopepe wrote:

Hello how should  I to configure the access to youtube in the config.xml ? thanks


I would shuggest to use this one in the config.xml

 

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

since the video URL of youtube may be somehow different if you only use

 

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

but you may also give this a try. BTW: documentation for the access tag is here for some further reading.

 

 

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Trusted Contributor
basitj
Posts: 103
Registered: ‎04-08-2011
My Device: BlackBerry Q10
My Carrier: Mobilink

Re: Play a youtube video in webworks application using html and javscript

Nothing seem to be working on BB10 webworks. Tried both <object as well as <iframe embed codes. I do have all urls allowed in config xml.

 

Suggestions?

 

Get Speedometer on your phone. http://www.speedometer.mobi
Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Play a youtube video in webworks application using html and javscript

Hi.

 

Make sure you are adding the right feature-tag to your config.xml like described in the documentation:

 

<feature id="enable-flash">

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.