Add width and height to linkPreviewTypeEmbeddedAudioPlayer.

This commit is contained in:
levlam 2024-07-28 22:06:46 +03:00
parent 4d67813e67
commit 65057a9802
2 changed files with 8 additions and 5 deletions

View File

@ -2614,15 +2614,17 @@ linkPreviewTypeDocument document:document author:string = LinkPreviewType;
//@thumbnail Thumbnail of the audio; may be null if unknown
//@duration Duration of the audio, in seconds
//@author Author of the audio
linkPreviewTypeEmbeddedAudioPlayer url:string thumbnail:photo duration:int32 author:string = LinkPreviewType;
//@width Expected width of the embedded player
//@height Expected height of the embedded player
linkPreviewTypeEmbeddedAudioPlayer url:string thumbnail:photo duration:int32 author:string width:int32 height:int32 = LinkPreviewType;
//@description The link is a link to a video player
//@url URL of the external video player
//@thumbnail Thumbnail of the video; may be null if unknown
//@duration Duration of the video, in seconds
//@author Author of the video
//@width Expected width of the preview
//@height Expected height of the preview
//@width Expected width of the embedded player
//@height Expected height of the embedded player
linkPreviewTypeEmbeddedVideoPlayer url:string thumbnail:photo duration:int32 author:string width:int32 height:int32 = LinkPreviewType;
//@description The link is a link to an invoice

View File

@ -1543,7 +1543,7 @@ td_api::object_ptr<td_api::LinkPreviewType> WebPagesManager::get_link_preview_ty
if (web_page->type_ == "audio") {
return td_api::make_object<td_api::linkPreviewTypeEmbeddedAudioPlayer>(
web_page->embed_url_, get_photo_object(td_->file_manager_.get(), web_page->photo_), web_page->duration_,
web_page->author_);
web_page->author_, web_page->embed_dimensions_.width, web_page->embed_dimensions_.height);
}
if (web_page->type_ == "video") {
return td_api::make_object<td_api::linkPreviewTypeEmbeddedVideoPlayer>(
@ -1836,7 +1836,8 @@ td_api::object_ptr<td_api::linkPreview> WebPagesManager::get_link_preview_object
}
return td_api::make_object<td_api::linkPreview>(
web_page->url_, web_page->display_url_, web_page->site_name_, web_page->title_,
get_formatted_text_object(td_->user_manager_.get(), description, true, duration == 0 ? std::numeric_limits<int32>::max() : duration),
get_formatted_text_object(td_->user_manager_.get(), description, true,
duration == 0 ? std::numeric_limits<int32>::max() : duration),
std::move(link_preview_type), web_page->has_large_media_, show_large_media, show_media_above_description,
skip_confirmation, invert_media, instant_view_version);
}