Skip to content

Commit

Permalink
feature: add video description
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowsith committed Feb 10, 2023
1 parent 93daa11 commit f6e74c3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mattermost-vimeo",
"version": "1.0.0",
"version": "1.0.1",
"description": "",
"main": "webpack.config.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "Mattermost web app plugin to have an embedded videoplayer for Vimeo urls",
"homepage_url": "https://github.com/Shadowsith/mattermost-plugin-vimeo",
"support_url": "https://github.com/Shadowsith/mattermost-plugin-vimeo/issues",
"release_notes_url": "https://github.com/Shadowsith/mattermost-plugin-vimeo/releases/tag/1.0.0",
"version": "1.0.0",
"release_notes_url": "https://github.com/Shadowsith/mattermost-plugin-vimeo/releases/tag/1.0.1",
"version": "1.0.1",
"webapp": {
"bundle_path": "main.js"
},
Expand Down
12 changes: 11 additions & 1 deletion src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ class PostWillRenderEmbed extends React.Component {

render() {
let title = '';
let description = '';
const iframeWidth = PostWillRenderEmbed.plugin.props.iframeWidth;
const iframeHeight = PostWillRenderEmbed.plugin.props.iframeHeight;

try {
title = this.props.embed.data.title;
description = this.props.embed.data.description;
} catch {
}

Expand All @@ -22,7 +24,15 @@ class PostWillRenderEmbed extends React.Component {

return (
<div>
<h5>{title}</h5>
<h5>
Vimeo -&nbsp;
<a href={this.props.embed.url} target="_blank">
{title}
</a>
</h5>
<div>
<small>{description}</small>
</div>
<iframe src={url} width={iframeWidth} height={iframeHeight}>
</iframe>
</div>
Expand Down

0 comments on commit f6e74c3

Please sign in to comment.