Skip to content

Commit

Permalink
Merge pull request #77 from Yoshi0207/feature/addCustomProp#76
Browse files Browse the repository at this point in the history
URLの指定方法の追加#76
  • Loading branch information
Kasumi Morita authored Aug 26, 2021
2 parents 3fe2467 + 12e659c commit 5d80533
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 4 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,26 @@ new ModalVideo('.js-modal-btn');
new ModalVideo('.js-modal-btn', {channel: 'vimeo'});
```

### MP4

```html
<button class="js-modal-btn" data-video-url="https://developer.a-blogcms.jp/themes/developer/movies/280.mp4">Open Video</button>
```

```js
new ModalVideo('.js-modal-btn');
```

OR

```html
<button class="js-modal-btn" data-channel="custom">Open Video</button>
```

```js
new ModalVideo('.js-modal-btn', {url: 'https://developer.a-blogcms.jp/themes/developer/movies/280.mp4'});
```

## Options

About YouTube options, please refer to https://developers.google.com/youtube/player_parameters?hl=en
Expand Down Expand Up @@ -219,6 +239,11 @@ About Vimeo options, please refer to https://developer.vimeo.com/apis/oembed
<td>width</td>
<td>null</td>
</tr>
<tr>
<td rowspan="1">custom</td>
<td>url</td>
<td>MP4 URL</td>
</tr>
<tr>
<td>xhtml</td>
<td>false</td>
Expand Down
2 changes: 2 additions & 0 deletions js/jquery-modal-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ var ModalVideo = function () {
return this.getVimeoUrl(opt.vimeo, videoId);
} else if (channel === 'facebook') {
return this.getFacebookUrl(opt.facebook, videoId);
} else if (channel === 'custom') {
return opt.url;
}
return '';
}
Expand Down
2 changes: 1 addition & 1 deletion js/jquery-modal-video.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions js/modal-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ var ModalVideo = function () {
return this.getVimeoUrl(opt.vimeo, videoId);
} else if (channel === 'facebook') {
return this.getFacebookUrl(opt.facebook, videoId);
} else if (channel === 'custom') {
return opt.url;
}
return '';
}
Expand Down
Loading

0 comments on commit 5d80533

Please sign in to comment.