using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
using MEC;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Video;

// Token: 0x02000272 RID: 626
[Token(Token = "0x2000272")]
[RequireComponent(typeof(RawImage))]
public class UIVideoPlayer : MonoBehaviour
{
	// Token: 0x170000FA RID: 250
	// (get) Token: 0x06001843 RID: 6211 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x170000FA")]
	public bool IsPlaying
	{
		[Token(Token = "0x6001843")]
		[Address(RVA = "0x8BDD30", Offset = "0x8BCB30", VA = "0x1808BDD30")]
		get
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}
	}

	// Token: 0x170000FB RID: 251
	// (get) Token: 0x06001844 RID: 6212 RVA: 0x0003B4E8 File Offset: 0x000396E8
	// (set) Token: 0x06001845 RID: 6213 RVA: 0x0003B4FC File Offset: 0x000396FC
	[Token(Token = "0x170000FB")]
	public bool IsPaused
	{
		[Token(Token = "0x6001844")]
		[Address(RVA = "0x8BDD20", Offset = "0x8BCB20", VA = "0x1808BDD20")]
		get;
		[Token(Token = "0x6001845")]
		[Address(RVA = "0x8BDF20", Offset = "0x8BCD20", VA = "0x1808BDF20")]
		private set;
	}

	// Token: 0x170000FC RID: 252
	// (get) Token: 0x06001846 RID: 6214 RVA: 0x0003B510 File Offset: 0x00039710
	// (set) Token: 0x06001847 RID: 6215 RVA: 0x0003B524 File Offset: 0x00039724
	[Token(Token = "0x170000FC")]
	public bool IsSeeking
	{
		[Token(Token = "0x6001846")]
		[Address(RVA = "0x8BDDC0", Offset = "0x8BCBC0", VA = "0x1808BDDC0")]
		get;
		[Token(Token = "0x6001847")]
		[Address(RVA = "0x8BDF30", Offset = "0x8BCD30", VA = "0x1808BDF30")]
		private set;
	}

	// Token: 0x170000FD RID: 253
	// (get) Token: 0x06001848 RID: 6216 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x170000FD")]
	public double Length
	{
		[Token(Token = "0x6001848")]
		[Address(RVA = "0x8BDDD0", Offset = "0x8BCBD0", VA = "0x1808BDDD0")]
		get
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}
	}

	// Token: 0x170000FE RID: 254
	// (get) Token: 0x06001849 RID: 6217 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x170000FE")]
	public float Time
	{
		[Token(Token = "0x6001849")]
		[Address(RVA = "0x8BDE80", Offset = "0x8BCC80", VA = "0x1808BDE80")]
		get
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}
	}

	// Token: 0x0600184A RID: 6218 RVA: 0x0003B538 File Offset: 0x00039738
	[Token(Token = "0x600184A")]
	[Address(RVA = "0x8BD550", Offset = "0x8BC350", VA = "0x1808BD550")]
	public void InitVideoPlayer([Optional] VideoPlayer videoTargetPlayer, [Optional] AudioSource audioTargetPlayer)
	{
		if (!this.isInitialized)
		{
			RawImage component = base.GetComponent<RawImage>();
			this.rawImage = component;
			Texture texture = this.rawImage.m_Texture;
			this.mask = texture;
			int num = 0;
			if (!(videoTargetPlayer != num))
			{
				VideoPlayer videoPlayer = base.gameObject.AddComponent<VideoPlayer>();
			}
			this.videoPlayer = videoTargetPlayer;
			int num2 = 0;
			AudioSource audioSource;
			if (!(audioTargetPlayer != num2))
			{
				audioSource = base.gameObject.AddComponent<AudioSource>();
			}
			this.audioSource = audioSource;
			VideoPlayer videoPlayer2 = this.videoPlayer;
			VideoPlayer.EventHandler eventHandler = delegate(VideoPlayer source)
			{
				UIVideoPlayer.VideoPlayerEventHandler onPlayerSeekCompleted = this.OnPlayerSeekCompleted;
				if (onPlayerSeekCompleted != 0)
				{
					onPlayerSeekCompleted();
				}
				this.<IsSeeking>k__BackingField = false;
			};
			videoPlayer2.seekCompleted += eventHandler;
			VideoPlayer videoPlayer3 = this.videoPlayer;
			int num3 = 0;
			videoPlayer3.playOnAwake = num3 != 0;
			AudioSource audioSource2 = this.audioSource;
			int num4 = 0;
			audioSource2.playOnAwake = num4 != 0;
			this.audioSource.Pause();
			this.audioSource.volume = 0.7f;
			this.isInitialized = true;
		}
	}

	// Token: 0x0600184B RID: 6219 RVA: 0x0003B624 File Offset: 0x00039824
	[Token(Token = "0x600184B")]
	[Address(RVA = "0x8BD990", Offset = "0x8BC790", VA = "0x1808BD990")]
	public void ResetVideoData()
	{
		RawImage rawImage = this.rawImage;
		this.<IsPaused>k__BackingField = false;
		Texture texture = this.mask;
		rawImage.texture = texture;
		string empty = string.Empty;
		this.videoClipName = empty;
		throw new NullReferenceException();
	}

	// Token: 0x0600184C RID: 6220 RVA: 0x0003B660 File Offset: 0x00039860
	[Token(Token = "0x600184C")]
	[Address(RVA = "0x8BD4C0", Offset = "0x8BC2C0", VA = "0x1808BD4C0")]
	public void Dispose()
	{
		this.OnPlayerStarted = (ulong)0L;
		RawImage rawImage = this.rawImage;
		this.<IsPaused>k__BackingField = false;
		Texture texture = this.mask;
		rawImage.texture = texture;
		string empty = string.Empty;
		this.videoClipName = empty;
		throw new NullReferenceException();
	}

	// Token: 0x0600184D RID: 6221 RVA: 0x0003B6A4 File Offset: 0x000398A4
	[Token(Token = "0x600184D")]
	[Address(RVA = "0x413D20", Offset = "0x412B20", VA = "0x180413D20")]
	public void UpdateVideoClipName(string clipName)
	{
		/*
An exception occurred when decompiling this method (0600184D)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void UIVideoPlayer::UpdateVideoClipName(System.String)

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	Block_0:; 	stfld:string(UIVideoPlayer::videoClipName, ldloc:UIVideoPlayer(this), ldloc:string(clipName)); }; 
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1810
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 344
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
   --- End of inner exception stack trace ---
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
   at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
*/;
	}

	// Token: 0x0600184E RID: 6222 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600184E")]
	[Address(RVA = "0x8BD860", Offset = "0x8BC660", VA = "0x1808BD860")]
	public void Play()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600184F RID: 6223 RVA: 0x0003B6B8 File Offset: 0x000398B8
	[Token(Token = "0x600184F")]
	[Address(RVA = "0x8BD840", Offset = "0x8BC640", VA = "0x1808BD840")]
	public void PlayFromBeginning()
	{
		this.Stop();
		this.Play();
	}

	// Token: 0x06001850 RID: 6224 RVA: 0x0003B6D4 File Offset: 0x000398D4
	[Token(Token = "0x6001850")]
	[Address(RVA = "0x8BD800", Offset = "0x8BC600", VA = "0x1808BD800")]
	public void Pause()
	{
		if (!this.<IsPaused>k__BackingField)
		{
			this.videoPlayer.Pause();
			this.audioSource.Pause();
			this.<IsPaused>k__BackingField = true;
		}
	}

	// Token: 0x06001851 RID: 6225 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001851")]
	[Address(RVA = "0x8BDA00", Offset = "0x8BC800", VA = "0x1808BDA00")]
	public void Resume()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001852 RID: 6226 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001852")]
	[Address(RVA = "0x8BDAD0", Offset = "0x8BC8D0", VA = "0x1808BDAD0")]
	public void Stop()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001853 RID: 6227 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001853")]
	[Address(RVA = "0x8BDB60", Offset = "0x8BC960", VA = "0x1808BDB60")]
	public bool TryJumpTo(int seconds, out double targetTime)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001854 RID: 6228 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001854")]
	[Address(RVA = "0x8BD790", Offset = "0x8BC590", VA = "0x1808BD790")]
	private IEnumerator<float> InitVideoPlayer()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001855 RID: 6229 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001855")]
	[Address(RVA = "0x8BD450", Offset = "0x8BC250", VA = "0x1808BD450")]
	private IEnumerator<float> CheckVideoPlaying()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001856 RID: 6230 RVA: 0x0003B710 File Offset: 0x00039910
	[Token(Token = "0x6001856")]
	[Address(RVA = "0x3088F0", Offset = "0x3076F0", VA = "0x1803088F0")]
	public UIVideoPlayer()
	{
	}

	// Token: 0x0400226B RID: 8811
	[Cpp2IlInjected.FieldOffset(Offset = "0x18")]
	[Token(Token = "0x400226B")]
	[SerializeField]
	private string videoClipName;

	// Token: 0x0400226C RID: 8812
	[Cpp2IlInjected.FieldOffset(Offset = "0x20")]
	[Token(Token = "0x400226C")]
	[SerializeField]
	private bool isStreamingMode;

	// Token: 0x0400226D RID: 8813
	[Cpp2IlInjected.FieldOffset(Offset = "0x28")]
	[Token(Token = "0x400226D")]
	public UIVideoPlayer.VideoPlayerEventHandler OnPlayerStarted;

	// Token: 0x0400226E RID: 8814
	[Cpp2IlInjected.FieldOffset(Offset = "0x30")]
	[Token(Token = "0x400226E")]
	public UIVideoPlayer.VideoPlayerEventHandler OnPlayerFinished;

	// Token: 0x0400226F RID: 8815
	[Cpp2IlInjected.FieldOffset(Offset = "0x38")]
	[Token(Token = "0x400226F")]
	public UIVideoPlayer.VideoPlayerEventHandler OnPlayerSeekCompleted;

	// Token: 0x04002270 RID: 8816
	[Cpp2IlInjected.FieldOffset(Offset = "0x40")]
	[Token(Token = "0x4002270")]
	private RawImage rawImage;

	// Token: 0x04002271 RID: 8817
	[Cpp2IlInjected.FieldOffset(Offset = "0x48")]
	[Token(Token = "0x4002271")]
	private Texture mask;

	// Token: 0x04002272 RID: 8818
	[Cpp2IlInjected.FieldOffset(Offset = "0x50")]
	[Token(Token = "0x4002272")]
	private VideoPlayer videoPlayer;

	// Token: 0x04002273 RID: 8819
	[Cpp2IlInjected.FieldOffset(Offset = "0x58")]
	[Token(Token = "0x4002273")]
	private AudioSource audioSource;

	// Token: 0x04002274 RID: 8820
	[Cpp2IlInjected.FieldOffset(Offset = "0x60")]
	[Token(Token = "0x4002274")]
	private CoroutineHandle videoInitializationProcessor;

	// Token: 0x04002275 RID: 8821
	[Cpp2IlInjected.FieldOffset(Offset = "0x64")]
	[Token(Token = "0x4002275")]
	private CoroutineHandle videoPlayingProcessor;

	// Token: 0x04002276 RID: 8822
	[Cpp2IlInjected.FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4002276")]
	private bool isInitialized;

	// Token: 0x02000273 RID: 627
	[Token(Token = "0x2000273")]
	public sealed class VideoPlayerEventHandler : MulticastDelegate
	{
		// Token: 0x06001859 RID: 6233 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6001859")]
		[Address(RVA = "0x44EA10", Offset = "0x44D810", VA = "0x18044EA10")]
		public VideoPlayerEventHandler(object @object, IntPtr method)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600185A RID: 6234 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600185A")]
		[Address(RVA = "0x5FA210", Offset = "0x5F9010", VA = "0x1805FA210", Slot = "12")]
		public void Invoke()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600185B RID: 6235 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600185B")]
		[Address(RVA = "0x5FA1E0", Offset = "0x5F8FE0", VA = "0x1805FA1E0", Slot = "13")]
		public IAsyncResult BeginInvoke(AsyncCallback callback, object @object)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600185C RID: 6236 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600185C")]
		[Address(RVA = "0x44E730", Offset = "0x44D530", VA = "0x18044E730", Slot = "14")]
		public void EndInvoke(IAsyncResult result)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}
	}
}
