Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

First, thank you in advance for any help anyone is able to give.

I have a Sharepoint 2010 site that needs the ability to embed YouTube videos in the rich text field of a list item, is there anyway to do it, and if so, how?

Currently, when my users copy & paste in code to embed a video from YouTube, Sharepoint automatically modifies it, stripping out the and tags and everything in between.

I need a way to either stop it from modifying the code OR to allow and/or tags. Either option would be fine since the users on this site are sufficiently skilled & trustworthy to allow them broader options to make the list accept any code.

I dearly hope someone can help!

share|improve this question
    
I am not aware of a way to do this. However, would it be acceptable to use another field? In this field the user would paste the URL of the youtube video, and on the page where you would like to embed it, you could add javascript to create an iframe with the appropriate attributes. –  Chloraphil Apr 15 '13 at 15:54
    
Try using Media Webpart (from Media and Content Category). –  shreyas Apr 15 '13 at 18:30
add comment

3 Answers

Saving IFrame element (embed code for YouTube by default) in Rich text fields is not allowed in SharePoint 2010

For storing YouTube video content in SharePoint List the following solutions could be used:

Store embedded video properties

Using this approach embed code properties are stored in List Item as shown on picture below. enter image description here YouTube Video player is rendered in List View using Computed Field

Please follow this post for more details

Store embed code in text field

Field of Note type is used for storing embed code as shown on picture below. enter image description here

To render YouTube video player in List a customized List View is used

Please follow this post for more details

Result

List View with support to play YouTube video content

enter image description here

share|improve this answer
add comment

This is going to sound clumsy but I have had this work in the past...

  1. Edit your Rich Content
  2. Insert a Content Editor Web Part into the Rich Content
  3. Edit the content of the new web part
  4. Add the YouTube code to the source view of the CEWP
  5. Save your changes

Please let me know if this works for you.

share|improve this answer
    
How do you insert a web part into a Rich Text field? I do not see an option to do so in the ribbon. –  Chloraphil Apr 15 '13 at 15:51
    
On my pages, if I simply click anywhere in the text of the Rich Content box, the option appears on the Insert submenu of the Editing Tools tab. The Rich Content Editor has about 3 different modes that it can operate under and you might be in one of the lower-functionality modes which might not allow this. –  Dave Wise Apr 15 '13 at 15:55
    
Dave, is it at all possible you are referring to the RTE of a publishging page, and not the RTE of a multi-line text field? If not, where would I change the field to having this functionality? It is already set to "Enhanced rich text". Thanks. –  Chloraphil Apr 15 '13 at 16:23
    
Hello, and thank you VERY much for responding. First, The field type is a Multiple Lines of Text column. Second, it is already set to Enhanced Rich Text Mode. Third, I don't have the option to insert a Content Editor Web Part into the Rich Content zone. Sadly this one isn't a publising page, it's actually the view of a list item. –  W. Frazier Apr 15 '13 at 16:28
    
That may be the difference. As I said, the same RTE operates in a number of different modes, some more restricted than others. In the case I am referring to, the field type is "Publishing HTML". FWIW, I just tested this using the IFRAME src provided by YouTube and it does indeed still work ... for this particular type of field anyway. –  Dave Wise Apr 15 '13 at 16:43
show 2 more comments

Workaround using jquery:

1) add this tag to the SP field

<div class="myCompany_iframe" style="visibility: hidden">width="560" height="315" src="//www.youtube.com/embed/Basc-0edkhw?list=sasd" frameborder="0" allowfullscreen</div>

2) Add this script to the page/master page

<script type="text/javascript">
$(document).ready(function() {

$( ".myCompany_iframe" ).each(function() {
$(this).html("<iframe " +  $(this).html() + "></iframe>").css("visibility","visible");
});

});</script>

Mirco

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.