<style>
  body {
    height: 100vh;
    overflow: hidden;
  }
  .video-chat-wrapper {
    position: relative;
    height: 100vh;
    overflow: scroll;
  }
  .individual-video video {
    max-width: 600px;
    background: #232324;
    width: 100%;
  }

  .individual-video {
    overflow: hidden;
    position: relative;
    display: inline-block;
    line-height: 0;
  }
  .individual-video:last-child {
    margin-bottom: 100px;
  }

  #local-media video {
    width: 150px;
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 5;
  }

  #local-media.video-hidden {
    opacity: 0.1;
  }

  .individual-video {
    position: relative;
    margin-bottom: -6px;
  }
  .participant-info {
    padding: 3px 8px;
    border-radius: 3px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 13px;
    text-align: center;
  }
  .participant-name {
    display: inline-block;
    color: white;
    background: #171717;
    padding: 4px 12px;
    border-radius: 100px;
    margin: 8px;
  }
  .video-controls {
    position: fixed;
    bottom: 15px;
    left: 5px;
    width: calc(100% - 175px);
    z-index: 10;
    display: none;
  }

  .showing {
    display: block;
  }

  .video-controls button {
    font-size: 15px;
    width: 100%;
    margin: 3px 0px;
    padding: 3px 0px;
  }

  .disabled-video video {
    opacity: 0.1;
  }
  .disabled-audio-indicator,.disabled-video-indicator {
    background: red;
    color: white;
    display: none;
    position: absolute;
    border-radius: 100px;
    padding: 4px 10px;
    right: 5px;
    bottom: 12px;
  }
  .disabled-audio-indicator {
    right: auto;
    left: 5px;
  }
  .disabled-video .disabled-video-indicator{
    display: inline-block;
  }
  .disabled-audio .disabled-audio-indicator{
    display: inline-block;
  }
  .platform-unavailable-message {
    padding: 20px;
    color: white;
    margin-top: 30px;
  }

  @media screen and (max-width: 280px) {
    .video-controls {
      width: 92%;
      bottom: 5px;
    }
    #local-media video {
      width: 90%;
      bottom: 85px;
    }
  }

  @media screen and (min-width: 500px) {
    .video-controls {
      left: auto;
      right: 170px;
      width: 200px;
    }
  }

  @media screen and (max-height: 400px) {
    .video-controls {
      width: 90px;
    }
    #local-media video {
      width: 90px;
      bottom: 5px;
    }
  }

</style>

<div class="video-chat-wrapper" id="videochat" data-token="<%= @token %>" data-channel="<%= params[:id] %>" data-user="<%= @username %>">
  <div id="room-type" data-type="<%= @video_type %>"></div>
  <div id="remote-media"></div>
  <div id="local-media"></div>
  <div id="video-controls" class="video-controls">
  <button id="mute-toggle" data-muted="false" class="crayons-btn crayons-btn--secondary">Mute</button>
  <button id="videohide-toggle" data-hidden="false" class="crayons-btn crayons-btn--secondary">Hide</button>
</div>
<%# TODO Make paramsp[:id] map to a chat channel and ensure the users have permission %>
<%# That part is pretty straightforward %>
<%# Then close the loop on the JavaScript part of it. %>
<%# Also should be *fairly* straightforward in terms of following a basic tutorial. %>
<%# Then we drop a link in chat rather than trying to make video work with complicated state in chat. %>
<%# The complicated part has always been chat state/channels etc. Doing in sidecar means more containerization of logic. %>
<%= javascript_packs_with_chunks_tag "videoChat", defer: true %>
