Open the blog site on which we want to show the YouTube video in SPD. Add below script at last of the master page before body tag.
<script type="text/javascript">
<!--
for (var i = 0; i < document.getElementsByTagName('*').length; ++i)
{if (document.getElementsByTagName('*')[i].id.indexOf('youtube') == 0)
{//get the parameters
var tagtoadd= document.getElementsByTagName('*')[i].innerHTML.split(',');
//create the string
var finalstring = '<object width="';
finalstring += tagtoadd[0];
finalstring += '" height="';
finalstring += tagtoadd[1];
finalstring += '"><param name="movie" value="';
finalstring += tagtoadd[2];
finalstring += '" /><param name="allowFullScreen" value="';
finalstring += tagtoadd[3];
finalstring += '" /><embed src="';
finalstring += tagtoadd[2];
finalstring += '" type="application/x-shockwave-flash" allowfullscreen="';
finalstring += tagtoadd[3];
finalstring += '" width="';
finalstring += tagtoadd[0];
finalstring += '" height="';
finalstring += tagtoadd[1];
finalstring += '" /></object>"';
//replace it
document.getElementsByTagName('*')[i].innerHTML = finalstring ;
}
}
//—></script>
Edit the post and add following tag in the html of the post body. The tag should be in below format.(<div align="center" id="youtubeSNBS1">425,355,http://www.youtube.com/v/7SGp9pA9cAY;&hl=en;&fs=1,true</div>
)
Publish the post and see the effect.
IE
Chrome
Firefox
It works for all the browsers.
The report center serves the purpose through a centralized hub that is specifically meant for information delivery.
ReplyDeleteSharepoint is a kind of central platform that helps business people during the work on different types of documents and projects.
Sharepoint Consulting
Hi Bharat,
ReplyDeleteI've got a problem with the display. Trying to implement your code I get a white frame where the video should appear. I get also this a message from the browser "only secure content is displayed ". After clicking the "Show all content button" nothing happens. Can you help me ??
this is not working on SP 2010. how did you get it working?
ReplyDeleteI agree with your sharepoint video coding. it is right to all uses that.
ReplyDeleteProfessional and Custom Sharepoint Development Services In India