		
local num_files = gh_utils.drop_files_get_num_files()
if (num_files > 0) then

	local video_filename = gh_utils.drop_files_get_file_by_index(0)
	
	
	if (av1 > 0) then
	  gh_av.stop_audio_video_processing(av1)
	  gh_av.decoder_close(av1)
	  av1 = 0
	end  
	
	
	local loop_mode = 1
	av1 = gh_av.decoder_open(video_filename, loop_mode)
	
	update_video = 0
	update_audio = 0
	

	if (av1 > 0) then

		gh_av.set_volume(av1, volume)

		video_stream, audio_stream = gh_av.get_streams_index(av1)

		if (video_stream >=0) then
		  duration = gh_av.get_duration(av1)
		  video_width, video_height = gh_av.video_get_resolution(av1)
		  update_video = 1
		end  

		if (audio_stream >=0) then
		  update_audio = 1
		end  

		if (update_video == 1) then
		  local PF_U8_RGB = 1
		  local PF_U8_BGR = 2
		  video_tex = gh_av.video_init_texture(av1, PF_U8_RGB)
		end

		gh_av.start_audio_video_processing(av1, update_video, update_audio)
	  
	  
		if ((video_width > 0) and (video_height > 0)) then
			local r = video_width / video_height
			quad_width = winW * 0.8
			quad_height = quad_width/r
			gh_mesh.update_quad_size(mesh_quad, quad_width, quad_height)
		end
	  
	else

	  print("Unable to load " .. video_filename)

	end

	
end

