Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #382 from alexander-heimbuch/feature/error-handling
Browse files Browse the repository at this point in the history
feat(error-handling): Handle player load error
  • Loading branch information
alexander-heimbuch authored May 27, 2017
2 parents 2343822 + be9ee00 commit afd04ff
Show file tree
Hide file tree
Showing 69 changed files with 2,214 additions and 855 deletions.
1 change: 1 addition & 0 deletions docs/advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<li><a href="./persistence.html">Player Persistence</a></li>
<li><a class="active" href="./advanced.html">Advanced Usage</a></li>
<li><a href="./playground.html">Playground</a></li>
<li><a href="./error.html">Error Handling</a></li>
<li><a href="./example.html">Example</a></li>
</ul>
</sidebar>
Expand Down
1 change: 1 addition & 0 deletions docs/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<li><a href="./persistence.html">Player Persistence</a></li>
<li><a href="./advanced.html">Advanced Usage</a></li>
<li><a href="./playground.html">Playground</a></li>
<li><a href="./error.html">Error Handling</a></li>
<li><a href="./example.html">Example</a></li>
</ul>
</sidebar>
Expand Down
1 change: 1 addition & 0 deletions docs/embedding.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<li><a href="./persistence.html">Player Persistence</a></li>
<li><a href="./advanced.html">Advanced Usage</a></li>
<li><a href="./playground.html">Playground</a></li>
<li><a href="./error.html">Error Handling</a></li>
<li><a href="./example.html">Example</a></li>
</ul>
</sidebar>
Expand Down
102 changes: 102 additions & 0 deletions docs/error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{meta_description}">
<meta name="author" content="">

<title>Podlove Web Player - Playground</title>

<link href="./assets/gitbook.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/jsoneditor/5.5.11/jsoneditor.min.css" rel="stylesheet">
</head>

<body>
<div class="wrapper">
<sidebar class="sidebar">
<ul class="navigation">
<li><a href="./index.html">Overview</a></li>
<li><a href="./embedding.html">Embedding</a></li>
<li><a href="./theme.html">Theming</a></li>
<li><a href="./config.html">Configuration</a></li>
<li><a href="./persistence.html">Player Persistence</a></li>
<li><a href="./advanced.html">Advanced Usage</a></li>
<li><a href="./playground.html">Playground</a></li>
<li><a class="active" href="./error.html">Error Handling</a></li>
<li><a href="./example.html">Example</a></li>
</ul>
</sidebar>

<main class="content">
<div class="inner">
<h1>Error Handling</h1>
<h3>Load Error</h3>
<p id="load-error"></p>

<h3>Missing Audio Reference</h3>
<p id="reference-error"></p>
<script src="embed.js"></script>
<script>
var config = {
title: 'FS171 Invasion!',
subtitle: 'LAN Planung - Kalender - Bingo - Wikipedia - Akkukalibration - Alte iPads und iPods - Find My Friends - iPhone Music Player - Apple Watch - Kommandozeile - Star Wars - Dante - Internet of Things Security - VPN',
summary: 'Wir haben eine wie wir finden abwechslungsreiche Sendung produziert, die wir Euch wie immer mit Freude bereitstellen. Während die Live-Hörer Freak-Show-Bingo spielen, greifen wir das Wikipedia-Thema der letzten Sendung auf und liefern auch noch weitere Aspekte des optimalen Star-Wars-Medienkonsums frei Haus. Dazu viel Nerderei rund um die Kommandozeile, eine Einschätzung der Perspektive der Apple Watch, ein Rant über die mangelhafte Security im Internet of Things (and Buildings) und allerlei anderer Kram. Roddi setzt dieses Mal aus, sonst Vollbesetzung.',
publicationDate: '2016-02-11T03:13:55+00:00',
poster: 'https://freakshow.fm/wp-content/cache/podlove/04/662a9d4edcf77ea2abe3c74681f509/freak-show_200x200.jpg',
show: {
title: 'Freak Show',
subtitle: 'Menschen! Technik! Sensationen!',
summary: 'Die muntere Talk Show um Leben mit Technik, das Netz und Technikkultur. Bisweilen Apple-lastig aber selten einseitig. Wir leben und lieben Technologie und reden darüber. Mit Tim, hukl, roddi, Clemens und Denis. Freak Show hieß irgendwann mal mobileMacs.',
poster: 'https://freakshow.fm/wp-content/cache/podlove/04/662a9d4edcf77ea2abe3c74681f509/freak-show_200x200.jpg',
url: 'https://freakshow.fm'
},
theme: {
primary: '#2B8AC6'
},
duration: '04:15:32',
chapters: [
{ start:"00:00:00", title: 'Intro'},
{ start:"00:01:39", title: 'Begrüßung'},
{ start:"00:04:58", title: 'IETF Meeting Netzwerk'},
{ start:"00:18:37", title: 'Kalender'},
{ start:"00:33:40", title: 'Freak Show Bingo'},
{ start:"00:35:37", title: 'Wikipedia'},
{ start:"01:17:26", title: 'iPhone Akkukalibration'},
{ start:"01:24:55", title: 'Alte iPads und iPod touches'},
{ start:"01:31:02", title: 'Find My Friends'},
{ start:"01:41:46", title: 'iPhone Music Player'},
{ start:"01:56:13", title: 'Apple Watch'},
{ start:"02:11:51", title: 'Kommandozeile: System Appreciation'},
{ start:"02:23:10", title: 'Sound und Design für Games'},
{ start:"02:24:59", title: 'Kommandozeile: Remote Deployment'},
{ start:"02:32:37", title: 'Kommandozeile: Man Pages'},
{ start:"02:44:31", title: 'Kommandozeile: screen vs. tmux'},
{ start:"02:58:02", title: 'Star Wars: Machete Order & Phantom Edit'},
{ start:"03:20:05", title: 'Kopfhörer-Ersatzteile'},
{ start:"03:23:39", title: 'Dante'},
{ start:"03:38:03", title: 'Dante Via'},
{ start:"03:45:33", title: 'Internet of Things Security'},
{ start:"03:56:11", title: 'That One Privacy Guy\'s VPN Comparison Chart'},
{ start:"04:10:00", title: 'Ausklang'}
],
audio: [],
reference: {
config: '//podlove-player.surge.sh/fixtures/example.json',
share: '//podlove-player.surge.sh/share'
}
};

