Skip to content

Commit

Permalink
Added player UI
Browse files Browse the repository at this point in the history
  • Loading branch information
railsjack committed Jul 20, 2019
1 parent 065ff02 commit fe2bd53
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
<div class="tutorial-player">
<div class="list-wrapper">
<select id="tutorialList" class="list"></select>
<button class="list-load-button" onclick="TutorialList.load()">...</button>
</div>
<div class="player-wrapper">
<video id="video_player" class="player" controls width="100%" poster="" preload="none">
<video id="video_player" class="player" controls width="100%" height="100%" poster="" preload="none">
<source src="" type='video/mp4' />
<track kind="captions" id="playerCaption" src="" srclang="en" label="English">
</track>
Expand Down
23 changes: 16 additions & 7 deletions player/custom.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
html, body {
overflow: hidden;
background-color: #333;
margin: 0; padding: 0px;
width: 100%; height: 100%; }
.tutorial-player {
width: 50%;}
width: calc(100% - 4px); height: calc(100% - 4px); }
.tutorial-player .list-wrapper {
width: 100%; }
width: 100%; height: 25px; margin-bottom: 5px;}
.tutorial-player .list-wrapper .list{
background-color: #333; color: white;
font-size: 12pt;
padding: 3px;
width: 100%;}
.tutorial-player .player-wrapper {
width: 100%;
}
padding: 3px; float: left;
width: calc(100% - 28px); height: 25px; }
.tutorial-player .list-wrapper .list-load-button {
background-color: #333; color: white;
border: solid 1px #aaa;
width: 25px; height: 25px; float: right;}
.tutorial-player .player-wrapper {
width: 100%; height: calc(100% - 33px); }
23 changes: 15 additions & 8 deletions player/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,28 @@ var TutorialList = function () {
return ret.replace(/\-/gi, ' ');
};

var _load = function(){
var _load = function () {
_load_list();
};

var _load_list = function(){
var _load_list = function () {
const cached_data_dir = localStorage.getItem('data_dir')
alert('localStorage data_dir: '+ cached_data_dir)

const app = require('electron').remote.app
var basepath = app.getAppPath();
const dialog = require('electron').remote.dialog
const files = dialog.showOpenDialog(null, {
properties: [ 'openDirectory' ],
defaultPath: '.'
const data_dir = dialog.showOpenDialog(null, {
properties: ['openDirectory'],
defaultPath: basepath
})
console.log(files);
if (data_dir){
localStorage.setItem('data_dir', data_dir)
}
};

var _load_html = function () {

var temp_vtt_file_dir = '';
var optionNode;

Expand Down Expand Up @@ -88,7 +95,7 @@ var TutorialList = function () {


document.ready(function (event) {
TutorialList.load()

tutorialList.addEventListener('change', function (e) {
Player.play(e.target.value)
});
Expand Down

0 comments on commit fe2bd53

Please sign in to comment.