Merge for new source api changes
This commit is contained in:
		@ -12,6 +12,7 @@
 | 
				
			|||||||
- Better handling of mission controls (fixes #132)
 | 
					- Better handling of mission controls (fixes #132)
 | 
				
			||||||
- Retain classname on source change (fixes #120)
 | 
					- Retain classname on source change (fixes #120)
 | 
				
			||||||
- Increased thumb size on seek (partially fixes #130)
 | 
					- Increased thumb size on seek (partially fixes #130)
 | 
				
			||||||
 | 
					- Passing no argument to `source` api method, now returns current source
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## v1.3.5
 | 
					## v1.3.5
 | 
				
			||||||
- Fixed bug with API use on basic supported browsers
 | 
					- Fixed bug with API use on basic supported browsers
 | 
				
			||||||
 | 
				
			|||||||
@ -444,7 +444,7 @@ Here's a list of the methods supported:
 | 
				
			|||||||
  </tr>
 | 
					  </tr>
 | 
				
			||||||
  <tr>
 | 
					  <tr>
 | 
				
			||||||
    <td><code>source(...)</code></td>
 | 
					    <td><code>source(...)</code></td>
 | 
				
			||||||
    <td>Array or (null|undefined)</td>
 | 
					    <td>Array or undefined</td>
 | 
				
			||||||
    <td>
 | 
					    <td>
 | 
				
			||||||
      Get/Set the media source.
 | 
					      Get/Set the media source.
 | 
				
			||||||
      <br><br>
 | 
					      <br><br>
 | 
				
			||||||
@ -459,8 +459,8 @@ Here's a list of the methods supported:
 | 
				
			|||||||
      <strong>YouTube</strong><br>
 | 
					      <strong>YouTube</strong><br>
 | 
				
			||||||
      Currently this API method only accepts a YouTube ID when used with a YouTube player. I will add URL support soon, along with being able to swap between types (e.g. YouTube to Audio or Video and vice versa.)
 | 
					      Currently this API method only accepts a YouTube ID when used with a YouTube player. I will add URL support soon, along with being able to swap between types (e.g. YouTube to Audio or Video and vice versa.)
 | 
				
			||||||
      <br><br>
 | 
					      <br><br>
 | 
				
			||||||
      <strong> null or undefined </strong><br>
 | 
					      <strong>undefined</strong><br>
 | 
				
			||||||
      Returns the current media source. Works for both native videos and embeds.
 | 
					      Returns the current media source url. Works for both native videos and embeds.
 | 
				
			||||||
    </td>
 | 
					    </td>
 | 
				
			||||||
  </tr>
 | 
					  </tr>
 | 
				
			||||||
  <tr>
 | 
					  <tr>
 | 
				
			||||||
@ -707,4 +707,3 @@ Also these links helped created Plyr:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## Copyright and License
 | 
					## Copyright and License
 | 
				
			||||||
[The MIT license](license.md).
 | 
					[The MIT license](license.md).
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -1930,6 +1930,35 @@
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Add common function to retrieve media source
 | 
				
			||||||
 | 
					        function _source(source) {
 | 
				
			||||||
 | 
					            // If not null or undefined, parse it
 | 
				
			||||||
 | 
					            if(typeof source !== 'undefined') {
 | 
				
			||||||
 | 
					                _updateSource(source);
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // Return the current source
 | 
				
			||||||
 | 
					            var url;
 | 
				
			||||||
 | 
					            switch(plyr.type) {
 | 
				
			||||||
 | 
					                case 'youtube':
 | 
				
			||||||
 | 
					                    url = plyr.embed.getVideoUrl();
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                case 'vimeo':
 | 
				
			||||||
 | 
					                    plyr.embed.api('getVideoUrl', function (value) {
 | 
				
			||||||
 | 
					                        url = value;
 | 
				
			||||||
 | 
					                    });
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                default:
 | 
				
			||||||
 | 
					                    url = plyr.media.currentSrc;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return url || '';
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Update source
 | 
					        // Update source
 | 
				
			||||||
        // Sources are not checked for support so be careful
 | 
					        // Sources are not checked for support so be careful
 | 
				
			||||||
        function _updateSource(source) {
 | 
					        function _updateSource(source) {
 | 
				
			||||||
@ -2394,7 +2423,7 @@
 | 
				
			|||||||
            rewind:             _rewind,
 | 
					            rewind:             _rewind,
 | 
				
			||||||
            forward:            _forward,
 | 
					            forward:            _forward,
 | 
				
			||||||
            seek:               _seek,
 | 
					            seek:               _seek,
 | 
				
			||||||
            source:             _updateSource,
 | 
					            source:             _source,
 | 
				
			||||||
            poster:             _updatePoster,
 | 
					            poster:             _updatePoster,
 | 
				
			||||||
            setVolume:          _setVolume,
 | 
					            setVolume:          _setVolume,
 | 
				
			||||||
            togglePlay:         _togglePlay,
 | 
					            togglePlay:         _togglePlay,
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user