Welcome to mirror list, hosted at ThFree Co, Russian Federation.

page-podcast.php - github.com/nextcloud/nextcloud.com.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6c54835e1bfa0256474d827109a8aa0923312e06 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<head>
<link href="<?php echo get_template_directory_uri(); ?>/assets/css/pages/podcast.css?v=1" rel="stylesheet">
<script>
require(["require.config"], function() {
	require(["pages/sharing", "modules/youtubePlayer"])
});
</script>

<!--  podcast player scripts - see https://docs.podlove.org/podlove-web-player/embedding.html -->
<script src="https://cdn.podlove.org/web-player/5.x/embed.js"></script>
<script>
const RSS_URL = "<?php echo get_template_directory_uri(); ?>/podcast-feed.rss";
const config_URL = "<?php echo get_template_directory_uri(); ?>/assets/podcast/config.json";
const version = 5;
const show = {
            title: "Nextcloud Podcast",
            subtitle: "Nextcloud's own podcast",
            summary: "Every week we will talk about a subject concerning the community, data privacy and digital sovereignty",
            poster: "https://nextcloud.com/media/nextcloud-podcast-logo.png",
            link: "https://nextcloud.com/podcast"
        };

Promise.all([
    fetch(RSS_URL)
    .then(rss_response => rss_response.text()),
    fetch(config_URL)
    .then(config_response => config_response.json())
]).then((response) => {
    const rss_data = new window.DOMParser().parseFromString(response[0], "text/xml");
    const episodes_nodes = rss_data.querySelectorAll("item");
    let config_data = response[1];

    let episodes_list = [];
    let playlist = [];
    episodes_nodes.forEach(episode => {
        let audio_object = {
            url: episode.querySelector("enclosure").getAttribute("url"),
            size: episode.querySelector("enclosure").getAttribute("length"),
            title: episode.querySelector("title").textContent,
            mimeType: episode.querySelector("enclosure").getAttribute("type")
        };

        /**
        * Episode related Information
        */
        let episode_config = {
                version: version,
                show: show,
                title: episode.querySelector("title").textContent,
                subtitle: episode.getElementsByTagName("itunes:subtitle")[0].textContent,
                summary: episode.getElementsByTagName("itunes:summary")[0].textContent,
                publicationDate: episode.querySelector("pubDate").textContent,
                poster: "https://nextcloud.com/media/nextcloud-podcast-logo.png",
                duration: episode.getElementsByTagName("itunes:duration")[0].textContent,
                link: episode.querySelector("link").textContent,
                audio: [ audio_object ],
                playlist: [],
                contributors: [
                    {
                        id: "",
                        name: "",
                        avatar: "",
                        group: { "id": "", "slug": "", "title": "" }
                    }
                ]
        };
        episodes_list.push(episode_config);

        let episode_object = {
            title: episode_config.title,
            duration: episode_config.duration,
            href: episode_config.link,
            image: "author.jpg",
            config: {}
        };
        playlist.push(episode_object);
    });

    // add config for each episode in playlist
    let episode_number = 0;
    playlist.forEach(episode => {
        episode.config = episodes_list[episode_number];
        episode_number++;
    });

    // add playlist to episodes
    episodes_list.forEach(episode => {
        episode.playlist = playlist;
    });

    config_data.playlist = playlist;
    window.podlovePlayer("#podcast-player", episodes_list[0], config_data)
    .then(store => {
        store.subscribe(() => {
        console.log(store.getState());
        });
    });

});
</script>
<!--  podcast player scripts -->

<meta itemprop="image" content="<?php echo get_template_directory_uri(); ?>/assets/img/logo/nextcloud-podcast-logo.png">
<meta name="twitter:image" content="<?php echo get_template_directory_uri(); ?>/assets/img/logo/nextcloud-podcast-logo.png">
<meta name="twitter:image:src" content="<?php echo get_template_directory_uri(); ?>/assets/img/logo/nextcloud-podcast-logo.png">
<meta property="og:image" content="<?php echo get_template_directory_uri(); ?>/assets/img/logo/nextcloud-podcast-logo.png">

<link type="application/rss+xml" rel="alternate"
      title="Title_Value" href="https://nextcloud.com/podcast-feed.rss"/>
</head>

<div class="background permissions-background">
    <div class="container">
        <div class="row">
            <div class="col-md-6 topheader">
                <h1><?php echo $l->t('Stay in contact');?></h1>
                <h2><?php echo $l->t('Follow the Nextcloud podcast!');?></h2>
            </div>
        </div>
    </div>
</div>


<section class="section--intro">
    <div class="container">
        <div class="row">
            <div class="col-md-8 col-md-offset-2">
                <p class="section--paragraph text-center"><?php echo $l->t('Listen to the latest episode now!');?></p>
            </div>
        <div>
        <div class="row">
            <div class="col-md-8 col-md-offset-2">
                <p class="section--paragraph text-center">
                    <!--         podcast player will be displayed here             -->
                    <div id="podcast-player"></div>
                    <!--         podcast player will be displayed here             -->
                </div>
            </div>
        </div>
        <div class="row">
        <div class="text-center"><p>Subscribe now!</p>
        <a href="https://nextcloud.com/podcast-feed.rss"><i class="fa fa-rss" aria-hidden="true"></i> mp3</a><br/><a href="https://nextcloud.com/podcast-feed-opus.rss"><i class="fa fa-rss" aria-hidden="true"></i> OPUS</a><br/><a href="https://nextcloud.com/podcast-feed-m4a.rss"><i class="fa fa-rss" aria-hidden="true"></i> aac/m4a</a><br/><a href="https://open.spotify.com/show/622xNEOPDzAltHbCh5MF9x"><i class="fa fa-rss" aria-hidden="true"></i> on spotify</a><br/><a href="https://podcasts.apple.com/de/podcast/the-nextcloud-podcast/id1517381474"><i class="fa fa-rss" aria-hidden="true"></i> <?php echo $l->t('on apple podcast/itunes');?></a></p>
    </div>
</section>

<section class="section--previous">
    <div class="container">
    <h2 class="text-center"><?php echo $l->t('Previous episodes');?></h2>
        <div class="row">
            <div class="col-md-6 col-md-offset-3">
               <ul>
                    <?php $podcast_posts = get_posts( array( 'numberposts' => 5, 'category' => get_cat_ID('podcast') ) );
                    foreach ($podcast_posts as $ppost) { ?>
                        <li><a href="<?php echo wp_get_canonical_url($ppost->ID);?>"><?php echo $ppost->post_title;?></a></li>
                    <?php } ; ?>
                </ul>
            </div>
        </div>
    </div>
</section>