Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internally uploaded video embeddind as HTML5 player #7

Closed
l0co opened this issue Nov 30, 2016 · 8 comments
Closed

Internally uploaded video embeddind as HTML5 player #7

l0co opened this issue Nov 30, 2016 · 8 comments

Comments

@l0co
Copy link

l0co commented Nov 30, 2016

Would be nice to have default rules to embed videos uploaded to the posts. Here is example working with MP4:

Regex:

<a href="/uploads/files/(.*).mp4">[^<]*</a>

Replacement:

<video id="$1" src="/uploads/files/$1.mp4" controls style="width:800px"></video>
<div><small><a href="/uploads/files/$1.mp4" target="_blank">Download video</a></small></div>
@NicolasSiver
Copy link
Owner

Is it something specific for every forum?

@l0co
Copy link
Author

l0co commented Dec 1, 2016

Yes. It works with every mp4 video uploaded to nodebb from markdown editor. It's easy to write one pattern to support more video formats.

@NicolasSiver
Copy link
Owner

Replacement rule does not use responsive layout provided with the plugin. It could be made in a more reusable fashion and added to Community Rules. Thanks.

@Marlin-Na
Copy link

I used the following rule and it works for me:

Regex:

<a href="/assets/uploads/files/(.*).mp4">[^<]*</a>

Replacement:

<div class='embed-wrapper'><div class='embed-container'>

<video src="/assets/uploads/files/$1.mp4" controls>
Your browser doesn't support HTML5 video.
Please <a href="/assets/uploads/files/$1.mp4">download</a> instead.
</video>

</div></div>

@NicolasSiver Please let me know if you want me to create a pull request to add it to community rules.

@kawhi66
Copy link

kawhi66 commented Jan 15, 2020

I used the following rule and it works for me:

Regex:

<a href="/assets/uploads/files/(.*).mp4">[^<]*</a>

Replacement:

<div class='embed-wrapper'><div class='embed-container'>

<video src="/assets/uploads/files/$1.mp4" controls>
Your browser doesn't support HTML5 video.
Please <a href="/assets/uploads/files/$1.mp4">download</a> instead.
</video>

</div></div>

@NicolasSiver Please let me know if you want me to create a pull request to add it to community rules.

what does $1 means, I don't get it

3 similar comments
@kawhi66
Copy link

kawhi66 commented Jan 15, 2020

I used the following rule and it works for me:

Regex:

<a href="/assets/uploads/files/(.*).mp4">[^<]*</a>

Replacement:

<div class='embed-wrapper'><div class='embed-container'>

<video src="/assets/uploads/files/$1.mp4" controls>
Your browser doesn't support HTML5 video.
Please <a href="/assets/uploads/files/$1.mp4">download</a> instead.
</video>

</div></div>

@NicolasSiver Please let me know if you want me to create a pull request to add it to community rules.

what does $1 means, I don't get it

@kawhi66
Copy link

kawhi66 commented Jan 15, 2020

I used the following rule and it works for me:

Regex:

<a href="/assets/uploads/files/(.*).mp4">[^<]*</a>

Replacement:

<div class='embed-wrapper'><div class='embed-container'>

<video src="/assets/uploads/files/$1.mp4" controls>
Your browser doesn't support HTML5 video.
Please <a href="/assets/uploads/files/$1.mp4">download</a> instead.
</video>

</div></div>

@NicolasSiver Please let me know if you want me to create a pull request to add it to community rules.

what does $1 means, I don't get it

@kawhi66
Copy link

kawhi66 commented Jan 15, 2020

I used the following rule and it works for me:

Regex:

<a href="/assets/uploads/files/(.*).mp4">[^<]*</a>

Replacement:

<div class='embed-wrapper'><div class='embed-container'>

<video src="/assets/uploads/files/$1.mp4" controls>
Your browser doesn't support HTML5 video.
Please <a href="/assets/uploads/files/$1.mp4">download</a> instead.
</video>

</div></div>

@NicolasSiver Please let me know if you want me to create a pull request to add it to community rules.

what does $1 means, I don't get it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants