4.2 Retrieve the Embed Code for a Video

In this example, the embed code for a video with a specified URL is retrieved.

Request:

 <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
   <Actions>
     <StaticMethod TypeId="{999f0b44-5022-4c04-a0c3-d0705e44395f}" Name="GetEmbedCode" Id="1">
       <Parameters>
         <Parameter Type="String">/libraryName/videoName</Parameter>
         <Parameter TypeId="{294cf1eb-cef4-49e0-b114-648abb3916af}">
           <Property Name="AutoPlay" Type="Boolean">false</Property>
           <Property Name="DisplayTitle" Type="Boolean">true</Property>
           <Property Name="LinkToOwnerProfilePage" Type="Boolean">true</Property>
           <Property Name="LinkToVideoHomePage" Type="Boolean">true</Property>
           <Property Name="Loop" Type="Boolean">false</Property>
           <Property Name="PixelHeight" Type="UInt32">240</Property>
           <Property Name="PixelWidth" Type="UInt32">320</Property>
           <Property Name="PreviewImagePath" Type="String">/libraryName/previewImage.jpg</Property>
           <Property Name="StartTime" Type="UInt32">10</Property>
         </Parameter>
       </Parameters>
     </StaticMethod>
   </Actions>
   <ObjectPaths /></Request>

Response:

 [
 {
     "SchemaVersion": "15.0.0.0", "LibraryVersion": "15.0.3410.1000", "ErrorInfo": null
 }, 1, "<iframe type='text\u002fhtml' width='320' height='240' src='http:\u002f\u002fserverName\u002f_layouts\u002f15\u002fvideoembedplayer.aspx?site=e233b4fd10cc40f493fa245f49717531&amp;web=44aa6759312640999cd0e372b622c813&amp;folder=ccd17bc6952f41f9a701df4b52f613cb&amp;img=%2FlibraryName%2FpreviewImage%2Ejpg&amp;t=10&amp;title=1&amp;lHome=1&amp;lOwner=1' data-title='videoName' data-description='' data-duration='100'><\u002fiframe>"
 ]