I am working on SharePoint 2010. I created a blog sub site. My problem was, when I composing a post in blog I can insert images and link but the video insertion is in disabled mode. After some R&D I found SharePoint 2010 blog engine does not allow in insert videos in a blog post.
There is a simple way to work around this limitation. Create new post and insert video embed code.
SharePoint will escape all HTML characters when record is being saved in a database. What we have to do is to register a javascript function which will replace escaped HTML back with the original one. I used this jquery code snippet:
It can be either added in a Content Editor web part on the page or registered via feature in a AdditionalPageHead delegate control or added to the master page using SharePoint designer.
There is a simple way to work around this limitation. Create new post and insert video embed code.
SharePoint will escape all HTML characters when record is being saved in a database. What we have to do is to register a javascript function which will replace escaped HTML back with the original one. I used this jquery code snippet:
<script type="text/javascript">
$(document).ready(function() {
$(".ms-PostBody").html(function(index, oldHtml) {
var matchStr = /(\<object.+\/object\>)/i;
var m = oldHtml.match(matchStr);
$.each(m, function (index, value) {
oldHtml = oldHtml.replace(value, value.replace(/\>/g, ">").replace(/\</g, "<"));
});
return oldHtml;
});
});
</script>It can be either added in a Content Editor web part on the page or registered via feature in a AdditionalPageHead delegate control or added to the master page using SharePoint designer.
Comments
Post a Comment