DocumentBuilderInsertOnlineVideo Method (String, Double, Double) |
Inserts an online video object into the document and scales it to the specified size.
Namespace:
Aspose.Words
Assembly:
Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntaxpublic Shape InsertOnlineVideo(
string videoUrl,
double width,
double height
)
Public Function InsertOnlineVideo (
videoUrl As String,
width As Double,
height As Double
) As Shape
public:
Shape^ InsertOnlineVideo(
String^ videoUrl,
double width,
double height
)
member InsertOnlineVideo :
videoUrl : string *
width : float *
height : float -> Shape
Parameters
- videoUrl
- Type: SystemString
The URL to the video. - width
- Type: SystemDouble
The width of the image in points. Can be a negative or zero value to request 100% scale. - height
- Type: SystemDouble
The height of the image in points. Can be a negative or zero value to request 100% scale.
Return Value
Type:
ShapeThe image node that was just inserted.
RemarksYou can change the image size, location, positioning method and other settings using the
Shape object returned by this method.
Insertion of online video from the following resources is supported:
- https://www.youtube.com/
- https://vimeo.com/
If your online video is not displaying correctly, use InsertOnlineVideo(String, String, Byte, Double, Double), which accepts custom embedded html code.
The code for embedding video can vary between providers, consult your corresponding provider of choice for details.
ExamplesShow how to insert online video into a document using video url
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
const string url = "https://youtu.be/t_1LYZ102RA";
const double width = 360;
const double height = 270;
builder.InsertOnlineVideo(url, width, height);
See Also