1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2025-01-03 14:56:34 -05: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:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="player"> <xsl:template name="player">
<div> <xsl:if test="not(allow-direct-access) or allow-direct-access = 'true'">
<ul class="playlists"> <div>
<li><a href="{@mount}">Direct</a></li> <ul class="playlists">
<li><a href="{@mount}.m3u">M3U</a></li> <li><a href="{@mount}">Direct</a></li>
<li><a href="{@mount}.xspf">XSPF</a></li> <li><a href="{@mount}.m3u">M3U</a></li>
</ul> <li><a href="{@mount}.xspf">XSPF</a></li>
</ul>
<!-- Playlists section --> <!-- Playlists section -->
<h4>Play stream</h4> <h4>Play stream</h4>
<!-- Player --> <!-- Player -->
<xsl:if test="content-type and ((content-type = 'application/ogg') or (content-type = 'audio/ogg') or (content-type = 'audio/webm'))"> <xsl:if test="content-type and ((content-type = 'application/ogg') or (content-type = 'audio/ogg') or (content-type = 'audio/webm'))">
<div class="audioplayer"> <div class="audioplayer">
<audio controls="controls" preload="none"> <audio controls="controls" preload="none">
<source src="{@mount}" type="{content-type}" /> <source src="{@mount}" type="{content-type}" />
</audio> </audio>
</div> </div>
</xsl:if> </xsl:if>
</div> </div>
</xsl:if>
</xsl:template> </xsl:template>
</xsl:stylesheet> </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; 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 /* if a setting is available in the mount details then use it, else
* check the parser details. */ * check the parser details. */