~hristoast/mousikofidi

1bb45c5a199a1cf8f19cd1fe77c7aceabfa0990c — Hristos N. Triantafillou 9 months ago 41fe4da
The logo as a placeholder
M mousikofidi/templates/file_detail.html => mousikofidi/templates/file_detail.html +1 -1
@@ 30,7 30,7 @@
  </div>
{% elif item_type == "video" %}
  <div class="center" style="margin: 0 auto; width: 100%;">
    <video id="single"{% if autoplay %} autoplay{% endif %} controls>
    <video poster="{{ logo_path }}" id="single"{% if autoplay %} autoplay{% endif %} controls>
      <source src="{{ url_for('.serve_file', path=path) }}" type="{% if "mp4" in path %}video/mp4{% elif "webm" in path %}video/webm{% endif %}">
      <p>Your browser doesn't support HTML5 video. Here is
        a <a href="{{ url_for('.serve_file', path=path) }}">link to the video</a> instead.</p>

M mousikofidi/templates/video_player.html => mousikofidi/templates/video_player.html +1 -1
@@ 2,7 2,7 @@
<div data-randorder="none" id="vid-randorder"></div>
<div data-playback-ended="false" id="video-playback-ended"></div>
<div class="center">
  <video id="video"{% if autoplay %} autoplay{% endif %}{% if preload_video %} preload="auto"{% endif %} controls>
  <video poster="{{ logo_path }}" id="video"{% if autoplay %} autoplay{% endif %}{% if preload_video %} preload="auto"{% endif %} controls>
    <source>
    <p>Your browser doesn't support HTML5 video.</p>
  </video>

M test_mousikofidi.py => test_mousikofidi.py +21 -5
@@ 2039,7 2039,9 @@ def test_dir_detail_found(client):
        bytes('<div data-randorder="none" id="vid-randorder"></div>', "utf8") in rv.data
    )
    assert bytes('<div id="videoplayer"></div>', "utf8") in rv.data
    assert bytes('<video id="video" controls>', "utf8") in rv.data
    assert (
        bytes('<video poster="{}" id="video" controls>'.format(logo), "utf8") in rv.data
    )
    assert bytes("<source>", "utf8") in rv.data
    assert bytes("</video>", "utf8") in rv.data
    assert (


@@ 2303,6 2305,7 @@ def test_file_detail_real_mp4(client):
    example_dir = os.path.join(THIS_DIR, "example", "real.mp4")
    dir_list = []
    dir_list.append(example_dir)
    logo = select_logo(app.fidiConfig, "logo_path")
    site_name = "COOL TEST SITE"
    url = "/browse/" + example_dir.strip("/")



@@ 2332,7 2335,10 @@ def test_file_detail_real_mp4(client):
        ),
        "utf8",
    )
    assert bytes('<video id="single" controls>', "utf8") in rv.data
    assert (
        bytes('<video poster="{}" id="single" controls>'.format(logo), "utf8")
        in rv.data
    )
    assert b"Track: 34/100" in rv.data
    assert (
        bytes(


@@ 2513,6 2519,7 @@ def test_playlist_empty(client):
def test_playlist_with_audio_and_video(client):
    example_dir = os.path.join(THIS_DIR, "example")
    url = "/queue"
    logo = select_logo(app.fidiConfig, "logo_path")

    with app.test_client() as tc:



@@ 2794,7 2801,9 @@ def test_playlist_with_audio_and_video(client):
        bytes('<div data-randorder="none" id="vid-randorder"></div>', "utf8") in rv.data
    )
    assert bytes('<div id="videoplayer"></div>', "utf8") in rv.data
    assert bytes('<video id="video" controls>', "utf8") in rv.data
    assert (
        bytes('<video poster="{}" id="video" controls>'.format(logo), "utf8") in rv.data
    )
    assert bytes("<source>", "utf8") in rv.data
    assert bytes("</video>", "utf8") in rv.data
    assert (


@@ 2838,6 2847,7 @@ def test_playlist_with_audio_and_video(client):
def test_playlist_with_audio_no_video(client):
    example_dir = os.path.join(THIS_DIR, "example")
    url = "/queue"
    logo = select_logo(app.fidiConfig, "logo_path")

    with app.test_client() as tc:



@@ 3116,7 3126,10 @@ def test_playlist_with_audio_no_video(client):
        not in rv.data
    )
    assert bytes('<div id="videoplayer"></div>', "utf8") not in rv.data
    assert bytes('<video id="video" controls>', "utf8") not in rv.data
    assert (
        bytes('<video poster="{}" id="video" controls>'.format(logo), "utf8")
        not in rv.data
    )
    assert bytes("<source>", "utf8") not in rv.data
    assert bytes("</video>", "utf8") not in rv.data
    assert (


@@ 3160,6 3173,7 @@ def test_playlist_with_audio_no_video(client):
def test_playlist_no_audio_with_video(client):
    example_dir = os.path.join(THIS_DIR, "example")
    url = "/queue"
    logo = select_logo(app.fidiConfig, "logo_path")

    with app.test_client() as tc:



@@ 3439,7 3453,9 @@ def test_playlist_no_audio_with_video(client):
        bytes('<div data-randorder="none" id="vid-randorder"></div>', "utf8") in rv.data
    )
    assert bytes('<div id="videoplayer"></div>', "utf8") in rv.data
    assert bytes('<video id="video" controls>', "utf8") in rv.data
    assert (
        bytes('<video poster="{}" id="video" controls>'.format(logo), "utf8") in rv.data
    )
    assert bytes("<source>", "utf8") in rv.data
    assert bytes("</video>", "utf8") in rv.data
    assert (