@@ -13,19 +13,19 @@ public int VideoWidth
1313 get
1414 {
1515 JSNative . PushString ( "videoWidth" ) ;
16- return ( int ) JSNative . GetNumber ( JSNative . GetProperty ( NativeHandle ) ) ;
16+ return ( int ) JSNative . GetNumber ( JSNative . GetProperty ( NativeHandle ) ) ;
1717 }
1818 }
19-
19+
2020 public int VideoHeight
2121 {
2222 get
2323 {
2424 JSNative . PushString ( "videoHeight" ) ;
25- return ( int ) JSNative . GetNumber ( JSNative . GetProperty ( NativeHandle ) ) ;
25+ return ( int ) JSNative . GetNumber ( JSNative . GetProperty ( NativeHandle ) ) ;
2626 }
2727 }
28-
28+
2929 [ MonoPInvokeCallback ( typeof ( JSNative . JSDelegate ) ) ]
3030 private static void ResizeEvent ( IntPtr ptr )
3131 {
@@ -34,13 +34,13 @@ private static void ResizeEvent(IntPtr ptr)
3434 var handle = new JSHandle ( ptr , true ) ;
3535 if ( ! JSNative . IsObject ( handle ) )
3636 return ;
37-
37+
3838 var el = Acquire < HTMLVideoElement > ( handle ) ;
3939 Log . Debug ( $ "Received HTMLVideoElement.Resize { el . VideoWidth } x{ el . VideoHeight } ") ;
4040
4141 if ( el . VideoWidth == 0 || el . VideoHeight == 0 )
4242 Debug . LogError ( $ "HTMLVideoElement.Resize - Wrong size: { el . VideoWidth } *{ el . VideoHeight } ") ;
43-
43+
4444 el . SetupTexture ( ) ;
4545 el . VideoReceived ? . Invoke ( el . Texture ) ;
4646 }
@@ -49,10 +49,10 @@ private static void ResizeEvent(IntPtr ptr)
4949 Log . Error ( $ "Error happened on HTMLVideoElement.VideoReceived ( Is your listeners working correctly ? ): { Environment . NewLine } { e . Message } ") ;
5050 }
5151 }
52-
52+
5353 public delegate void VideoReceivedDelegate ( Texture2D tex ) ;
5454 public event VideoReceivedDelegate VideoReceived ;
55-
55+
5656 public Texture2D Texture { get ; private set ; }
5757 private readonly int m_TextureId ;
5858
@@ -76,8 +76,8 @@ void SetupTexture()
7676 {
7777 if ( Texture != null )
7878 Object . Destroy ( Texture ) ;
79-
80- Texture = Texture2D . CreateExternalTexture ( VideoWidth , VideoHeight , TextureFormat . RGBA32 , false , true , ( IntPtr ) m_TextureId ) ;
79+
80+ Texture = Texture2D . CreateExternalTexture ( VideoWidth , VideoHeight , TextureFormat . RGBA32 , false , true , ( IntPtr ) m_TextureId ) ;
8181 }
8282 }
83- }
83+ } ;
0 commit comments