podlovePlayer('#load-error', Object.assign({}, config, {
audio: ['http://invalid.url']
}))

podlovePlayer('#reference-error', Object.assign({}, config))
</script>
</div>
</main>
</div>
</body>
</html>
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<li><a href="./persistence.html">Player Persistence</a></li>
<li><a href="./advanced.html">Advanced Usage</a></li>
<li><a href="./playground.html">Playground</a></li>
<li><a href="./error.html">Error Handling</a></li>
<li><a href="./example.html">Example</a></li>
</ul>
</sidebar>
Expand Down
1 change: 1 addition & 0 deletions docs/persistence.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<li><a class="active" href="./persistence.html">Player Persistence</a></li>
<li><a href="./advanced.html">Advanced Usage</a></li>
<li><a href="./playground.html">Playground</a></li>
<li><a href="./error.html">Error Handling</a></li>
<li><a href="./example.html">Example</a></li>
</ul>
</sidebar>
Expand Down
1 change: 1 addition & 0 deletions docs/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<li><a href="./persistence.html">Player Persistence</a></li>
<li><a href="./advanced.html">Advanced Usage</a></li>
<li><a class="active" href="./playground.html">Playground</a></li>
<li><a href="./error.html">Error Handling</a></li>
<li><a href="./example.html">Example</a></li>
</ul>
</sidebar>
Expand Down
1 change: 1 addition & 0 deletions docs/theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<li><a href="./persistence.html">Player Persistence</a></li>
<li><a href="./advanced.html">Advanced Usage</a></li>
<li><a href="./playground.html">Playground</a></li>
<li><a href="./error.html">Error Handling</a></li>
<li><a href="./example.html">Example</a></li>
</ul>
</sidebar>
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"clipboard": "1.6.0",
"color": "1.0.3",
"detect-browser": "1.6.2",
"ent": "2.2.0",
"foundation-sites": "6.3.1",
"hashcode": "1.0.3",
"howler": "2.0.3",
Expand Down
20 changes: 11 additions & 9 deletions src/components/App.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template>
<div class="podlove" :class="{[mode]: mode, [runtime.platform]: runtime.platform}">
<PodloveInfo />
<PodlovePlayer />
<PodloveTabs />
<HeaderComponent />
<PlayerComponent />
<TabsComponent />
</div>
</template>

