Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
168b1ae
Saving progress up to Alex's departure
aldahl May 15, 2018
9d94279
Updated readme
hutchibw Aug 27, 2018
e23f6c2
add .gitignore (node_modules)
reynoldsnlp Aug 28, 2018
e759f80
Fix censor box size
Aug 29, 2018
b8c4119
Make script.js compatible with hummedia json
reynoldsnlp Aug 29, 2018
60ce6d8
script to interpolate smooth motion
reynoldsnlp Sep 12, 2018
d177ef6
Implemented new JSON format
bandrus5 Nov 5, 2018
1fb5c8f
Do not require icf file
bandrus5 Nov 24, 2018
777ae69
script to convert hummedia to ic
reynoldsnlp Nov 28, 2018
2245919
move kung -> example
reynoldsnlp Nov 28, 2018
23fff14
move kungfu.vtt into example
reynoldsnlp Nov 28, 2018
8468d24
for converting between HH:MM:SS and secs
reynoldsnlp Nov 30, 2018
245a441
add HH:MM:SS labels to hummedia json
reynoldsnlp Nov 30, 2018
2900910
allow microseconds in hms2s
reynoldsnlp Nov 30, 2018
b86689b
add __pycache__ to .gitignore
reynoldsnlp Nov 30, 2018
c70c6ff
remove debug-print
reynoldsnlp Nov 30, 2018
9d80bbf
Merge pull request #2 from BYU-ODH/new-json-format
reynoldsnlp Nov 30, 2018
eb8d1df
fix regex and add 'blank'
reynoldsnlp Nov 30, 2018
fc9acf7
sort json
reynoldsnlp Nov 30, 2018
fee8b8f
update sort_json.py
reynoldsnlp Jan 7, 2019
709015e
update interpolate for width/height format
reynoldsnlp Feb 20, 2019
0fa4cf1
track eventListeners
Feb 20, 2019
7a66407
don't check callback equality
Feb 20, 2019
6df0443
return function
Feb 20, 2019
92684b3
Events and add braces to if body
Feb 21, 2019
1f7c5a1
remove logs
Feb 21, 2019
e173c32
Merge pull request #3 from BYU-ODH/refactor
reynoldsnlp Mar 4, 2019
95a68bc
Added annotation mode with json reload.
konnorjp Oct 16, 2019
85f084b
player correctly reloads JSON filters and removes event listeners
konnorjp Oct 18, 2019
94c8796
Added AnnotationMode toggle from main splash screen, made play button…
konnorjp Oct 18, 2019
7b4d4ee
added jquery and jquery ui along with reziable and draggable divs
konnorjp Oct 21, 2019
10c0bf8
Added tooltip and made censors draggable and resizable
konnorjp Oct 21, 2019
605534d
Updated annotations when resized
konnorjp Oct 23, 2019
4599758
Added keyUp event for space and left and right arrows, controls remai…
konnorjp Oct 23, 2019
0ba4c5e
open files with icf file, resolves #15
konnorjp Oct 29, 2019
7918520
Fixes toggling of dev tools #6
konnorjp Oct 29, 2019
7e66687
Added issue button, hotkeys now work!, closes #9, closes #5
konnorjp Oct 30, 2019
b894738
censor divs no are interpolated based on boolean
konnorjp Nov 7, 2019
db6fcc4
added comments and changed time determiner for interpolate
konnorjp Nov 7, 2019
ea5df77
censors drag and resize properly, annotations can be saved to json c…
konnorjp Nov 7, 2019
66c2907
Changed css of annotation button #6
konnorjp Nov 7, 2019
84abbb6
Changed the majority of element to JQuery #17
konnorjp Nov 7, 2019
2cd6920
Replaced elements access with JQuery closes #17
konnorjp Nov 8, 2019
dc820a0
Removed comments #17
konnorjp Nov 8, 2019
391316b
Began creating JSON Format documentation #14
konnorjp Nov 8, 2019
1e1ec77
Defined more for json documentation #14
konnorjp Nov 12, 2019
5dfa279
Removed "size" attribute from documentation
konnorjp Nov 13, 2019
435d3b6
Revert "Removed "size" attribute from documentation"
konnorjp Nov 13, 2019
ba904fb
Removed "size" attribute from json documentation #14
konnorjp Nov 13, 2019
c010e91
Added json validation and adjusted json documentation to include labe…
konnorjp Nov 13, 2019
293c32b
Changed display of annotation errors #8
konnorjp Nov 13, 2019
8125fe1
Included amount desc. for censors #14, fixed interpolation #16, added…
konnorjp Nov 13, 2019
e893152
Merge pull request #18 from BYU-ODH/annotation-mode
konnorjp Nov 13, 2019
65934ba
Update README.md to contain info on files
konnorjp Nov 13, 2019
927fd7a
Added comments, updated README.md and changed style (underscore to ca…
konnorjp Nov 14, 2019
5f84bfc
add newline to json output
reynoldsnlp Jan 13, 2020
ef1d1cc
Hides video controls in fullscreen mode
konnorjp Jan 16, 2020
f6ab888
Fullscreen button doesn't appear
konnorjp Jan 16, 2020
9d68248
return and issue buttons hide and event listeners for keys work
konnorjp Jan 17, 2020
9a48c83
Fixed censor error
konnorjp Jan 21, 2020
cd32052
Click event for pausing/playing, and on mousemove controls show up, m…
konnorjp Jan 21, 2020
d913be5
Update style.css
konnorjp Feb 19, 2020
d3c3054
add electron dependency
reynoldsnlp Jun 30, 2021
5208b3c
get rid of orange border
reynoldsnlp Oct 5, 2021
e6da2b5
update electron to v11
Oct 13, 2021
1436101
asdf
reynoldsnlp Mar 8, 2022
516ffb9
electron version
reynoldsnlp Mar 8, 2022
52020ef
formatting
reynoldsnlp Sep 2, 2022
eac689e
hidden dir for mp4s
reynoldsnlp Sep 13, 2022
76a9e54
mv example videos to .ic/
reynoldsnlp Oct 7, 2022
57c4b19
create IC file
reynoldsnlp Apr 10, 2024
ecc4e5c
conditional for annotation file
reynoldsnlp Apr 16, 2024
ee6a95a
updating app to be compatible with electron 33
benrencher Nov 14, 2024
579b81b
updating package.json
benrencher Nov 14, 2024
c43330c
bump electron to 37.2.4
reynoldsnlp Jul 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
__pycache__
185 changes: 185 additions & 0 deletions JSONFormat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
# JSON Format Documentation for Video Annotations

There are five types of video annotations:
1. skip
2. mute
3. blank
4. blur
5. and censors

Each one does something a bit different. When defining the annotations, create
a json file. Within that json file have an array of annotations. Overall the
code should look something like this:

``` json
[
{
"options": {
"label": "Logo 0:00:21 - 0:00:35",
"start": "21",
"end": "35",
"type": "skip",
"details": {}
}
},
{
"options": {
"label": "Words 0:00:37 - 0:00:48",
"start": "37",
"end": "48",
"type": "mute",
"details": {}
}
}
]
```

We now introduce the types of annotations.

## Skip

The skip annotation skips the video forward to a specific time, from the 'start'
time to the 'end' time. Nothing in between the two times will be seen.

### Skip Example
``` json
{
"options": {
"label": "Logo 0:00:21 - 0:00:35",
"start": "21",
"end": "35",
"type": "skip",
"details": {}
}
}
```

## Mute

The mute annotation will mute a section of the video, from the 'start' time to
the 'end' time.

### Mute Example
``` json
{
"options": {
"label": "Words 48:37",
"start": "2917",
"end": "2922",
"type": "mute",
"details": {}
}
}
```

## Blank

The blank annotation will black out the entire screen for a set period of time,
as denoted by the start and end times.

### Blank Example
``` json
{
"options": {
"label": "Bridge 0:00:40 - 0:00:45",
"start": "40",
"end": "45",
"type": "blank",
"details": {}
}
}
```

## Blur

The blur annotation will blur the entire screen for a set period of time,
as denoted by the start and end times.

### Blur Example
``` json
{
"options": {
"label": "Panda 0:00:02 - 0:00:10",
"start": "2",
"end": "10",
"type": "blur",
"details": {}
}
}
```

## Censor

The censor annotation can be used to cover up some sections of the screen. The
position of the censor bar depends on

Each censor has an interpolate boolean, which determines if the program will interpolate
between the censors, which would make the annimation from each position of the
censor a smoother.

There are two types of censors: blur and black. The "blur" censor blurs the image
of a rectangle defined by the `position` value. It is blurred according to the
`amount` value, which ranges from `0px` to infinity, with higher numbers blurring more.
`30px` is a standard amount . The "black" type blacks out a rectangle the as defined by the `position`.

### Censor Examples
#### Solid Color Censor
``` json
{
"options": {
"label": "Sky 0:00:00 - 0:00:13",
"start": "0",
"end": "13",
"type": "censor",
"details": {
"type": "black",
"interpolate": true,
"position": {
"4": [18, 18, 15, 15],
"4.25": [12, 18],
"4.50": [14, 18],
"4.75": [16, 18],
"5.00": [18, 18],
"5.25": [18, 18, 14, 16],
"5.50": [18, 18, 12, 18],
"5.75": [18, 18, 10, 20],
"6.00": [18, 18, 14, 20]
}
}
}
}
```

#### Blur Censor
``` json
{
"options": {
"label": "Sky 0:00:06 - 0:00:19",
"start": "6",
"end": "19",
"type": "censor",
"details": {
"type": "blur",
"interpolate": true,
"amount": "30px",
"position": {
"6": [0, 0, 15, 15],
"8": [10, 10],
"9": [15, 15],
"10.25": [16.00, 16.00],
"10.50": [16.25, 16.25],
"10.75": [16.50, 16.50],
"11.00": [16.75, 16.75],
"11.25": [17.00, 17.00],
"11.50": [17.25, 17.25],
"11.75": [17.50, 17.50],
"12.00": [17.75, 17.75],
"12.25": [18.00, 18.00, 17.1, 17.1],
"12.50": [18.00, 18.00, 17.4, 17.4],
"12.75": [18.00, 18.00, 17.7, 17.7],
"13.00": [18.00, 18.00, 18, 18],
}
}
}
}
```
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,45 @@
# electron_player
An alternative video player for BYU International Cinemas (based on Electron)


## Installation

Install node (actually nvm so you can use npm)
``` shell
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
```

Install electron
``` shell
npm install -g electron
```

Run program
``` shell
electron app.js
```

You may also need to install libgconf using
``` shell
apt-get install libgconf-2-4
```

## Usage
You should have three files before you begin trying to watch a video using electron_player.
```
∟ video.mp4 or video.m4v
∟ video.icf
∟ video.json
```
The names of the files do not need to match. The mp4 or m4v file contains the video. The json file contains the
annotations which will be displayed. For more information on the format of the json file, please refer
to the documentation in the `JSONFormat.md` file. The icf file contains something that looks like the following:
``` json
{
"subtitle": null,
"video": "KungFuPandamv_IC.m4v",
"annotation": "KungFuPandamv_IC.json"
}
```
The `video` property contains the path of the video file. The `annotation` property contains the path of the json file.
The `subtitle` property has not been implemented yet, but would potentially contain the path to the subtitle file.
55 changes: 35 additions & 20 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
var electron = require('electron')
var path = require('path')
const { app, BrowserWindow, ipcMain } = require('electron')
const path = require('path')

// Keep a global reference of the window object so that it isn't garbage collected
var mainWindow = null
const argv = process.argv;
var mainWindow = null;

function createWindow() {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 1000,
height: 780,
fullscreenable: true,
frame: true,
icon: path.join(__dirname, '/resources/filmstrip.png'),
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
preload: path.join(__dirname, 'preload.js')
}
})

// This method will be called when Electron has finished
// initializing and is ready to create browser windows.
electron.app.on('ready', function () {
// Create the Splash Screen window
mainWindow = new electron.BrowserWindow({
width: 1000,
height: 780,
frame: true,
icon: path.join(__dirname, 'filmstrip.png'),
webPreferences: { experimentalFeatures: true}
})
// and load the index.html of the app.
mainWindow.loadURL('file://' + __dirname + '/renderer/player.html')
}

// Dev mode: comment out the following line
// mainWindow.setMenu(null)

mainWindow.loadURL('file://' + __dirname + '/player.html')
})
app.on('ready', createWindow)

ipcMain.on('request-cmd-argv', (event, arg) => {
event.reply('response-cmd-argv', argv)
})

ipcMain.on('toggle-dev-tools', (event, annotationMode) => {
if (annotationMode && !mainWindow.webContents.isDevToolsOpened()) {
mainWindow.webContents.toggleDevTools()
}
else if (!annotationMode && mainWindow.webContents.isDevToolsOpened()) {
mainWindow.webContents.toggleDevTools()
}
})
Loading