
Embedding videos in screensteps code#
The following code example publishes a post that contains an embedded video. This is a root post to the user's feed, so specifyįeedManager.CreatePost(null, postCreationData) Ĭonsole.Write("The post was published.") Ĭonsole.Write("Error publishing the post: " + ex.Message) SocialFeedManager feedManager = new SocialFeedManager(clientContext) Get the context and the SocialFeedManager instance.ĬlientContext clientContext = new ClientContext(serverUrl)

PostCreationData.Attachment = attachment PostCreationData.ContentText = "Look at this!" SocialPostCreationData postCreationData = new SocialPostCreationData()

Define properties for the post and add the attachment. SocialAttachment attachment = new SocialAttachment()ĪttachmentKind = SocialAttachmentKind.Image, Replace the following placeholder values with the actual values.Ĭonst string serverUrl = " const string imageUrl = " // Define the image attachment that you want to embed in the post. The SocialAttachment specifies the SocialAttachmentKind.Image field and the URI of the image file.Īdd the image object to the Attachment property of the SocialPostCreationData object that's used to create the post.Ĭhange the placeholder values for the URL variables before you run the code. It shows how to:Ĭreate a SocialAttachment object that represents the image. The following code example publishes a post that contains an embedded image. Example: Embed an image in a post in SharePoint
Embedding videos in screensteps how to#
For more information, see Plan digital asset libraries in SharePoint and Configure SharePoint to use Office Online.įor instructions about how to set up your development environment and create a console application, see How to: Create and delete posts and retrieve the social feed by using the. To use the document example in an on-premises environment, Office Online must be configured in the environment. To use the video example, the video feature must be enabled on the server and the video file must be stored in an asset library. To use the examples in this article, you'll need to upload an image, a video, and a document. These examples are from a console application that uses the following SharePoint assemblies:

The code examples in this article show how to add image, video, and document attachments to microblog posts. Prerequisites for using the code examples to add attachments to a post See Additional resources for links to documentation for related APIs. If you're using another API, such as the JavaScript object model, the object names or corresponding API might be different. The API described in this article is from the. For more information, see How to: Include mentions, tags, and links to sites and documents in posts in SharePoint. To add a mention, tag, or link to a post's content, you add a SocialDataItem object to the SocialPostCreationData.ContentItems property.
