<commit_before>using Uno;
using Uno.UX;

using Fuse.Scripting;

namespace Fuse.Controls
{
	public partial class Video
	{
		static Video()
		{
			ScriptClass.Register(typeof(Video),
				new ScriptMethod<Video>("getDuration", getDuration, ExecutionThread.Any),
				new ScriptMethod<Video>("resume", resume, ExecutionThread.MainThread),
				new ScriptMethod<Video>("pause", pause, ExecutionThread.MainThread),
				new ScriptMethod<Video>("stop", stop, ExecutionThread.MainThread));
		}

		object _durationMutex = new object();

		// private fields used by ScriptClass for retrieving the position from JavaScript
		double _outDuration;
		void UpdateScriptClass(double duration)
		{
			lock (_durationMutex)
				_outDuration = duration;
		}

		/**
			Gets the duration of the Video in seconds. getDuration will return 0 until the video has initialized.

			@scriptmethod getDuration()
		*/
		static object getDuration(Context c, Video v, object[] args)
		{
			if (args.Length != 0)
				Fuse.Diagnostics.UserError("getDuration takes 0 arguments, but " + args.Length + " was supplied", v);

			lock (v._durationMutex)
				return (object)v._outDuration;
		}
<commit_msg>Fuse.Controls.Video: use ExecutionThread.JavaScript instead<commit_after>using Uno;
using Uno.UX;

using Fuse.Scripting;

namespace Fuse.Controls
{
	public partial class Video
	{
		static Video()
		{
			ScriptClass.Register(typeof(Video),
				new ScriptMethod<Video>("getDuration", getDuration, ExecutionThread.JavaScript),
				new ScriptMethod<Video>("resume", resume, ExecutionThread.MainThread),
				new ScriptMethod<Video>("pause", pause, ExecutionThread.MainThread),
				new ScriptMethod<Video>("stop", stop, ExecutionThread.MainThread));
		}

		object _durationMutex = new object();

		// private fields used by ScriptClass for retrieving the position from JavaScript
		double _outDuration;
		void UpdateScriptClass(double duration)
		{
			lock (_durationMutex)
				_outDuration = duration;
		}

		/**
			Gets the duration of the Video in seconds. getDuration will return 0 until the video has initialized.

			@scriptmethod getDuration()
		*/
		static object getDuration(Context c, Video v, object[] args)
		{
			if (args.Length != 0)
				Fuse.Diagnostics.UserError("getDuration takes 0 arguments, but " + args.Length + " was supplied", v);

			lock (v._durationMutex)
				return (object)v._outDuration;
		}

{'fraction_non_alphanumeric': 0.10265039966344132, 'fraction_numerical': 0.002524190155658393, 'mean_word_length': 4.343820224719101, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3947290', 'n_tokens_mistral': 784, 'n_tokens_neox': 687, 'n_words': 199}