Embeded YouTube videos not loading - html

Our current implementation for YouTube videos use standard <object> from API documentation and is no longer loading correctly.
It shows an empty Object with link to YouTube page.
Created an example using code from documentation and error is reproduce-able.
Anybody know if there's another way to use the embedded code from YouTube?
Example code:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<object width="640" height="390">
<param name="movie"
value="https://www.youtube.com/v/M7lc1UVf-VE?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>
</body>
</html>
API Documentation: https://developers.google.com/youtube/player_parameters

You don't need all those thing just do it like this..
<object width="420" height="315"
data="http://www.youtube.com/v/XGSy3_Czz8k">
</object>
OR
<embed width="420" height="315"
src="http://www.youtube.com/embed/XGSy3_Czz8k">

Most YouTube videos are been embedded in an iframe tag like this:
<iframe src="link_to_video"></iframe>

Use iframe youtube embedded option.
Or you can do it your self on you tube click on share under you tube video and click on embed.Copy and paste code in your html.
Share 2. Embed 3. Copy & Paste

The problem can also be solved, if the video is called over the API url.
https://www.youtube.com/apiplayer?version=3&video_id=oPEJzOTgQCE&enablejsapi=1&playerapiid=ytplayer&rel=0
This can use all the extra parameters and works the exact same way as the other URL.
<object data="https://www.youtube.com/apiplayer?version=3&video_id=oPEJzOTgQCE&enablejsapi=1&playerapiid=ytplayer&rel=0" type="application/x-shockwave-flash" id="flash_236856494" width="312" height="173"><param name="scale" value="showAll"><param name="salign" value="tl"><param name="menu" value="false"><param name="update" value="true"><param name="allowfullscreen" value="true"><param name="wmode" value="opaque"><param name="bgcolor" value="#DADADA"><param name="allowScriptAccess" value="sameDomain"><param name="flashvars" value="youtubeId=oPEJzOTgQCE&autostart=false&suggestedQuality=large"><param name="movie" value="https://www.youtube.com/apiplayer?version=3&video_id=oPEJzOTgQCE&enablejsapi=1&playerapiid=ytplayer&rel=0"></object>

Related

Flash presentation won't load on my web page

I found this solution over several places, regarding embeding a flash animation on my webpage but when I tried it, in my page only a white rectangle opens but the flash animation never plays.
I'm totally new for this Flash animations and object embeding thing so don't have any idea how to proceed.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="1000" height="600">
<param name="movie" value="birthdayAS2.swf">
<embed href="birthdayAS2.swf" width="1000" height="600" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>
Greetings
Have you checked that the file "birthdayAS2.swf" is in the same directory as of the file that you have mentioned above ?
Also please check whether your browser supports flash or not.
This means that flash player is loading. It also means that it cannot find the file.
After a lot of researching and testing I came up with this code:
<div id="flashcontent" align="center">
<object type="application/x-shockwave-flash" data="birthdayAS2.swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash /swflash.cab#version=6,0,29,0" width="700" height="600" align="middle">
<param name="movie" value="birthdayAS2.swf">
<param name="quality" value="high" />
<param name="wmode" value="transparent">
<param name="bgcolor" value="#000000" />
<embed src="birthdayAS2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave- flash" width="700" height="600" bgcolor="#000000" wmode="transparent" > </embed>
</object>
</div>

How do I get a embedded <object> code working?

I want to embed a video on my page, and this comes in a code, but when just simply paste this on my page, it won't work. I've done this before with iframes, and this works instantly. How do I get this code also working?
this is the code
<object width="450" height="237"><param name="movie" value="http://www.traileraddict.com/emd/72497"></param><param name="allowscriptaccess" value="always"><param name="wmode" value="transparent"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.traileraddict.com/emd/72497" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="transparent" width="450" height="237" allowFullScreen="true"></embed></object>
Ok this is working fine for me. Your code is allright

Autostart not working for video html

