这是我的代码: index.slim
.background_video
= video_tag 'background.mp4', loop: :loop, autoplay: :autoplay, muted: true, class: 'videos'
.search.col-lg-6.search_form
label.col-lg-12
= form_tag(searches_path, method: 'get', class: 'search_form_tag') do
br
= text_field_tag :q, nil, placeholder: 'search everything here', class: 'search_field', autofocus: true
_header.slim:
.container
header
= link_to root_path, class: 'link_logo_image'
= image_tag ("WHERE_LOGO.png"), class: 'logo_image'
单击= link_to root_path, class: 'link_logo_image'
重新加载页面并开始音乐
在第一个打开页面视频播放时,没有声音。当我打开管理页面或重新加载主页时,视频从声音开始。在我的主页上是带有src =#的按钮。单击此按钮之后,视频也以声音开头。
它的工作:
= link_to '', root_path, class: 'items__footage', :"data-turbolinks" => false