<script>
import PodloveInfo from './info/Info.vue'
import PodlovePlayer from './player/Player.vue'
import PodloveTabs from './tabs/Tabs.vue'
import HeaderComponent from './header/Header.vue'
import PlayerComponent from './player/Player.vue'
import TabsComponent from './tabs/Tabs.vue'
export default {
name: 'app',
Expand All @@ -29,9 +29,9 @@
}
},
components: {
PodloveInfo,
PodlovePlayer,
PodloveTabs
HeaderComponent,
PlayerComponent,
TabsComponent
}
}
</script>
Expand All @@ -45,6 +45,8 @@
@import 'utils';
@import 'grid';
@import 'transitions';
.podlove {
display: block;
position: relative;
Expand Down
74 changes: 74 additions & 0 deletions src/components/header/Error.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<template>
<div class="error">
<h2 class="title" :style="titleStyle(theme)">{{ $t(error.title) }}</h2>
<div class="description" :style="descriptionStyle(theme)">{{ $t(error.message) }}</div>
</div>
</template>

<script>
import store from 'store'
import color from 'color'
import ErrorIcon from 'icons/ErrorIcon.vue'
const titleStyle = theme => ({
color: theme.player.title
})
const descriptionStyle = theme => ({
color: color(theme.player.text).fade(0.25)
})
export default {
data () {
return {
poster: this.$select('poster'),
title: this.$select('title'),
showTitle: this.$select('showTitle'),
subtitle: this.$select('subtitle'),
theme: this.$select('theme'),
error: this.$select('error')
}
},
methods: {
titleStyle,
descriptionStyle
},
components: {
ErrorIcon
}
}
</script>

<style lang="scss">
@import 'variables';
$error-height: 100px;
.error {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
height: $error-height;
text-align: center;
overflow: hidden;
.title {
margin-top: 0;
margin-bottom: $margin / 3;
font-weight: inherit;
font-size: 1.8em;
line-height: 1em;
}
.description {
margin: 0;
font-weight: inherit;
font-size: 1em;
line-height: 1.2em;
}
}
</style>
44 changes: 44 additions & 0 deletions src/components/header/Header.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<template>
<div class="header" :style="backgroundStyle(theme)">
<PodloveError v-if="components.error"/>
<PodloveInfo v-if="components.info"/>
</div>

</template>

<script>
import store from 'store'
import color from 'color'
import PodloveInfo from './Info.vue'
import PodloveError from './Error.vue'
const backgroundStyle = theme => ({
'background-color': theme.player.background
})
export default {
data () {
return {
theme: this.$select('theme'),
components: this.$select('components')
}
},
methods: {
backgroundStyle
},
components: {
PodloveInfo,
PodloveError
}
}
</script>

<style lang="scss">
@import 'variables';
.header {
padding: $padding $padding 0 $padding;
overflow: hidden;
}
</style>
17 changes: 5 additions & 12 deletions src/components/info/Info.vue → src/components/header/Info.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="podlove-info" :style="backgroundStyle(theme)">
<div class="info" >
<div class="poster" v-if="poster">
<div class="poster-container" :style="posterStyle(theme)">
<img class="poster-image" :src="poster" />
Expand Down Expand Up @@ -29,10 +29,6 @@
color: color(theme.player.text).fade(0.25)
})
const backgroundStyle = theme => ({
'background-color': theme.player.background
})
export default {
data () {
return {
Expand All @@ -46,8 +42,7 @@
methods: {
posterStyle,
titleStyle,
subtitleStyle,
backgroundStyle
subtitleStyle
}
}
</script>
Expand All @@ -58,12 +53,10 @@
$poster-size: 100px;
$description-height: 100px;
.podlove-info {
padding: $padding $padding 0 $padding;
.info {
width: 100%;
display: flex;
flex-direction: row;
overflow: hidden;
.poster {
margin: 0 $margin 0 0;
Expand All @@ -86,7 +79,7 @@
margin: 0;
font-weight: inherit;
font-size: 1em;
line-height: 1.2;
line-height: 1.2em;
}
.subtitle {
Expand All @@ -96,7 +89,7 @@
}
@media screen and (max-width: $width-l) {
.podlove-info {
.info {
flex-direction: column;
text-align: center;
Expand Down
3 changes: 0 additions & 3 deletions src/components/icons/CloseIcon.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<svg width="16px" height="16px" viewBox="329 30 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 42 (36781) - http://www.bohemiancoding.com/sketch -->
<desc>Created with Sketch.</desc>
<defs></defs>
<rect stroke="none" :fill="color" fill-rule="evenodd" transform="translate(337.000000, 38.000000) rotate(-315.000000) translate(-337.000000, -38.000000) " x="336" y="28" width="2" height="20"></rect>
<rect stroke="none" :fill="color" fill-rule="evenodd" transform="translate(337.000000, 38.000000) rotate(-45.000000) translate(-337.000000, -38.000000) " x="336" y="28" width="2" height="20"></rect>
</svg>
Expand Down
Loading

0 comments on commit afd04ff

Please sign in to comment.