Replace Flowplayer with the open source Video.js library

This commit is contained in:
2017-02-02 16:06:41 +01:00
parent bc6f526b72
commit eb02fa5eec
6 changed files with 1340 additions and 1076 deletions

View File

@@ -4,17 +4,32 @@
#node-overlay
section.node-preview.video
#flowplayer_container.is-splash.play-button(
style="{% if node.picture %}background-image:url({{node.picture.thumbnail('l', api=api)}}); background-repeat:no-repeat; {% endif %}")
.fp-startscreen.fp-toggle
a.big-play-button
i.pi-play
.fp-endscreen
a.watch-again.fp-toggle
i.pi-replay
| Watch again
.fp-waiting
i.pi-spin.spin
| {% if node.video_sources %}
video.video-js.vjs-fluid(
controls,
data-setup="{}",
preload="auto",
poster="{% if node.picture %}{{ node.picture.thumbnail('l', api=api) }}{% endif %}")
| {% for source in node.video_sources %}
source(
src="{{ source.src }}",
type="{{ source.type }}")
| {% endfor %}
p.vjs-no-js.
To view this video please enable JavaScript, and consider upgrading to a web browser that
<a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
| {% else %}
.video-dummy.sorry(
style="{% if node.picture %}height: {{ node.picture.height }}px{% endif %}")
| {% if node.picture %}
img.video-dummy-thumbnail(src="{{ node.picture.thumbnail('l', api=api) }}")
| {% endif %}
.video-dummy-content
i.pi-lock.video-dummy-content-icon
.video-dummy-content-text
span Only available to Blender Cloud subscribers.
a(href="{{ url_for('main.join') }}") Support Blender and get awesome stuff. <em>Subscribe now!</em>
| {% endif %}
section.node-details-container.video
@@ -131,23 +146,8 @@ script(type="text/javascript").
var content_type = $("li.node-details-meta-list-item.type").text();
$("li.node-details-meta-list-item.type").text(content_type.substring(content_type.indexOf("/") + 1));
var container = document.getElementById("flowplayer_container");
flowplayer(container, {
key: "{{config.FLOWPLAYER_KEY}}",
embed: false,
splash: true,
{% if node.video_sources %}
clip: {
sources: {{ node.video_sources | safe }}
}
{% else %}
disabled: true
{% endif %}
});
{% if not node.video_sources %}
$('#flowplayer_container, .sorry').click(function() {
$('.sorry').click(function() {
$.get('/403', function(data) {
$('#node-overlay').html(data).addClass('active');
})