Skip to content

Instantly share code, notes, and snippets.

@webgyo
Last active December 13, 2019 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webgyo/bc28b4a5efd390ca2546143535a3890b to your computer and use it in GitHub Desktop.
Save webgyo/bc28b4a5efd390ca2546143535a3890b to your computer and use it in GitHub Desktop.
iOSで動画のサムネイルが表示されない #html #movie

poster属性を指定しないとき通常動画の1フレーム目がサムネイルとして表示されるが iOSだと真っ黒のママで表示されない

最初からそうだった?スマホでは動画は自動再生できないため?

以下の指定をすれば任意の再生時間の動画キャプチャを表示できる

<source src="動画ファイル.mp4#t=[開始時間],[終了時間]" type='video/mp4'>

Popcorn.capture.jsのようなライブラリを使って解決する方法もある

iPhoneでvideoのサムネイルを表示させる方法
https://ja.stackoverflow.com/questions/10026/iphone%E3%81%A7video%E3%81%AE%E3%82%B5%E3%83%A0%E3%83%8D%E3%82%A4%E3%83%AB%E3%82%92%E8%A1%A8%E7%A4%BA%E3%81%95%E3%81%9B%E3%82%8B%E6%96%B9%E6%B3%95

Dynamically using the first frame as poster in HTML5 video?
https://stackoverflow.com/questions/7323053/dynamically-using-the-first-frame-as-poster-in-html5-video

動画埋め込みでサムネイル画像表示や再生開始地点を指定する方法
https://www.digitalbook-meclib.jp/tips/detail/video-embedding-settings/

Popcorn.capture.js   https://github.com/rwaldron/popcorn.capture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment