Embed video in multiple lines of text field in SharePoint List

Published May 01 2019 04:13 PM 702 Views
Microsoft

First published on TECHNET on Apr 19, 2018
This post is a contribution from Jing Wang, an engineer with the SharePoint Developer Support team

Problem Description:

SharePoint site user created a custom list and added a multiple line of text field called “note”, which is used to embed a video.

The video is stored in Azure.
Add new item to the list, insert the content with “<>Edit Source” button on Ribbon:







<link href="//amp.azure.net/libs/amp/2.1.3/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet">
<script src="//amp.azure.net/libs/amp/2.1.3/azuremediaplayer.min.js"></script>
<video id="azuremediaplayer" class="azuremediaplayer amp-default-skin amp-big-play-centered" tabindex="0"></video>
<script type="text/javascript">
var myOptions = {
"nativeControlsForTouch": false,
controls: true,
autoplay: true,
width: "640",
height: "400",
}

myPlayer = amp("azuremediaplayer", myOptions);
myPlayer.src([
{
"src": "https://sccpssvideo.streaming.mediaservices.windows.net/ab838cb0-befe-40bd-b873-f9793e86255d/Capital Improvements Committee M.ism/manifest",
"type": "application/vnd.ms-sstr+xml"
}
]);
</script>






Click on Ok, got warning:

Warning: Some of your markup was stripped out…. The JavaScript is removed. The video does not get inserted.





Solution:

Use following iframe tag to embed the video instead, which eliminate the use of Javascript.



<iframe width="500" height="280" align="center" src="https://aka.ms/ampembed?url=https://sccpssvideo.streaming.mediaservices.windows.net/ab838cb0-befe-40..." frameborder="no"></iframe>


Before you copy and paste above html source to the note field, go to Site Settings and make modification to the below setting first:

Under "Site Collection Administration"

- Go to Html Field Security:

- Select “Permit contributors to insert iframes from the following list of external domains into pages on this site” and Add “aka.ms” for Allow iframes from this domain:







Then copy the iframe html tag to the list field as shown below.





Save the list item, browse to the list, and you should be able to see the video.



