record_audio.html.twig 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <div id="record-audio-recordrtc" class="row">
  2. <div class="col-sm-6">
  3. {% block intro %}
  4. <p class="text-center">{{ 'RepeatThisPhrase'|get_plugin_lang('WhispeakAuthPlugin') }}</p>
  5. <div class="well well-sm">
  6. <div class="row">
  7. <div class="col-sm-3 text-center">
  8. <span class="fa fa-microphone fa-5x fa-fw" aria-hidden="true"></span>
  9. <span class="sr-only">{{ 'RecordAudio'|get_lang }}</span>
  10. </div>
  11. <div class="col-sm-9 text-center">
  12. <p class="lead">{{ sample_text }}</p>
  13. </div>
  14. </div>
  15. </div>
  16. {% endblock %}
  17. <ul class="list-inline text-center">
  18. <li>
  19. <button class="btn btn-primary" type="button" id="btn-start-record">
  20. <span class="fa fa-circle fa-fw" aria-hidden="true"></span> {{ 'StartRecordingAudio'|get_lang }}
  21. </button>
  22. </li>
  23. <li class="hidden">
  24. <button class="btn btn-danger" type="button" id="btn-stop-record" disabled>
  25. <span class="fa fa-square fa-fw" aria-hidden="true"></span> {{ 'StopRecordingAudio'|get_lang }}
  26. </button>
  27. </li>
  28. <li class="hidden">
  29. <button class="btn btn-success" type="button" id="btn-save-record"
  30. data-loadingtext="{{ 'Uploading'|get_lang }}" disabled>
  31. <span class="fa fa-send fa-fw" aria-hidden="true"></span> {{ 'SaveRecordedAudio'|get_lang }}
  32. </button>
  33. </li>
  34. </ul>
  35. <p class="hidden" id="audio-wrapper">
  36. <audio class="center-block" controls id="record-preview"></audio>
  37. </p>
  38. </div>
  39. <div class="col-sm-5 col-sm-offset-1" id="messages-deck">
  40. {% if is_authenticated %}
  41. <div class="alert alert-info">
  42. <span class="fa fa-info-circle" aria-hidden="true"></span>
  43. <strong>{{ 'SpeechAuthAlreadyEnrolled'|get_plugin_lang('WhispeakAuthPlugin') }}</strong>
  44. </div>
  45. {% endif %}
  46. </div>
  47. </div>
  48. <script>
  49. $(function () {
  50. {% block config_data %}
  51. RecordAudio.init(
  52. {
  53. blockId: '#record-audio-recordrtc',
  54. btnStartId: '#btn-start-record',
  55. btnStopId: '#btn-stop-record',
  56. btnSaveId: '#btn-save-record',
  57. plyrPreviewId: '#record-preview',
  58. data: {
  59. action: 'enrollment'
  60. }
  61. }
  62. );
  63. {% endblock %}
  64. });
  65. </script>