-
-
Notifications
You must be signed in to change notification settings - Fork 7k
feat(media): support audio and video tag with multi sources #1618
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
Merged
cotes2020
merged 10 commits into
cotes2020:master
from
MrMurdock11:feature/support-audio-with-multi-sources
Apr 4, 2024
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f17d6d3
feat(embed): support audio and video tag with multi sources
MrMurdock11 566ec6e
chore(embed): rename filenames
MrMurdock11 a38a611
chore(post): update information in documentation
MrMurdock11 68099e7
chore(embed): implement all code review suggestions
MrMurdock11 f5fbb57
chore(embed): remove many include calls and use instead data
MrMurdock11 9850488
chore(embed): change extnames prop to types and update documentation
MrMurdock11 e257438
chore(embed): extend media list, remove img_path from video and typo fix
MrMurdock11 9e0ae20
chore(media): change media_type prop, typo fix, refactor templates
MrMurdock11 a2f6cc7
chore(media): change push method to prepend for types
MrMurdock11 e83bdce
chore(media): change the sources render implementation
MrMurdock11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
- extension: mp3 | ||
mime_type: mpeg | ||
- extension: mov | ||
mime_type: quicktime | ||
- extension: avi | ||
mime_type: x-msvideo | ||
- extension: mkv | ||
mime_type: x-matroska | ||
- extension: ogv | ||
mime_type: ogg | ||
- extension: weba | ||
mime_type: webm | ||
- extension: 3gp | ||
mime_type: 3gpp | ||
- extension: 3g2 | ||
mime_type: 3gpp2 | ||
- extension: mid | ||
mime_type: midi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{% assign src = include.src | strip %} | ||
{% assign title = include.title | strip %} | ||
{% assign types = include.types | default: '' | strip | split: '|' %} | ||
|
||
{% unless src contains '://' %} | ||
{%- capture src -%} | ||
{% include img-url.html src=src %} | ||
MrMurdock11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
{%- endcapture -%} | ||
{% endunless %} | ||
|
||
<p> | ||
<audio class="embed-audio" controls> | ||
{% assign extension = src | split: '.' | last %} | ||
{% assign types = extension | concat: types %} | ||
|
||
{% assign ext_size = extension | size %} | ||
{% assign src_size = src | size %} | ||
{% assign slice_size = src_size | minus: ext_size %} | ||
|
||
{% assign filepath = src | slice: 0, slice_size %} | ||
|
||
{% for type in types %} | ||
{% assign src = filepath | append: type %} | ||
{% assign media_item = site.data.media | find: 'extension', type %} | ||
{% assign mime_type = media_item.mime_type | default: type %} | ||
<source src="{{ src }}" type="audio/{{ mime_type }}"> | ||
{% endfor %} | ||
|
||
Your browser does not support the audio tag. Here is a | ||
<a href="{{ src | strip }}">link to the audio file</a> instead. | ||
</audio> | ||
{% if title %} | ||
<em>{{ title }}</em> | ||
{% endif %} | ||
</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.