%3CLINGO-SUB%20id%3D%22lingo-sub-510072%22%20slang%3D%22en-US%22%3EEmbed%20video%20in%20multiple%20lines%20of%20text%20field%20in%20SharePoint%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-510072%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3EFirst%20published%20on%20TECHNET%20on%20Apr%2019%2C%202018%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3EThis%20post%20is%20a%20contribution%20from%20Jing%20Wang%2C%20an%20engineer%20with%20the%20SharePoint%20Developer%20Support%20team%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3E%20Problem%20Description%3A%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3ESharePoint%20site%20user%20created%20a%20custom%20list%20and%20added%20a%20multiple%20line%20of%20text%20field%20called%20%E2%80%9Cnote%E2%80%9D%2C%20which%20is%20used%20to%20embed%20a%20video.%20%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20video%20is%20stored%20in%20Azure.%20%3CBR%20%2F%3EAdd%20new%20item%20to%20the%20list%2C%20insert%20the%20content%20with%20%E2%80%9C%26lt%3B%26gt%3BEdit%20Source%E2%80%9D%20button%20on%20Ribbon%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20998px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111639i202AEC89EB0AC994%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CDIV%3E%3CBR%20%2F%3E%3CLINK%20href%3D%22%26quot%3B%2F%2Famp.azure.net%2Flibs%2Famp%2F2.1.3%2Fskins%2Famp-default%2Fazuremediaplayer.min.css%26quot%3B%22%20rel%3D%22%26quot%3Bstylesheet%26quot%3B%22%20%2F%3E%20%3CBR%20%2F%3E%3CSCRIPT%20src%3D%22%26quot%3B%2F%2Famp.azure.net%2Flibs%2Famp%2F2.1.3%2Fazuremediaplayer.min.js%26quot%3B%22%3E%3C%2FSCRIPT%3E%20%3CBR%20%2F%3E%3CVIDEO%20id%3D%22%26quot%3Bazuremediaplayer%26quot%3B%22%20class%3D%22%26quot%3Bazuremediaplayer%22%20amp-default-skin%3D%22%22%20amp-big-play-centered%3D%22%22%3E%3C%2FVIDEO%3E%20%3CBR%20%2F%3E%3CSCRIPT%20type%3D%22%26quot%3Btext%2Fjavascript%26quot%3B%22%3E%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bvar%20myOptions%20%3D%20%7B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BnativeControlsForTouch%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%3A%20false%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bcontrols%3A%20true%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bautoplay%3A%20true%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bwidth%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B640%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bheight%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B400%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3BmyPlayer%20%3D%20amp(%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Bazuremediaplayer%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20myOptions)%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3BmyPlayer.src(%5B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Bsrc%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BA%20href%3D%22https%3A%2F%2Fsccpssvideo.streaming.mediaservices.windows.net%2Fab838cb0-befe-40bd-b873-f9793e86255d%2FCapital%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%22%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bhttps%3A%2F%2Fsccpssvideo.streaming.mediaservices.windows.net%2Fab838cb0-befe-40bd-b873-f9793e86255d%2FCapital%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FA%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%20Improvements%20Committee%20M.ism%2Fmanifest%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Btype%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Bapplication%2Fvnd.ms-sstr%2Bxml%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%5D)%3B%20%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%3C%2FSCRIPT%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FDIV%3E%0A%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111640iFC06F3CC0F73D8EE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3EClick%20on%20Ok%2C%20got%20warning%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3EWarning%3A%20Some%20of%20your%20markup%20was%20stripped%20out%E2%80%A6.%20The%20JavaScript%20is%20removed.%20The%20video%20does%20not%20get%20inserted.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111641i0B000EB7950711B5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3ESolution%3A%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3EUse%20following%20iframe%20tag%20to%20embed%20the%20video%20instead%2C%20which%20eliminate%20the%20use%20of%20Javascript.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CDIV%3E%3CBR%20%2F%3E%3CIFRAME%20width%3D%22%26quot%3B500%26quot%3B%22%20height%3D%22%26quot%3B280%26quot%3B%22%20align%3D%22%26quot%3Bcenter%26quot%3B%22%20src%3D%22%26quot%3B%26lt%3BA%22%20href%3D%22https%3A%2F%2Faka.ms%2Fampembed%3Furl%3Dhttps%3A%2F%2Fsccpssvideo.streaming.mediaservices.windows.net%2Fab838cb0-befe-40bd-b873-f9793e86255d%2FCapital%2520Improvements%2520Committee%2520M.ism%2Fmanifest%26amp%3Bautoplay%3Dfalse%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%22%3E%26amp%3Bamp%3Bamp%3Blt%3Ba%20href%3D%22https%3A%2F%2Faka.ms%2Fampembed%3Furl%3Dhttps%3A%2F%2Fsccpssvideo.streaming.mediaservices.windows.net%2Fab838cb0-befe-40bd-b873-f9793e86255d%2FCapital%2520Improvements%2520Committee%2520M.ism%2Fmanifest%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bautoplay%3Dfalse%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FA%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%22%20target%3D%22_blank%22%26amp%3Bamp%3Bamp%3Bgt%3Bhttps%3A%2F%2Faka.ms%2Fampembed%3Furl%3Dhttps%3A%2F%2Fsccpssvideo.streaming.mediaservices.windows.net%2Fab838cb0-befe-40bd-b873-f9793e86255d%2FCapital%2520Improvements%2520Committee%2520M.ism%2Fmanifest%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bautoplay%3Dfalse%26amp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FA%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%26amp%3Bamp%3Bamp%3Blt%3B%2Fa%26amp%3Bamp%3Bamp%3Bgt%3B%3B%20frameborder%3D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Bno%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%3C%2FIFRAME%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FDIV%3E%0A%3CP%3E%3CBR%20%2F%3EBefore%20you%20copy%20and%20paste%20above%20html%20source%20to%20the%20note%20field%2C%20go%20to%20Site%20Settings%20and%20make%20modification%20to%20the%20below%20setting%20first%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3EUnder%20%22Site%20Collection%20Administration%22%20%3CBR%20%2F%3E%3CBR%20%2F%3E-%20Go%20to%20Html%20Field%20Security%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3E-%20Select%20%E2%80%9CPermit%20contributors%20to%20insert%20iframes%20from%20the%20following%20list%20of%20external%20domains%20into%20pages%20on%20this%20site%E2%80%9D%20and%20Add%20%E2%80%9Caka.ms%E2%80%9D%20for%20Allow%20iframes%20from%20this%20domain%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111642iA45DDC1A46B8E4F2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThen%20copy%20the%20iframe%20html%20tag%20to%20the%20list%20field%20as%20shown%20below.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111643iE95A2219B7D6F33E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3ESave%20the%20list%20item%2C%20browse%20to%20the%20list%2C%20and%20you%20should%20be%20able%20to%20see%20the%20video.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111644i66F90D65A1052698%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-510072%22%20slang%3D%22en-US%22%3E%3CP%3EFirst%20published%20on%20TECHNET%20on%20Apr%2019%2C%202018%20This%20post%20is%20a%20contribution%20from%20Jing%20Wang%2C%20an%20engineer%20with%20the%20SharePoint%20Developer%20Support%20teamProblem%20Description%3ASharePoint%20site%20user%20created%20a%20custom%20list%20and%20added%20a%20multiple%20line%20of%20text%20field%20called%20%E2%80%9Cnote%E2%80%9D%2C%20which%20is%20used%20to%20embed%20a%20video.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-510072%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Sep 01 2020 04:02 PM
Updated by: