-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed and added screenshot
- Loading branch information
RayTCosgrove
committed
Jul 24, 2019
1 parent
08978b5
commit 44e424d
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
video, input { | ||
display: block; | ||
} | ||
|
||
video{ | ||
width: 100%; | ||
margin-right: auto; | ||
margin-left: auto; | ||
object-fit: cover; | ||
|
||
} | ||
|
||
input { | ||
width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Module.register("MMM-LocalVideoPlayer", { | ||
defaults: {}, | ||
|
||
getStyles: function(){ | ||
return ["Chungus.css"]; | ||
}, | ||
|
||
start: function () {}, | ||
|
||
|
||
getDom: function() { | ||
|
||
var playSelectedFile = function(){ | ||
|
||
var file = this.files[0]; | ||
var type = file.type; | ||
|
||
|
||
|
||
var fileURL = URL.createObjectURL(file); | ||
|
||
var videoNode = document.querySelector('video'); | ||
videoNode.src = fileURL; | ||
|
||
} | ||
|
||
var element = document.createElement("div"); | ||
|
||
var video = document.createElement("video"); | ||
video.autoplay = true; | ||
video.loop = true; | ||
video.controls = true; | ||
|
||
var input = document.createElement("input"); | ||
|
||
|
||
|
||
input.type = "file"; | ||
input.accept = "video/*"; | ||
|
||
input.addEventListener('change', playSelectedFile, false); | ||
|
||
|
||
element.appendChild(input); | ||
element.appendChild(video); | ||
|
||
return element; | ||
|
||
}, | ||
|
||
notificationReceived: function() {}, | ||
socketNotificationReceived: function() {}, | ||
}) | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.