I am using tag to display my video on the page. When the page is loaded, the video gets started automatically.
To prevent this , I use autostart="false". But no Luck.
My code :
<embed style="max-width:180px; max-height:135px;" src="url" autostart="false" loop="true">
Can anyone help me with it?
If it is an strictly an embed, usually you just have to put autostart="false" within the embed tag.
EXAMPLE:
<embed autostart="false">
If it is an object (which is recommended), you will want to use a param.
EXAMPLE:
<object width="160" height="144">
<param name="autoplay" value="false">
<embed src="sample.mov" width="160" height="144" autoplay="false" controller="false"
</embed>

Is it possible to use object/embed code to show an image+link?

I have a code like this that I cannot modify (its hosted elsewhere). I can control however the player.swf since its hosted on my domain.
<object width="480" height="388">
<param name="movie" value="http://mysite.com/player.swf"></param>
<param name="allowFullScreen" value="true"></param>
<param name="wmode" value="transparent"></param>
<param name="allowScriptAccess" value="always"></param>
<embed src="http://mysite.com/player.swf" wmode="transparent" type="application/x-shockwave-flash" width="480" height="388" allowFullScreen="true" allowScriptAccess="always">
</embed>
</object>
I'm interested in replacing the player.swf for a plain GIF or JPG image instead with a link elsewhere. I been trying to do it and I can link to an image but I can't add a link to it. Is there any way that this can be done without modifying the original object/embed code?
I may have completely misread this question, but Ill chuck this in incase.
This would be the code for displaying an image, and when clicked, takes you to the .swf file.
<img src="link/to/hosted/image.jpg" alt="" />

PHPBB Optimal YouTube BBCode

Anyone knows the optimal bbcode to embed youtube videos in PHPBB3? I use the follwing:
BBCode Usage:
[youtube]http://{SIMPLETEXT1}youtube.com/watch?v={SIMPLETEXT2}[/youtube]
HTML Replacement:
<object width="560" height="315">
<param name="movie" value="http://{SIMPLETEXT1}youtube.com/v/{SIMPLETEXT2}"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://{SIMPLETEXT1}youtube.com/v/{SIMPLETEXT2}"
type="application/x-shockwave-flash"
width="560"
height="315"
allowscriptaccess="always"
allowfullscreen="true">
</embed>
</object>
This seems to have some issues and doesn't translate to HTML when the URL the user puts is something like http://www.youtube.com/watch?v=vS6VBOeJ-i4&feature=related.
I would like to make an HTML Replacement so it can replace the user's link into the new embed style of YouTube with the iFrame, but independent of URL attributes while also using the wmode=transparent, since I also use Shadowbox.
While riot_starter's solution works, it does not seem to work with https URLs which YouTube forces nowdays. So here is a workaround that should work in all scenarios:
BBCode:
[youtube]http{TEXT4}://{TEXT1}youtube.com/{TEXT2}v={IDENTIFIER}{TEXT3}[/youtube]
HTML:
<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/{IDENTIFIER}&hl=en_US&fs=1&"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/{IDENTIFIER}&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="350"></embed>
</object>
This is the best version I have found so far. Works with www.youtube.com, youtube.com, regional subdomains (nl.youtube.com), and with any youtube url parameters (for example including &feature=...).
BBCode usage:
[youtube]http://{TEXT1}youtube.com/{TEXT2}v={IDENTIFIER}{TEXT3}[/youtube]
HTML replacement:
<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/{IDENTIFIER}&hl=en_US&fs=1&"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/{IDENTIFIER}&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="350"></embed>
</object>
I use this
BBCode Usage [youtube]{IDENTIFIER}[/youtube]
HTML Replacement
<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/{IDENTIFIER}" width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/{IDENTIFIER}" />
<param name="wmode" value="transparent" />
</object>
Now a user can just do [youtube]oHg5SJYRHA0[/youtube] to get the video embedded into the post.
I suggest using the on the embed code not
works ALOT better!!!
tested on 3.0.11
example: http://fwkzt.site.nfoservers.com/forums/viewtopic.php?f=20&t=17&p=33&sid=2d89389670c660b3a345fd59bac5c4ff#p33
code used:
<iframe width="560" height="315" src="//www.youtube.com/embed/{YOUTUBE}?rel=0" frameborder="0" allowfullscreen></iframe>