<commit_before><!DOCTYPE HTML>
<html>
	<head>
		<title>Kdp Api Play From/To attributes</title>
		<script type="text/javascript" src="../../../tests/qunit/qunit-bootstrap.js"></script>
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
		<script type="text/javascript" src="../../../mwEmbedLoader.php?debug=true"></script>
		<script type="text/javascript" src="resources/qunit-kaltura-bootstrap.js"></script>
		<script type="text/javascript">
		var kdp;
		function jsCallbackReady( playerId ) {
			console.log('jsCallback Ready', playerId );
			kdp = $( '#' + playerId )[0];

			kdp.addJsListener("playerPlayed", "runTest");
		}
		function runTest() {
			console.log( 'play time: ' + kdp.evaluate('{video.player.currentTime}') );
			console.log( 'start time: ' + toSeconds( $("#startTime").val() ) );
		}
		
		$( function() {
			$("#preview").click( function() {

				var startTime = $("#startTime").val(),
					endTime = $("#endTime").val();

				console.log('Start Time: ' + startTime + ', End Time: ' + endTime );

				startTime = toSeconds(startTime);
				endTime = toSeconds(endTime);

				kdp.sendNotification("doStop");

				kdp.setKDPAttribute("mediaProxy", "mediaPlayFrom", startTime );
				kdp.setKDPAttribute("mediaProxy", "mediaPlayTo", endTime );

				kdp.sendNotification("doPlay");
			});
		});

		var toSeconds = function(time) {
			var arr = time.split(":");
			var seconds = parseFloat( (arr[0] * 60) * 60 );
			seconds += parseFloat( arr[1] * 60 );
			seconds += parseFloat ( arr[2] );
			return seconds;
		};

		var toHHMMSS = function (sec) {
			var sec_numb    = parseInt(sec);
			var hours   = Math.floor(sec_numb / 3600);
			var minutes = Math.floor((sec_numb - (hours * 3600)) / 60);
			var seconds = sec_numb - (hours * 3600) - (minutes * 60);

			if (hours   < 10) {hours   = "0"+hours;}
			if (minutes < 10) {minutes = "0"+minutes;}
			if (seconds < 10) {seconds = "0"+seconds;}
			var time    = hours+':'+minutes+':'+seconds;
			return time;
		}
		</script>
	</head>
	<body>
		<h1>Kdp Api Play From/To attributes</h1>
		<a href="?forceMobileHTML5">Force Mobile HTML5 Player</a><br /><br />
		<object id="kdp3" name="kdp3" type="application/x-shockwave-flash" allowFullScreen="true" allowNetworking="all" allowScriptAccess="always" height="333" width="400" bgcolor="#000000" xmlns:dc="http://purl.org/dc/terms/" xmlns:media="http://search.yahoo.com/searchmonkey/media/" rel="media:video" resource="http://www.kaltura.com/index.php/kwidget/cache_st/1308649222/wid/_423851/uiconf_id/4792432/entry_id/1_sfrj36g3" data="http://www.kaltura.com/index.php/kwidget/cache_st/1308649222/wid/_423851/uiconf_id/4792432/entry_id/1_sfrj36g3">
			<param name="allowFullScreen" value="true" />
			<param name="allowNetworking" value="all" />
			<param name="allowScriptAccess" value="always" />
			<param name="bgcolor" value="#000000" />
			<param name="flashVars" value="&externalInterfaceDisabled=false&steamerType=rtmp&mediaProxy.mediaPlayFrom=30&mediaProxy.mediaPlayTo=40" />
			<param name="movie" value="http://www.kaltura.com/index.php/kwidget/cache_st/1308649222/wid/_423851/uiconf_id/4792432/entry_id/1_sfrj36g3" />
		</object>
		<br /><br />
		Start Time: <input id="startTime" value="00:00:10" /><br />
		End Time: <input id="endTime" value="00:00:30" /><br />
		<input id="preview" type="button" value=" Preview " />
	</body>
