{"id":19623839,"url":"https://github.com/appleple/modal-video","last_synced_at":"2025-04-06T07:13:08.397Z","repository":{"id":40957198,"uuid":"80684949","full_name":"appleple/modal-video","owner":"appleple","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-12T06:06:43.000Z","size":2446,"stargazers_count":270,"open_issues_count":40,"forks_count":79,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-30T06:05:12.062Z","etag":null,"topics":["accessibility","jquery","vimeo","youtube"],"latest_commit_sha":null,"homepage":"https://appleple.github.io/modal-video/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appleple.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-02T02:06:41.000Z","updated_at":"2025-02-07T08:35:56.000Z","dependencies_parsed_at":"2024-11-11T11:48:05.542Z","dependency_job_id":null,"html_url":"https://github.com/appleple/modal-video","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Fmodal-video","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Fmodal-video/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Fmodal-video/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Fmodal-video/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleple","download_url":"https://codeload.github.com/appleple/modal-video/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445671,"owners_count":20939958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accessibility","jquery","vimeo","youtube"],"created_at":"2024-11-11T11:35:44.673Z","updated_at":"2025-04-06T07:13:08.380Z","avatar_url":"https://github.com/appleple.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Modal Video\nModal Video Library\n\n## Features\n\n- Not affected by dom structure.\n- Beautiful transition\n- Accessible for keyboard navigation and screen readers.\n- Rich options for youtube API and Vimeo API\n\n## Installation\n- [npm](https://www.npmjs.com/package/modal-video)\n- [standalone](https://raw.githubusercontent.com/appleple/modal-video/master/js/modal-video.js)\n\nvia npm\n```shell\nnpm install modal-video --save\n```\n\nor yarn\n\n```shell\nyarn add modal-video\n```\n\n## Short Sample\n\n### Basic\n\n```html\n\u003cbutton class=\"js-modal-btn\" data-video-id=\"XJS_UYNq4No\"\u003eOpen Video\u003c/button\u003e\n```\n\n```js\nnew ModalVideo('.js-modal-btn');\n```\n\n### Vimeo\n\n```html\n\u003cbutton class=\"js-modal-btn\" data-video-id=\"202177974\"\u003eOpen Vimeo\u003c/button\u003e\n```\n\n```js\n// import ModalVideo from 'modal-video';\nnew ModalVideo('.js-modal-btn', {channel: 'vimeo'});\n```\n\n### MP4\n\n```html\n\u003cbutton class=\"js-modal-btn\" data-video-url=\"https://developer.a-blogcms.jp/themes/developer/movies/280.mp4\"\u003eOpen Video\u003c/button\u003e\n```\n\n```js\nnew ModalVideo('.js-modal-btn');\n```\n\nOR\n\n```html\n\u003cbutton class=\"js-modal-btn\" data-channel=\"custom\"\u003eOpen Video\u003c/button\u003e\n```\n\n```js\nnew ModalVideo('.js-modal-btn', {url: 'https://developer.a-blogcms.jp/themes/developer/movies/280.mp4'});\n```\n\n## Options\n\nAbout YouTube options, please refer to https://developers.google.com/youtube/player_parameters?hl=en\n\nAbout Vimeo options, please refer to https://developer.vimeo.com/apis/oembed\n\n\u003ctable style=\"min-width:100%;\"\u003e\n\t\u003ctbody\u003e\u003ctr\u003e\n\t\t\u003cth colspan=\"2\"\u003eproperties\u003c/th\u003e\n\t\t\u003cth\u003edefault\u003c/th\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd colspan=\"2\"\u003echannel\u003c/td\u003e\n\t\t\u003ctd\u003e'youtube'\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd rowspan=\"22\"\u003eyoutube\u003c/td\u003e\n\t\t\u003ctd\u003eautoplay\u003c/td\u003e\n\t\t\u003ctd\u003e1\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003ecc_load_policy\u003c/td\u003e\n\t\t\u003ctd\u003e1\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003ecolor\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003econtrols\u003c/td\u003e\n\t\t\u003ctd\u003e1\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003edisablekb\u003c/td\u003e\n\t\t\u003ctd\u003e0\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eenablejsapi\u003c/td\u003e\n\t\t\u003ctd\u003e0\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eend\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003efs\u003c/td\u003e\n\t\t\u003ctd\u003e1\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eh1\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eiv_load_policy\u003c/td\u003e\n\t\t\u003ctd\u003e1\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003elist\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003elistType\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eloop\u003c/td\u003e\n\t\t\u003ctd\u003e0\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003emodestbranding\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003emute\u003c/td\u003e\n\t\t\u003ctd\u003e0\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eorigin\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eplaylist\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eplaysinline\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003erel\u003c/td\u003e\n\t\t\u003ctd\u003e0\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eshowinfo\u003c/td\u003e\n\t\t\u003ctd\u003e1\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003estart\u003c/td\u003e\n\t\t\u003ctd\u003e0\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003ewmode\u003c/td\u003e\n\t\t\u003ctd\u003e'transparent'\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003etheme\u003c/td\u003e\n\t\t\u003ctd\u003e'dark'\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003enocookie\u003c/td\u003e\n\t\t\u003ctd\u003efalse\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd rowspan=\"15\"\u003evimeo\u003c/td\u003e\n\t\t\u003ctd\u003eapi\u003c/td\u003e\n\t\t\u003ctd\u003efalse\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eautopause\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eautoplay\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003ebyline\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003ecallback\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003ecolor\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003econtrols\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eheight\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eloop\u003c/td\u003e\n\t\t\u003ctd\u003efalse\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003emaxheight\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003emaxwidth\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eplayer_id\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eportrait\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003etitle\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003ewidth\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd rowspan=\"1\"\u003ecustom\u003c/td\u003e\n\t\t\u003ctd\u003eurl\u003c/td\u003e\n\t\t\u003ctd\u003eMP4 URL\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003exhtml\u003c/td\u003e\n\t\t\u003ctd\u003efalse\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd colspan=\"2\"\u003eratio\u003c/td\u003e\n\t\t\u003ctd\u003e'16:9'\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd colspan=\"2\"\u003eallowFullScreen\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd colspan=\"2\"\u003eanimationSpeed\u003c/td\u003e\n\t\t\u003ctd\u003e300\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd rowspan=\"6\"\u003eclassNames\u003c/td\u003e\n\t\t\u003ctd\u003emodalVideo\u003c/td\u003e\n\t\t\u003ctd\u003e'modal-video'\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003emodalVideoClose\u003c/td\u003e\n\t\t\u003ctd\u003e'modal-video-close'\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003emodalVideoBody\u003c/td\u003e\n\t\t\u003ctd\u003e'modal-video-body'\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003emodalVideoInner\u003c/td\u003e\n\t\t\u003ctd\u003e'modal-video-inner'\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003emodalVideoIframeWrap\u003c/td\u003e\n\t\t\u003ctd\u003e'modal-video-movie-wrap'\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003emodalVideoCloseBtn\u003c/td\u003e\n\t\t\u003ctd\u003e'modal-video-close-btn'\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd rowspan=\"2\"\u003earia\u003c/td\u003e\n\t\t\u003ctd\u003eopenMessage\u003c/td\u003e\n\t\t\u003ctd\u003e'You just openned the modal video'\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003edismissBtnMessage\u003c/td\u003e\n\t\t\u003ctd\u003e'Close the modal by clicking here'\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/tbody\u003e\u003c/table\u003e\n\n\n\n## FAQ\n### How to track YouTube videos playing in modal-video by GA4?\u003c/h3\u003e\n\n1. Enable JS API. Turn `enablejsapi` property to `1`.\n2. Load YouTube Iframe API. Add `\u003cscript src=\"https://www.youtube.com/iframe_api\"\u003e\u003c/script\u003e` in HTML file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleple%2Fmodal-video","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleple%2Fmodal-video","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleple%2Fmodal-video/lists"}