forked from bitwave-tv/bitwave
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5fa3dd4
commit 524d607
Showing
5 changed files
with
155 additions
and
40 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
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
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,105 @@ | ||
<template> | ||
<div> | ||
|
||
<v-layout | ||
column | ||
> | ||
<v-flex> | ||
<v-tabs | ||
dark | ||
slider-color="#2196f3" | ||
> | ||
<v-tab> | ||
DISPATCH | ||
</v-tab> | ||
<v-tab> | ||
ARCHIVE | ||
</v-tab> | ||
</v-tabs> | ||
</v-flex> | ||
|
||
<hr class="v-divider theme--light"> | ||
|
||
<v-flex class="px-3 py-2"> | ||
<v-card> | ||
<v-responsive | ||
:aspect-ratio="16/9" | ||
> | ||
<video | ||
playsinline | ||
id="myPlayer" | ||
class="video-js vjs-default-skin" | ||
width="50%" | ||
controls | ||
autoplay | ||
muted | ||
preload="auto" | ||
data-setup='{ "aspectRatio":"16:9" }' | ||
poster="/bitwave_cover.png" | ||
> | ||
<source | ||
src="https://bitwave.tv/stream/murderder/index.m3u8" | ||
type="application/x-mpegURL" | ||
> | ||
</video> | ||
</v-responsive> | ||
</v-card> | ||
</v-flex> | ||
|
||
<v-flex class="px-3"> | ||
<h2>STREAM TITLE</h2> | ||
</v-flex> | ||
|
||
</v-layout> | ||
|
||
</div> | ||
</template> | ||
|
||
<script> | ||
import videojs from 'video.js'; | ||
export default { | ||
components: { | ||
}, | ||
data() { | ||
return { | ||
player: null, | ||
initialized: false, | ||
streams: { | ||
hls: 'https://bitwave.tv/stream/dispatch/', | ||
}, | ||
} | ||
}, | ||
computed: { | ||
}, | ||
methods: { | ||
playerInitialize(){ | ||
this.player = videojs('myPlayer', { | ||
liveui: true, | ||
}); | ||
this.initialized = true; | ||
}, | ||
playerDispose(){ | ||
if (this.initialized) this.player.dispose(); | ||
}, | ||
}, | ||
mounted() { | ||
// if (process.browser) window.videojs = require('video.js'); | ||
this.playerInitialize(); | ||
// window.playerEvents = this; | ||
console.log('this is current player instance object:', this.player); | ||
}, | ||
beforeDestroy() { | ||
this.playerDispose(); | ||
}, | ||
} | ||
</script> |
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 |
---|---|---|
@@ -1,34 +1,44 @@ | ||
const express = require('express') | ||
const consola = require('consola') | ||
const { Nuxt, Builder } = require('nuxt') | ||
const app = express() | ||
|
||
// Import and Set Nuxt.js options | ||
let config = require('../nuxt.config.js') | ||
config.dev = !(process.env.NODE_ENV === 'production') | ||
|
||
async function start() { | ||
// Init Nuxt.js | ||
const nuxt = new Nuxt(config) | ||
|
||
const { host, port } = nuxt.options.server | ||
|
||
// Build only in dev mode | ||
if (config.dev) { | ||
const builder = new Builder(nuxt) | ||
await builder.build() | ||
} else { | ||
await nuxt.ready() | ||
} | ||
|
||
// Give nuxt middleware to express | ||
app.use(nuxt.render) | ||
|
||
// Listen the server | ||
app.listen(port, host) | ||
consola.ready({ | ||
message: `Server listening on http://${host}:${port}`, | ||
badge: true | ||
}) | ||
} | ||
start() | ||
const express = require('express'); | ||
const consola = require('consola'); | ||
const { Nuxt, Builder } = require('nuxt'); | ||
const app = express(); | ||
|
||
// Import and Set Nuxt.js options | ||
let config = require('../nuxt.config.js'); | ||
config.dev = !(process.env.NODE_ENV === 'production'); | ||
|
||
async function start() { | ||
// Init Nuxt.js | ||
const nuxt = new Nuxt(config); | ||
|
||
const { host, port } = nuxt.options.server; | ||
|
||
// Build only in dev mode | ||
if (config.dev) { | ||
const builder = new Builder(nuxt); | ||
await builder.build(); | ||
} else { | ||
await nuxt.ready(); | ||
} | ||
|
||
// Respond to API requests | ||
/*app.use('/api', (req, res) => { | ||
res.status(402); | ||
});*/ | ||
|
||
// Give nuxt middleware to express | ||
app.use(nuxt.render); | ||
|
||
// Listen the server | ||
app.listen(port, host); | ||
|
||
// Show ready message | ||
consola.ready({ | ||
message: `Server listening on http://${host}:${port}`, | ||
badge: true | ||
}); | ||
|
||
} | ||
|
||
// Start web server | ||
start(); |
File renamed without changes.