Fullscreen API methods (Fixes #74), onSetup callback
This commit is contained in:
		| @ -11,9 +11,21 @@ plyr.setup({ | ||||
| 	html: 	templates.controls.render({}), | ||||
| 	captions: { | ||||
| 		defaultActive: true | ||||
| 	}, | ||||
| 	onSetup: function() { | ||||
| 		var player 	= this, | ||||
| 			type 	= player.media.tagName.toLowerCase(), | ||||
| 			toggle 	= document.querySelector("[data-toggle='fullscreen']"); | ||||
|  | ||||
| 		console.log("✓ Setup done for <" + type + ">"); | ||||
|  | ||||
| 		if(type === "video" && toggle) { | ||||
| 			toggle.addEventListener("click", player.toggleFullscreen, false); | ||||
| 		} | ||||
| 	} | ||||
| }); | ||||
|  | ||||
|  | ||||
| // Google analytics  | ||||
| // For demo site (http://[www.]plyr.io) only | ||||
| if(document.domain.indexOf("plyr.io") > -1) { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user