Added parameter to set the player's width

This commit is contained in:
Gregory Ballantine 2018-02-26 17:37:46 -05:00
parent 323803dc92
commit d2c2917a8b
3 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@
<script> <script>
$('.mup-player').MUPlayer({ $('.mup-player').MUPlayer({
'use_default_css': true, 'use_default_css': true,
'video_width': '720px',
'video_sources': [ 'video_sources': [
{ {
'link': 'http://techslides.com/demos/sample-videos/small.ogv', 'link': 'http://techslides.com/demos/sample-videos/small.ogv',

View File

@ -13,6 +13,7 @@
'default_volume': 50 'default_volume': 50
'default_position': 0 'default_position': 0
'video_sources': [] 'video_sources': []
'video_width': false
}, opt) }, opt)
## Functions ## Functions
@ -22,6 +23,10 @@
if settings.use_default_css if settings.use_default_css
addStylesheet('build/css/mup.css') addStylesheet('build/css/mup.css')
# set player width
if typeof settings.video_width == 'string'
wrapperElem.width(settings.video_width)
# create the video player # create the video player
createPlayer(wrapperElem) createPlayer(wrapperElem)

View File

@ -1,5 +1,6 @@
.mup-video .mup-video
vertical-align: top vertical-align: top
width: 100%
margin: 0 margin: 0
padding: 0 padding: 0