<commit_before>package eu.screenwerk.player
{
	import com.adobesamples.mediawidget.MediaWidget;
	
	import flash.events.Event;
	import flash.filesystem.File;
	
	import mx.core.Application;
	import mx.core.UIComponent; 
	
	public class SWVideoPlayer extends UIComponent
	{
		private var sw_id:uint;
		private var is_playing:Boolean = false;
		
		public function SWVideoPlayer(sw_id:uint) 
		{

			this.sw_id = sw_id;

			this.x = 0;
			this.y = 0;
			//this.maintainAspectRatio = false;

			this.addEventListener(Event.ADDED, _play);
			this.addEventListener(Event.REMOVED, _stop);
		}

		private function _play(event:Event):void
		{
    		event.stopPropagation();
			if (this.is_playing) return;
			this.is_playing = true;

			this.width = parent.width;
			this.height = parent.height;
			
			var video_file:File = Application.application.sw_dir.resolvePath(this.sw_id + '.video');

		    var mywidget:MediaWidget=new MediaWidget(); 
		    mywidget.width=parent.width; 
		    mywidget.height = parent.height; 
		    trace ( video_file.nativePath );
		    this.addChild(mywidget); 
 		}
 		
		private function _stop(event:Event):void
		{
			event.stopPropagation();
			

		}

	}
}<commit_msg>re #67: we almost have video<commit_after>package eu.screenwerk.player
{
	import com.adobesamples.mediawidget.MediaWidget;
	
	import flash.events.Event;
	import flash.filesystem.File;
	
	import mx.core.Application;
	import mx.core.UIComponent; 
	
	public class SWVideoPlayer extends UIComponent
	{
		private var sw_id:uint;
		private var is_playing:Boolean = false;
		
		public function SWVideoPlayer(sw_id:uint) 
		{

			this.sw_id = sw_id;

			this.x = 0;
			this.y = 0;
			//this.maintainAspectRatio = false;

			this.addEventListener(Event.ADDED, _play);
			this.addEventListener(Event.REMOVED, _stop);
		}

		private function _play(event:Event):void
		{
    		event.stopPropagation();
			if (this.is_playing) return;
			this.is_playing = true;

			this.width = parent.width;
			this.height = parent.height;
			
			//var video_file:File = Application.application.sw_dir.resolvePath(this.sw_id + '.video');
			var video_file:File = Application.application.sw_dir.resolvePath('caption_video.flv');

		    var mywidget:MediaWidget = new MediaWidget(); 
		    mywidget.width = this.width; 
		    mywidget.height = this.height; 
		    trace ( video_file.nativePath );
		    //mywidget.source = video_file.url;
		    this.addChild(mywidget); 
		    mywidget.removeEmailToWindow();
 		}
 		
		private function _stop(event:Event):void
		{
			event.stopPropagation();
			

		}

	}
}
{'fraction_non_alphanumeric': 0.11102454226723803, 'fraction_numerical': 0.002337358784573432, 'mean_word_length': 3.3822525597269624, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6716028', 'n_tokens_mistral': 1005, 'n_tokens_neox': 857, 'n_words': 151}