1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-16 06:15:24 +00:00

Update: Disable links and player on status page when direct access is not allowed

Closes: #2409
This commit is contained in:
Philipp Schafft 2022-02-28 11:16:34 +00:00
parent b7e204e3a7
commit 6aa937e55f
2 changed files with 21 additions and 17 deletions

View File

@ -1,23 +1,25 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="player">
<div>
<ul class="playlists">
<li><a href="{@mount}">Direct</a></li>
<li><a href="{@mount}.m3u">M3U</a></li>
<li><a href="{@mount}.xspf">XSPF</a></li>
</ul>
<xsl:if test="not(allow-direct-access) or allow-direct-access = 'true'">
<div>
<ul class="playlists">
<li><a href="{@mount}">Direct</a></li>
<li><a href="{@mount}.m3u">M3U</a></li>
<li><a href="{@mount}.xspf">XSPF</a></li>
</ul>
<!-- Playlists section -->
<h4>Play stream</h4>
<!-- Playlists section -->
<h4>Play stream</h4>
<!-- Player -->
<xsl:if test="content-type and ((content-type = 'application/ogg') or (content-type = 'audio/ogg') or (content-type = 'audio/webm'))">
<div class="audioplayer">
<audio controls="controls" preload="none">
<source src="{@mount}" type="{content-type}" />
</audio>
</div>
</xsl:if>
</div>
<!-- Player -->
<xsl:if test="content-type and ((content-type = 'application/ogg') or (content-type = 'audio/ogg') or (content-type = 'audio/webm'))">
<div class="audioplayer">
<audio controls="controls" preload="none">
<source src="{@mount}" type="{content-type}" />
</audio>
</div>
</xsl:if>
</div>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@ -1024,6 +1024,8 @@ static void source_apply_mount (ice_config_t *config, source_t *source, mount_pr
source->allow_direct_access = mountinfo->allow_direct_access;
}
stats_event(source->mount, "allow-direct-access", source->allow_direct_access ? "true" : "false");
/* if a setting is available in the mount details then use it, else
* check the parser details. */