HTML5 VIDEO is not working in my rails 3 app

前端 未结 4 1509
执念已碎
执念已碎 2020-12-16 19:17

I am trying to display HTML5 video in my Rails 3 app in development,i am using Sqlite3 and default webserver(Webrick).I put the video file (movie.ogg) under assets (assets/m

4条回答
  •  时光取名叫无心
    2020-12-16 19:37

    The video_tag helper builds an HTML 5 tag.

    By default, files are loaded from public/videos. To load from assets/video add the following line to your config/application.rb file:

    config.assets.paths << "#{Rails.root}/app/assets/videos"
    

    Tag Usage:

    <%= video_tag (["movie.mp4", "movie.ogg", "movie.webm"] :size => "320x240", :controls => true, :autobuffer => true) %>
    

提交回复
热议问题