{% load i18n static %}
{% if torrent_content_hash %}
    {% with 'torrent_stream_button_'|add:torrent_content_hash as transport_id %}
        {% trans "Watch online" as watch_online_translated %}
        <a href="#" id="{{ transport_id }}">
            <img src="{% static "torrent_stream/play_icon_small.png" %}"
                 alt="{{ watch_online_translated }}" title="{{ watch_online_translated }}"
                 style="float:left" />
            <span style="padding-left:2px">{{ watch_online_translated }}</span>
        </a>
        <div style="clear:both"></div>
        <script type="text/javascript">
            var torrent_stream_config = {
                'transport_id': '{{ transport_id }}',
                'torrent_stream_js': '{% url torrent_stream_js torrent_content_hash %}',
                'box_width': parseInt('{{ TORRENT_STREAM_PLAYER.width }}'),
                'box_height': parseInt('{{ TORRENT_STREAM_PLAYER.height }}'),
                'ajax_loader': '{% static "torrent_stream/ajax-loader.gif" %}',
                'close_player_confirm': '{% trans "Are you sure you want to close the player?" %}'
            }
        </script>
        <script type="text/javascript" src="{% static "torrent_stream/button.js" %}"></script>
    {% endwith %}
{% endif %}
