Skip to content

Commit

Permalink
add index view
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Nias committed Jan 13, 2017
1 parent 58db557 commit 37a7ae3
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
@@ -1,2 +1,5 @@
# Media Source Tutorial
To host locally npm install and then node app.js


This repo contains the source files for a [blog series on WIREWAX.com](https://www.wirewax.com/blog/post/building-a-media-source-html5-player).
3 changes: 2 additions & 1 deletion app.js
Expand Up @@ -20,7 +20,7 @@ app.configure(function () {
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', express.static(path.join(__dirname, 'public')));
app.engine('html', require('ejs').renderFile);
app.use(express.errorHandler());
});
Expand All @@ -30,6 +30,7 @@ var server = app.listen(3105);
exports = module.exports = app;

// Routes
app.get('/', routes['index']);
app.get('/basic', routes['basicPlayer']);
app.get('/buffering', routes['bufferingPlayer']);
app.get('/adaptive', routes['adaptiveStreamingPlayer']);
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -2,7 +2,8 @@
"name": "mediaSourceTutorial",
"version": "0.0.1",
"dependencies": {
"ejs": "^2.5.5",
"express": "3.3.4",
"request": "~2.22.0"
"request": "~2.22.0"
}
}
3 changes: 3 additions & 0 deletions routes/index.js
@@ -1,3 +1,6 @@
exports.index = function(req, res) {
res.render('index.html');
};
exports.basicPlayer = function(req , res){
res.render('basic-player.html');
};
Expand Down
26 changes: 26 additions & 0 deletions views/index.html
@@ -0,0 +1,26 @@
<html>
<head>
<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<link rel="stylesheet" type="text/css" href="style/basic.css">
</head>
<body>
<table class="ww4-table">
<tr>
<td>
<a href="/basic" title="Basic example">Basic player</a>
</td>
</tr>
<tr>
<td>
<a href="/buffering" title="Buffering player">Buffering player</a>
</td>
</tr>
<tr>
<td>
<a href="/adaptive" title="Adaptive streaming player">Adaptive streaming player</a>
</td>
</tr>
</tr>
</table>
</body>
</html>

0 comments on commit 37a7ae3

Please sign in to comment.