</html><commit_msg>fixed #27 make input values match flashvars default <commit_after><!DOCTYPE HTML>
<html>
	<head>
		<title>Kdp Api Play From/To attributes</title>
		<script type="text/javascript" src="../../../tests/qunit/qunit-bootstrap.js"></script>
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
		<script type="text/javascript" src="../../../mwEmbedLoader.php?debug=true"></script>
		<script type="text/javascript" src="resources/qunit-kaltura-bootstrap.js"></script>
		<script type="text/javascript">
		var kdp;
		function jsCallbackReady( playerId ) {
			console.log('jsCallback Ready', playerId );
			kdp = $( '#' + playerId )[0];

			kdp.addJsListener("playerPlayed", "runTest");
		}
		function runTest() {
			console.log( 'play time: ' + kdp.evaluate('{video.player.currentTime}') );
			console.log( 'start time: ' + toSeconds( $("#startTime").val() ) );
		}
		
		$( function() {
			$("#preview").click( function() {

				var startTime = $("#startTime").val(),
					endTime = $("#endTime").val();

				console.log('Start Time: ' + startTime + ', End Time: ' + endTime );

				startTime = toSeconds(startTime);
				endTime = toSeconds(endTime);

				kdp.setKDPAttribute("mediaProxy", "mediaPlayFrom", startTime );
				kdp.setKDPAttribute("mediaProxy", "mediaPlayTo", endTime );

				kdp.sendNotification("doPlay");
			});
		});

		var toSeconds = function(time) {
			var arr = time.split(":");
			var seconds = parseFloat( (arr[0] * 60) * 60 );
			seconds += parseFloat( arr[1] * 60 );
			seconds += parseFloat ( arr[2] );
			return seconds;
		};

		var toHHMMSS = function (sec) {
			var sec_numb    = parseInt(sec);
			var hours   = Math.floor(sec_numb / 3600);
			var minutes = Math.floor((sec_numb - (hours * 3600)) / 60);
			var seconds = sec_numb - (hours * 3600) - (minutes * 60);

			if (hours   < 10) {hours   = "0"+hours;}
			if (minutes < 10) {minutes = "0"+minutes;}
			if (seconds < 10) {seconds = "0"+seconds;}
			var time    = hours+':'+minutes+':'+seconds;
			return time;
		}
		</script>
	</head>
	<body>
		<h1>Kdp Api Play From/To attributes</h1>
		<a href="?forceMobileHTML5">Force Mobile HTML5 Player</a><br /><br />
		<object id="kdp3" name="kdp3" type="application/x-shockwave-flash" allowFullScreen="true" allowNetworking="all" allowScriptAccess="always" height="333" width="400" bgcolor="#000000" xmlns:dc="http://purl.org/dc/terms/" xmlns:media="http://search.yahoo.com/searchmonkey/media/" rel="media:video" resource="http://www.kaltura.com/index.php/kwidget/cache_st/1308649222/wid/_423851/uiconf_id/4792432/entry_id/1_sfrj36g3" data="http://www.kaltura.com/index.php/kwidget/cache_st/1308649222/wid/_423851/uiconf_id/4792432/entry_id/1_sfrj36g3">
			<param name="allowFullScreen" value="true" />
			<param name="allowNetworking" value="all" />
			<param name="allowScriptAccess" value="always" />
			<param name="bgcolor" value="#000000" />
			<param name="flashVars" value="&externalInterfaceDisabled=false&steamerType=rtmp&mediaProxy.mediaPlayFrom=10&mediaProxy.mediaPlayTo=30" />
			<param name="movie" value="http://www.kaltura.com/index.php/kwidget/cache_st/1308649222/wid/_423851/uiconf_id/4792432/entry_id/1_sfrj36g3" />
		</object>
		<br /><br />
		Start Time: <input id="startTime" value="00:00:10" /><br />
		End Time: <input id="endTime" value="00:00:30" /><br />
		<input id="preview" type="button" value=" Preview " />
	</body>
</html>
{'fraction_non_alphanumeric': 0.19385377221089425, 'fraction_numerical': 0.046606466647247304, 'mean_word_length': 4.282307692307692, 'pattern_counts': {'":': 2, '<': 89, '<?xml version=': 0, '>': 83, 'https://': 2, 'lorem ipsum': 0, 'www.': 6, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5445067', 'n_tokens_mistral': 2881, 'n_tokens_neox': 2411, 'n_words': 420}