-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Enhance support for bilibili videos in responsive video helper, and add corresponding doc * Apply @iBug's review in #2522 * Fix danmaku in page hero video * Update video to use case..when for iframe src * Update CHANGELOG and history Co-authored-by: Anran <51769728+ALeafWolf@users.noreply.github.com> Co-authored-by: Michael Rose <mmistakes@users.noreply.github.com>
- Loading branch information
1 parent
8711be9
commit 42c4df6
Showing
5 changed files
with
50 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,4 +1,2 @@ | ||
{% capture video_id %}{{ page.header.video.id }}{% endcapture %} | ||
{% capture video_provider %}{{ page.header.video.provider }}{% endcapture %} | ||
|
||
{% include video id=video_id provider=video_provider %} | ||
{% assign video = page.header.video %} | ||
{% include video id=video.id provider=video.provider danmaku=video.danmaku %} |
This file contains 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 |
---|---|---|
@@ -1,15 +1,24 @@ | ||
{% capture video_id %}{{ include.id }}{% endcapture %} | ||
{% capture video_provider %}{{ include.provider }}{% endcapture %} | ||
{% capture video_danmaku %}{{ include.danmaku | default: 0 }}{% endcapture %} | ||
|
||
{% capture video_src %} | ||
{% case video_provider %} | ||
{% when "vimeo" %} | ||
https://player.vimeo.com/video/{{ video_id }}?dnt=true | ||
{% when "youtube" %} | ||
https://www.youtube-nocookie.com/embed/{{ video_id }} | ||
{% when "google-drive" %} | ||
https://drive.google.com/file/d/{{ video_id }}/preview | ||
{% when "bilibili" %} | ||
https://player.bilibili.com/player.html?bvid={{ video_id }}&page=1&as_wide=1&high_quality=1&danmaku={{ video_danmaku }} | ||
{% endcase %} | ||
{% endcapture %} | ||
{% assign video_src = video_src | strip %} | ||
|
||
<!-- Courtesy of embedresponsively.com //--> | ||
<div class="responsive-video-container"> | ||
{% if video_provider == "vimeo" %} | ||
<iframe src="https://player.vimeo.com/video/{{ video_id }}?dnt=true" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> | ||
{% elsif video_provider == "youtube" %} | ||
<iframe src="https://www.youtube-nocookie.com/embed/{{ video_id }}" frameborder="0" allowfullscreen></iframe> | ||
{% elsif video_provider == "google-drive" %} | ||
<iframe src="https://drive.google.com/file/d/{{ video_id }}/preview" frameborder="0" allowfullscreen></iframe> | ||
{% elsif video_provider == "bilibili" %} | ||
<iframe src="https://player.bilibili.com/player.html?bvid={{ video_id }}&page=1&as_wide=1&high_quality=1&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe> | ||
{% endif %} | ||
</div> | ||
{% unless video_src == "" %} | ||
<div class="responsive-video-container"> | ||
<iframe src="{{ video_src }}" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe> | ||
</div> | ||
{% endunless %} |
This file contains 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 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