aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/app.js
blob: 2e537544aaea97e6457f53eb4cda05bb4c58cf43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { load as load_template } from './templates';
import * as player from './player';
import * as playlist from './playlist';
import Mustache from 'mustache';

import { mediaplayer } from 'agl-js-api';

var template;
var page = {

};

export function show() {
    document.body.innerHTML = Mustache.render(template, page);
    player.init(document.getElementById('PlayerContainer'));
    playlist.init(document.getElementById('PlaylistContainer'));
}

export function init() {
    load_template('main.template.html').then(function(result) {
        template = result;
        Mustache.parse(template);
        show();
    }, function(error) {
        console.error('ERRROR loading main template', error);
    });
}