extension/content.js
// Called on load, will seek the player to the stored position, and pause video.
Called on load, will seek the player to the stored position, and pause video.
Called on load will seek the player to the stored position and pause video .
function SeekPlayer(playerWindow)
{
	chrome.storage.sync.get(window.location.href.replace("#video-container",""), function(positionObject){
		var keys = Object.keys(positionObject);
		if(keys.length > 0)
		{
			var key = keys[0];
			var position = JSON.parse(positionObject[key]);
			var elem = playerWindow.document.createElement("script");
			elem.type = "text/javascript";
			var playerHtml = "jwplayer(playerName).seek(" + position.position + "); jwplayer(playerName).pause();";
			elem.innerHTML = playerHtml;					
			playerWindow.document.head.appendChild(elem);
		}
	});
}
function SeekPlayer ( playerWindow ) { chrome . storage . sync . get ( window . location . href . replace ( "#video-container" , "" ) , function ( positionObject ) { var keys = Object . keys ( positionObject ) ; if ( keys . length > 0 ) { var key = keys [ 0 ] ; var position = JSON . parse ( positionObject [ key ] ) ; var elem = playerWindow . document . createElement ( "script" ) ; elem . type = "text/javascript" ; var playerHtml = "jwplayer(playerName).seek(" + position . position + "); jwplayer(playerName).pause();" ; elem . innerHTML = playerHtml ; playerWindow . document . head . appendChild ( elem ) ; } } ) ; }
Called on load, will seek the player to the stored position, and pause video.
Called on load will seek the player to the stored position and pause video .