Skip to content

Commit

Permalink
Added seekbar
Browse files Browse the repository at this point in the history
  • Loading branch information
railsjack committed Aug 28, 2019
1 parent f461d6f commit ff80f8b
Show file tree
Hide file tree
Showing 231 changed files with 65,053 additions and 6 deletions.
8 changes: 5 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<head>
<title>React Native Tutorial</title>
<link rel="stylesheet" type="text/css" href="player/custom.css?v1" />
<link rel="stylesheet" href="player/media-element/build/mediaelementplayer.css">
</head>

<body>
Expand All @@ -19,19 +20,20 @@
</div>
<div class="player-wrapper">
<div id="video_title" class="video-title"></div>
<video id="video_player" class="player" controls width="100%" height="100%" poster="" preload="none">
<video id="video_player" controls class="player" width="100%" height="100%" poster="" preload="none">
<source src="" type='video/mp4' />
<track kind="captions" id="playerCaption" src="" srclang="en" label="English">
</track>
</video>
<div id="seekbar" class="seekbar">
<!-- <div id="seekbar" class="seekbar">
<span id="seekbar_pos" class="seekbar-pos"></span>
</div>
</div> -->
</div>
</div>

</body>

<script src="player/media-element/build/mediaelement-and-player.js"></script>
<script src="player/custom.js?v3"></script>

</html>
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function initialize () {
title: app.getName(),
webPreferences: {
nodeIntegration: true,
devTools: false
devTools: true
}
}

Expand Down
2 changes: 0 additions & 2 deletions player/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ html, body {
background: rgba(0,0,0,0.5);
margin: 0 auto;}
.tutorial-player .player-wrapper .seekbar {
display: none;
width: calc(100% - 65px); height: 5px;
background-color: #ddd; cursor: pointer;
border-radius: 3px;
Expand All @@ -40,4 +39,3 @@ html, body {
width: 15px; height: 15px;
border-radius: 50%;
background-color: white; }

21 changes: 21 additions & 0 deletions player/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,24 @@ class Player {
this.playerUI = document.getElementById('video_player')
this.captionUI = document.getElementById('playerCaption')
this.titleUI = document.getElementById('video_title')

return;
new MediaElementPlayer(this.playerUI, {
stretching: 'auto',
pluginPath: 'player/media-elements/build/',
success: function (media) {
var renderer = document.getElementById(media.id + '-rendername');

media.addEventListener('loadedmetadata', function () {

});

media.addEventListener('error', function (e) {

});
}
});

}

bindEvents = (evName, callback) => {
Expand Down Expand Up @@ -144,6 +162,9 @@ class TutorialList {
}

setDir = function () {
// const win = require('electron').remote.getCurrentWindow();
// win.setFullScreen(true);
// return;
const app = require('electron').remote.app
var basepath = Helper.getListDir() || app.getAppPath()
const dialog = require('electron').remote.dialog
Expand Down
10 changes: 10 additions & 0 deletions player/media-element/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"comments": false,
"presets": [
["env", {
"targets": {
"browsers": ["last 5 versions", "ie > 10", "ios > 7", "android > 3"]
}
}]
]
}
20 changes: 20 additions & 0 deletions player/media-element/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"env": {
"es6": true,
"browser": true,
"mocha": true,
"node": true,
"jquery": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {
"no-console": 0,
"no-undef" : 0,
"no-case-declarations": 0,
"no-empty": 0
}
}
13 changes: 13 additions & 0 deletions player/media-element/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* text=auto eol=lf

*.jar binary
*.mp3 binary
*.mp4 binary
*.ogv binary
*.png binary
*.webm binary
*.swf binary
*.swc binary
*.fla binary
*.xap binary

20 changes: 20 additions & 0 deletions player/media-element/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# silverlight stuff
src/silverlight/obj/*
src/silverlight/Bin/*
build/AppManifest.xaml
build/SilverlightMediaElementTestPage.html
build/SilverlightMediaElement.pdb
build/SilverlightMediaElement.dll
tests/*
newfeatures/*
/mejs3/
node_modules
local-build
# PhpStorm/WebStorm configuration
.idea
media/*
!media/README
src/flash/flex_sdk_*
coverage
npm-debug.log
tmp
35 changes: 35 additions & 0 deletions player/media-element/.stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"plugins": [
"stylelint-order"
],
"rules": {
"color-hex-case": ["lower"],
"color-hex-length": "short",
"declaration-block-no-duplicate-properties": [
true,
{
"ignore": [
"consecutive-duplicates-with-different-values"
]
}
],
"function-comma-space-after": "always-single-line",
"function-comma-space-before": "never",
"indentation": 4,
"length-zero-no-unit": true,
"number-leading-zero": "always",
"number-no-trailing-zeros": true,
"order/order": [
"custom-properties",
"declarations"
],
"order/properties-alphabetical-order": true,
"property-case": "lower",
"property-no-unknown": true,
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-list-comma-newline-after": "always",
"shorthand-property-no-redundant-values": true,
"string-quotes": "single"
}
}
6 changes: 6 additions & 0 deletions player/media-element/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- node
before_install:
- "curl -L http://git.io/ejPSng | /bin/sh"
after_success: 'npm run coveralls'
5 changes: 5 additions & 0 deletions player/media-element/.versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
johndyer:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Loading

0 comments on commit ff80f8b

Please sign in to comment.