diff options
Diffstat (limited to 'template/assemblies/player')
-rw-r--r-- | template/assemblies/player/audio.phtml | 26 | ||||
-rw-r--r-- | template/assemblies/player/music.phtml | 24 |
2 files changed, 42 insertions, 8 deletions
diff --git a/template/assemblies/player/audio.phtml b/template/assemblies/player/audio.phtml index c1c7f8f..e007ab3 100644 --- a/template/assemblies/player/audio.phtml +++ b/template/assemblies/player/audio.phtml @@ -3,12 +3,22 @@ preload="auto" style="width: 230px;" > - <source - src="<?=h(link_stream('audio', $room, 'mp3', @$translated))?>" - type="audio/mp3" - /> - <source - src="<?=h(link_stream('audio', $room, 'opus', @$translated))?>" - type="audio/opus" - /> + <? if(in_array("audio-mp3", $formats)): ?> + <source + src="<?=h(link_stream('audio', $room, 'mp3', @$translated))?>" + type="audio/mp3" + /> + <? endif ?> + <? if(in_array("audio-opus", $formats)): ?> + <source + src="<?=h(link_stream('audio', $room, 'opus', @$translated))?>" + type="audio/opus" + /> + <? endif ?> + <? if(in_array("audio-ogg", $formats)): ?> + <source + src="<?=h(link_stream('audio', $room, 'ogg', @$translated))?>" + type="audio/ogg" + /> + <? endif ?> </audio> diff --git a/template/assemblies/player/music.phtml b/template/assemblies/player/music.phtml new file mode 100644 index 0000000..587d2d2 --- /dev/null +++ b/template/assemblies/player/music.phtml @@ -0,0 +1,24 @@ +<audio + autoplay="autoplay" + preload="auto" + style="width: 230px;" +> + <? if(in_array("music-mp3", $formats)): ?> + <source + src="<?=h(link_stream('music', $room, 'mp3', @$translated))?>" + type="audio/mp3" + /> + <? endif ?> + <? if(in_array("music-opus", $formats)): ?> + <source + src="<?=h(link_stream('music', $room, 'opus', @$translated))?>" + type="audio/opus" + /> + <? endif ?> + <? if(in_array("music-ogg", $formats)): ?> + <source + src="<?=h(link_stream('music', $room, 'ogg', @$translated))?>" + type="audio/ogg" + /> + <? endif ?> +</audio> |