Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강연욱
/
myYoutube
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
2
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Flare-k
2020-06-24 17:22:22 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ffee8e248a0e78baaf5a41fcb88f5933d27d4a8b
ffee8e24
1 parent
b812dbba
Connect with Mongo Atlas
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
3 deletions
app.js
assets/js/videoPlayer.js
db.js
package.json
static/main.js
app.js
View file @
ffee8e2
import
"@babel/polyfill"
;
import
dotenv
from
"dotenv"
;
import
express
from
"express"
;
import
morgan
from
"morgan"
;
...
...
assets/js/videoPlayer.js
View file @
ffee8e2
/* eslint-disable no-console */
import
getBlobDuration
from
"get-blob-duration"
;
const
videoContainer
=
document
.
getElementById
(
"jsVideoPlayer"
);
const
videoPlayer
=
document
.
querySelector
(
"#jsVideoPlayer video"
);
const
playBtn
=
document
.
getElementById
(
"jsPlayButton"
);
...
...
@@ -89,8 +92,12 @@ const formatDate = (seconds) => {
function
getCurrentTime
()
{
currentTime
.
innerHTML
=
formatDate
(
Math
.
floor
(
videoPlayer
.
currentTime
));
}
function
setTotalTime
()
{
const
totalTimeString
=
formatDate
(
videoPlayer
.
duration
);
async
function
setTotalTime
()
{
const
blob
=
await
fetch
(
videoPlayer
.
src
).
then
((
response
)
=>
response
.
blob
());
const
duration
=
await
getBlobDuration
(
blob
);
console
.
log
(
duration
);
const
totalTimeString
=
formatDate
(
duration
);
totalTime
.
innerHTML
=
totalTimeString
;
setInterval
(
getCurrentTime
,
1000
);
}
...
...
db.js
View file @
ffee8e2
...
...
@@ -4,7 +4,7 @@ import dotenv from "dotenv";
dotenv
.
config
();
mongoose
.
connect
(
process
.
env
.
MONGO_URL
,
{
mongoose
.
connect
(
process
.
env
.
MONGO_URL
_PROD
,
{
useNewUrlParser
:
true
,
useFindAndModify
:
false
,
});
...
...
package.json
View file @
ffee8e2
...
...
@@ -16,6 +16,7 @@
"author"
:
"Kang Yeon Wook"
,
"license"
:
"ISC"
,
"dependencies"
:
{
"@babel/cli"
:
"^7.10.3"
,
"@babel/core"
:
"^7.9.6"
,
"@babel/node"
:
"^7.8.7"
,
"@babel/polyfill"
:
"^7.10.1"
,
...
...
@@ -32,6 +33,7 @@
"express"
:
"^4.17.1"
,
"express-session"
:
"^1.17.1"
,
"extract-text-webpack-plugin"
:
"^4.0.0-beta.0"
,
"get-blob-duration"
:
"^1.1.1"
,
"helmet"
:
"^3.22.0"
,
"mongoose"
:
"^5.9.15"
,
"morgan"
:
"^1.10.0"
,
...
...
static/main.js
View file @
ffee8e2
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment