Skip to content
Snippets Groups Projects
Commit a5f91356 authored by Andreas Valder's avatar Andreas Valder
Browse files

removed mediaelementjs, added videojs

parent 83d411d4
Branches
No related tags found
No related merge requests found
videojs.addLanguage("zh-CN",{
"Play": "播放",
"Pause": "暂停",
"Current Time": "当前时间",
"Duration Time": "时长",
"Remaining Time": "剩余时间",
"Stream Type": "媒体流类型",
"LIVE": "直播",
"Loaded": "加载完毕",
"Progress": "进度",
"Fullscreen": "全屏",
"Non-Fullscreen": "退出全屏",
"Mute": "静音",
"Unmute": "取消静音",
"Playback Rate": "播放码率",
"Subtitles": "字幕",
"subtitles off": "字幕关闭",
"Captions": "内嵌字幕",
"captions off": "内嵌字幕关闭",
"Chapters": "节目段落",
"You aborted the media playback": "视频播放被终止",
"A network error caused the media download to fail part-way.": "网络错误导致视频下载中途失败。",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "视频因格式不支持或者服务器或网络的问题无法加载。",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。",
"No compatible source was found for this media.": "无法找到此视频兼容的源。",
"The media is encrypted and we do not have the keys to decrypt it.": "视频已加密,无法解密。"
});
\ No newline at end of file
videojs.addLanguage("zh-TW",{
"Play": "播放",
"Pause": "暫停",
"Current Time": "目前時間",
"Duration Time": "總共時間",
"Remaining Time": "剩餘時間",
"Stream Type": "串流類型",
"LIVE": "直播",
"Loaded": "載入完畢",
"Progress": "進度",
"Fullscreen": "全螢幕",
"Non-Fullscreen": "退出全螢幕",
"Mute": "靜音",
"Unmute": "取消靜音",
"Playback Rate": " 播放速率",
"Subtitles": "字幕",
"subtitles off": "關閉字幕",
"Captions": "內嵌字幕",
"captions off": "關閉內嵌字幕",
"Chapters": "章節",
"You aborted the media playback": "影片播放已終止",
"A network error caused the media download to fail part-way.": "網路錯誤導致影片下載失敗。",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "影片因格式不支援或者伺服器或網路的問題無法載入。",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "由於影片檔案損毀或是該影片使用了您的瀏覽器不支援的功能,播放終止。",
"No compatible source was found for this media.": "無法找到相容此影片的來源。",
"The media is encrypted and we do not have the keys to decrypt it.": "影片已加密,無法解密。"
});
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
File added
This diff is collapsed.
This diff is collapsed.
.vjs-resolution-button .vjs-menu-icon:before {
content: '\f110';
font-family: VideoJS;
font-weight: normal;
font-style: normal;
font-size: 1.8em;
line-height: 1.67em;
}
.vjs-resolution-button .vjs-resolution-button-label {
font-size: 1em;
line-height: 3em;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-align: center;
box-sizing: inherit;
}
.vjs-resolution-button .vjs-menu .vjs-menu-content {
width: 4em;
left: 50%; /* Center the menu, in it's parent */
margin-left: -2em; /* half of width, to center */
}
.vjs-resolution-button .vjs-menu li {
text-transform: none;
font-size: 1em;
}
This diff is collapsed.
......@@ -17,11 +17,16 @@
<link href="{{url_for('static', filename='bootstrap/bootstrap.css')}}" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='style.css')}}">
<link rel="stylesheet" href="{{url_for('static', filename='font-awesome/css/font-awesome.min.css')}}">
<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='videojs/video-js.css')}}">
<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='videojs/videojs-resolution-switcher.css')}}">
<script src="{{url_for('static', filename='jquery.js')}}"></script>
<script src="{{url_for('static', filename='bootstrap/bootstrap.js')}}"></script>
<script src="{{url_for('static', filename='js.cookie.js')}}"></script>
{%if ismod() %}<script src="{{url_for('static', filename='moderator.js')}}"></script>{% endif %}
<script src="{{url_for('static', filename='videojs/video.js')}}"></script>
<script src="{{url_for('static', filename='videojs/ie8/videojs-ie8.js')}}"></script>
<script src="{{url_for('static', filename='videojs/videojs-resolution-switcher.js')}}"></script>
</head>
<body>
{% block navbar %}
......
......@@ -10,6 +10,6 @@ WEBVTT
{% else %}
00:00:00.000 --> 23:59:59.999
Video
none
{% endfor %}
......@@ -41,7 +41,7 @@
<th></th>
</tr>
{% for c in chapters|sort(attribute='time') %}
<tr onclick=" $('.player video')[0].setCurrentTime({{c['time']}})">
<tr onclick="videojs('videoplayer').currentTime({{c['time']}})">
<td>{{ loop.index }}</td>
<td>{{ vtttime(c['time']) }}</td>
<td>{{ valueeditor(['chapters',c.id,'text'],c['text']) }}</td>
......@@ -65,7 +65,7 @@ $(function() {
var zero = places - num.toString().length + 1;
return Array(+(zero > 0 && zero)).join("0") + num;
};
var timestamp = $('.player video')[0].currentTime
var timestamp = videojs('videoplayer').currentTime()
var h = zeropad( Math.trunc(timestamp/3600),2);
var m = zeropad( Math.trunc((timestamp%3600)/60),2);
var s = zeropad( Math.trunc(timestamp%60),2);
......
......@@ -42,25 +42,12 @@
{% endmacro %}
{% macro player(lecture, videos) %}
<script src="{{url_for('static', filename='mediaelementjs/mediaelement-and-player.js')}}"></script>
<script src="{{url_for('static', filename='mediaelementjs/mep-feature-sourcechooser.js')}}"></script>
<link rel="stylesheet" href="{{url_for('static', filename='mediaelementjs/mediaelementplayer.css')}}"/>
<video class="player" width="640" height="360" style="width: 100%; height: 100%;" controls="controls">
<video id="videoplayer" class="video-js vjs-default-skin vjs-16-9 vjs-big-play-centered" width="640" height="320" controls data-setup='{ "plugins" : {"videoJsResolutionSwitcher": { "ui": true, "default": "720p", "dynamicLabel": true } }, "customControlsOnMobile": true, "playbackRates": [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4] }'>
{% for v in videos|sort(attribute='player_prio', reverse=True) %}
<source type="video/mp4" src="{{ config.VIDEOPREFIX }}/{{ v.path }}" title="{{ v.format_description }}"/>
<source type="video/mp4" src="{{ config.VIDEOPREFIX }}/{{ v.path }}" label="{{ v.format_description }}"/>
{% endfor %}
<track srclang="en" kind="chapters" src="{{ url_for('chapters',lectureid=lecture.id) }}" />
</video>
<script>
$(function($)
{
var player = new MediaElementPlayer('.player', {
features: [
'playpause', 'current', 'progress', 'duration', 'volume', 'tracks', 'sourcechooser', 'speed', 'fullscreen',
],
});
});
</script>
{% endmacro %}
{% macro course_list_item(course,show_semester=False) %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment