{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Using a poster frame","type":"basic","slug":"using-a-poster-frame","excerpt":"This page shows you how to use a poster frame","body":"If you want to display a poster frame before the video starts playing (and afterwards), you have to make use of the `poster` parameter.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!DOCTYPE html>\\n<html>\\n  <head>\\n    <title>afterglow player</title>\\n    <script src=\\\"//cdn.jsdelivr.net/npm/afterglowplayer:::at:::1.x\\\"></script>\\n  </head>\\n  <body>\\n    <video class=\\\"afterglow\\\" id=\\\"myvideo\\\" width=\\\"1280\\\" height=\\\"720\\\" poster=\\\"/path/to/myposter.jpg\\\">\\n    \\t<source type=\\\"video/mp4\\\" src=\\\"/path/to/myvideo.mp4\\\" />\\n    </video>\\n  </body>\\n<html>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\nThe poster frame should match the video's ratio.\n\nThis is what a basic example with a poster frame could look like:\n[block:html]\n{\n  \"html\": \"<video id=\\\"myvideo\\\" class=\\\"afterglow\\\" width=\\\"1280\\\" height=\\\"719\\\"  poster=\\\"http://afterglowplayer.com/sandbox/v1/poster.jpg\\\" style=\\\"margin: 0 auto;\\\">\\n  <source src=\\\"http://afterglowplayer.com/sandbox/v1/afterglow_local_hd.mp4\\\" type=\\\"video/mp4\\\" />\\n</video>\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Read more about player parameters\",\n  \"body\": \"If you want to learn more about the player parameters that are available, you should take a look at the [player parameters section](doc:player-parameters).\"\n}\n[/block]","updates":[],"order":17,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"59fb30941a8c8d002837ced7","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Examples","slug":"examples","order":3,"from_sync":false,"reference":false,"_id":"59fb30931a8c8d002837cec4","version":"59fb30931a8c8d002837cec0","project":"55e6dcb32d0d3021000daf70","createdAt":"2015-09-04T12:02:28.639Z","__v":0},"project":"55e6dcb32d0d3021000daf70","user":"55e6dc8a2d0d3021000daf6e","parentDoc":null,"version":{"version":"1.1","version_clean":"1.1.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["59fb30931a8c8d002837cec1","59fb30931a8c8d002837cec2","59fb30931a8c8d002837cec3","59fb30931a8c8d002837cec4","59fb30931a8c8d002837cec5","59fb3502e786cb001c45ec9d"],"_id":"59fb30931a8c8d002837cec0","project":"55e6dcb32d0d3021000daf70","createdAt":"2017-11-02T14:49:55.750Z","releaseDate":"2017-11-02T14:49:55.750Z","__v":2},"createdAt":"2015-09-04T14:31:58.105Z","githubsync":"","__v":0}

Using a poster frame

This page shows you how to use a poster frame

If you want to display a poster frame before the video starts playing (and afterwards), you have to make use of the `poster` parameter. [block:code] { "codes": [ { "code": "<!DOCTYPE html>\n<html>\n <head>\n <title>afterglow player</title>\n <script src=\"//cdn.jsdelivr.net/npm/afterglowplayer@1.x\"></script>\n </head>\n <body>\n <video class=\"afterglow\" id=\"myvideo\" width=\"1280\" height=\"720\" poster=\"/path/to/myposter.jpg\">\n \t<source type=\"video/mp4\" src=\"/path/to/myvideo.mp4\" />\n </video>\n </body>\n<html>", "language": "html" } ] } [/block] The poster frame should match the video's ratio. This is what a basic example with a poster frame could look like: [block:html] { "html": "<video id=\"myvideo\" class=\"afterglow\" width=\"1280\" height=\"719\" poster=\"http://afterglowplayer.com/sandbox/v1/poster.jpg\" style=\"margin: 0 auto;\">\n <source src=\"http://afterglowplayer.com/sandbox/v1/afterglow_local_hd.mp4\" type=\"video/mp4\" />\n</video>" } [/block] [block:callout] { "type": "info", "title": "Read more about player parameters", "body": "If you want to learn more about the player parameters that are available, you should take a look at the [player parameters section](doc:player-parameters)." } [/block]