How to show default Playback Controls with the AS3 YouTube API? - actionscript-3

I've read the YouTube API documentation to add the playback controls, but I'm not sure exactly where I'm supposed to specify these parameters.
https://developers.google.com/youtube/player_parameters?playerVersion=AS3#controls
I've tried to append "&controls=1" to the Player's URL when I load it inside of a Loader object, but they still don't show up.
Are they supposed to be called from somewhere else? Or set on the player:Object? for example:
player.controls = 1;
No matter my efforts, none of my attempts worked.
Got any ideas?

That is the URL parameters on the embed, as you suspected. To disable controls you can use this object embed, which will use AS3:
<object width="853" height="480"><param name="movie" value="http://www.youtube.com/v/M7lc1UVf-VE?version=3&controls=0">
<param name="allowFullScreen" value="true">
<param name="allowscriptaccess" value="always">
<embed src="http://www.youtube.com/v/M7lc1UVf-VE?version=3&controls=0" type="application/x-shockwave-flash" width="853" height="480" allowscriptaccess="always" allowfullscreen="true">
</object>
The parameters are passed in the embed src tag. Note that the source parameters needs to be URL encoded, so the parameter separator is "&"
The alternative way is to use iframe embed
<iframe id="ytplayer" type="text/html" width="640" height="360"
src="https://www.youtube.com/embed/M7lc1UVf-VE?controls=0"
frameborder="0" allowfullscreen>
A nice page to play around with is Youtube's demo page: https://developers.google.com/youtube/youtube_player_demo There you can get the full embed code for the parameters you've selected as well, but the object embed don't seem to generated there.
For embedding using javascript there is also the SWFObject library where you pass these parameters as flashVars:
https://developers.google.com/youtube/js_api_reference?hl=de#Embedding
Hope that helps,
Christian

Related

Is it possible to use Ruffle within an Iframe?

So ive been trying to use Ruffle (a flash emulator written in Rust) on a website for some flash games. This works like a charm with flash games in my website source files, but it doesnt work for iframes. This is the code that ive been trying to get working, but at this point im not sure if its possible at all. any help?
<script src="ruffle/ruffle.js"></script>
<iframe id="cppscreatorCPPS" src="https://play.cppscreator.xyz/embed/24436" scrolling="no" width="960" height="600" frameborder=0></iframe>
<br /><br />```
Instead of an <iframe>, I would recommend you used an <object> and <embed>component. I will leave a code snippet below (You need to replace the value of the param and the src of the embed with your swf file link. In your case, it is the play.cppscreator.xyz/embed link. ). Also, you are using cppscreator.xyz, which does not really work, as it is not an SWF file.
<script src="https://flash-games.penguinbotcoder.repl.co/ruffle/ruffle.js"></script>
<object width="600" height="400">
<param name="movie" value="https://flash-games.penguinbotcoder.repl.co/flashgames/thinice.swf">
<embed src="https://flash-games.penguinbotcoder.repl.co/flashgames/thinice.swf">
</embed>
</object>

youtube html video integration

I have a slight problem with a webpage : when I try to load a youtube video it shows a white rectangle ( I'm on firefox with win 8.1 x 64 and Yes, I did a flash player update )
Here's the code :
<object type="application/x-shockwave-flash" width="800" height="600"data="https://www.youtube.com/watch?v=jRXQsQKGqIU"><param name="movie" value="https://www.youtube.com/watch?v=jRXQsQKGqIU" /></object>
Can somebody tell me what's wrong with it ?
The other parts of the HTML code are just fine but this youtube code keeps showing me this white rectangle in my webpage instead of the video.
According to Google, the best way to embed is to use iframes:
Best practice: IFrame embeds are the recommended method for embedding
a YouTube player because the IFrame will select the appropriate player
based on the client's capabilities and available YouTube file formats.
That would look like this:
<iframe width="420" height="315" src="//www.youtube.com/embed/jRXQsQKGqIU" frameborder="0" allowfullscreen></iframe>
However, if you wish to use the Object tag, here's a working example:
<object width="640" height="390">
<param name="movie"
value="https://www.youtube.com/v/jRXQsQKGqIU?version=3&autoplay=1"></param>
<param name="allowScriptAccess" value="always"></param>
<embed src="https://www.youtube.com/v/M7lc1UVf-VE?version=3&autoplay=1"
type="application/x-shockwave-flash"
allowscriptaccess="always"
width="640" height="390"></embed>
</object>
Working JS Fiddle: http://jsfiddle.net/RAZC4/2/
https://developers.google.com/youtube/player_parameters
Maybe you can use the new code..
<iframe width="800" height="600" src="//www.youtube.com/embed/jRXQsQKGqIU" frameborder="0" allowfullscreen></iframe>
Have you made sure that your browser supports flash?
Otherwise I would suggest using the new embed code

Why doesn't RTSP (sdp) Quicktime embed work in FF and IE?

I have an embed code that plays streaming video:
<object width="640" height="480" id="qt" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="MY STREAM URL">
<param name="autoplay" value="true">
<param name="controller" value="false">
<embed id="plejer" name="plejer" src="/poster.mov" bgcolor="000000" width="640" height="480" scale="ASPECT" qtsrc="MY STREAM URL" href="MY STREAM URL" kioskmode="true" showlogo=false" autoplay="true" controller="false" pluginspage="http://www.apple.com/quicktime/download/">
</embed></object>
The embed works as expected in Chrome. However in FireFox(3.6) and IE(9) I get a quicktime logo. I've checked my quicktime player prefs and I don't see a streaming or sdp option in the mime options.
Any ideas why I'm seeing this issue?
Your embed tag is set up to initially display a "poster" video (at /poster.mov, and then change to the stream when its clicked on. The object tag isn't (and also skips many of the parameters you're including in the embed). The general idea with these embed inside object schemes (particularly with QuickTime) is to pass the same parameters in both tags, the object covering IE, the embed covering basically everybody else. – John Flatness

<embed> tag seems to be only way to include certain flash content?

Various sites, such as flickr.com for video, or soundcloud.com, use an object tag with a nested embed tag. Based on quite a bit of testing, I've concluded that these sites only work with the nested or stand-alone embed tag, but not with the equivalent object tag syntax. Here's an example:
This works
<embed
type="application/x-shockwave-flash"
src="http://www.flickr.com/apps/video/stewart.swf?v=71377"
bgcolor="#000000" allowfullscreen="true"
flashvars="intl_lang=en-us&photo_secret=564da38fcc&photo_id=2454294841"
height="300" width="400"
>
</embed>
This does not
<object
type="application/x-shockwave-flash"
width="400"
height="300"
data="http://www.flickr.com/apps/video/stewart.swf?v=71377"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
>
<param name="flashvars" value="intl_lang=en-us&photo_secret=564da38fcc&photo_id=2454294841"></param>
<param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=71377"></param>
<param name="bgcolor" value="#000000"></param>
<param name="allowFullScreen" value="true"></param>
</object>
What's going on?
In this form, your plain object tag will be ignored by all browsers except for IE, which is capable of reading a badly formed object tag. The embed tag is read by all other browsers.
To make all browsers read the object tag, and so make the embed tag redundant, you need to mess around with the object tag properties a bit to make it correctly validate. A better (but slightly old) write up of this is available on A List Apart.
Really though, I still recommend not writing the object tags yourself, and instead let SWFObject do the hard work for you.

Fail to embed Flash by using Data uri scheme

i just want to embed a flash like this:
<object
data="data:application/x-shockwave-flash;base64,..."
type="application/x-shockwave-flash">
<param name="movie"
value="data:application/x-shockwave-flash;base64,..."
/> </object>
but it just doesn't work. Did i make any mistake?
thankz
That's because it doesn't work. Not only would you have a buffer overflow, but most browsers don't allow for the inclusion of Flash via Data URIs. If you need a good place to host your Flash, Google Code works just fine.