question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error JsonReaderException when play Player scene

See original GitHub issue

I have this error when i run the Player scene !

JsonReaderException: ‘a’ is an invalid start of a property name. Expected a ‘"’. LineNumber: 0 | BytePositionInLine: 1. System.Text.Json.ThrowHelper.ThrowJsonReaderException (System.Text.Json.Utf8JsonReader& json, System.Text.Json.ExceptionResource resource, System.Byte nextByte, System.ReadOnlySpan1[T] bytes) (at <5542c387b88f44609b3d7ce7b1f71a4a>:0) System.Text.Json.Utf8JsonReader.ReadSingleSegment () (at <5542c387b88f44609b3d7ce7b1f71a4a>:0) System.Text.Json.Utf8JsonReader.Read () (at <5542c387b88f44609b3d7ce7b1f71a4a>:0) System.Text.Json.JsonDocument.Parse (System.ReadOnlySpan1[T] utf8JsonSpan, System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonDocument+MetadataDb& database, System.Text.Json.JsonDocument+StackRowStack& stack) (at <5542c387b88f44609b3d7ce7b1f71a4a>:0) System.Text.Json.JsonDocument.Parse (System.ReadOnlyMemory1[T] utf8Json, System.Text.Json.JsonReaderOptions readerOptions, System.Byte[] extraRentedBytes) (at <5542c387b88f44609b3d7ce7b1f71a4a>:0) System.Text.Json.JsonDocument.Parse (System.ReadOnlyMemory1[T] json, System.Text.Json.JsonDocumentOptions options) (at <5542c387b88f44609b3d7ce7b1f71a4a>:0) System.Text.Json.JsonDocument.Parse (System.String json, System.Text.Json.JsonDocumentOptions options) (at <5542c387b88f44609b3d7ce7b1f71a4a>:0) YoutubeExplode.Internal.Json.Parse (System.String source) (at <1bb2d25c2a5f4a34b9b261f72723a3f7>:0) YoutubeExplode.Internal.Extensions.GenericExtensions.Pipe[TIn,TOut] (TIn input, System.Func2[T,TResult] transform) (at <1bb2d25c2a5f4a34b9b261f72723a3f7>:0) YoutubeExplode.ReverseEngineering.Responses.WatchPage.TryGetPlayerConfig () (at <1bb2d25c2a5f4a34b9b261f72723a3f7>:0) YoutubeExplode.Videos.Streams.StreamClient+<GetStreamContextFromWatchPageAsync>d__4.MoveNext () (at <1bb2d25c2a5f4a34b9b261f72723a3f7>:0) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) YoutubeExplode.Videos.Streams.StreamClient+<GetManifestAsync>d__6.MoveNext () (at <1bb2d25c2a5f4a34b9b261f72723a3f7>:0) — End of stack trace from previous location where exception was thrown — System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0) YoutubePlayer.YoutubePlayer+<PlayVideoAsync>d__9.MoveNext () (at Assets/YoutubePlayer/Scripts/YoutubePlayer.cs:63) UnityEngine.Debug:LogException(Exception) YoutubePlayer.<PlayVideoAsync>d__9:MoveNext() (at Assets/YoutubePlayer/Scripts/YoutubePlayer.cs:80) System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetException(Exception) YoutubeExplode.Videos.Streams.<GetManifestAsync>d__6:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetException(Exception) YoutubeExplode.Videos.Streams.<GetStreamContextFromWatchPageAsync>d__4:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(WatchPage) YoutubeExplode.ReverseEngineering.Responses.<GetAsync>d__10:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(WatchPage) YoutubeExplode.Internal.<WrapAsync>d__11:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(WatchPage) YoutubeExplode.ReverseEngineering.Responses.<<GetAsync>b__0>d:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(String) YoutubeExplode.ReverseEngineering.<GetStringAsync>d__6:MoveNext() UnityEngine.UnitySynchronizationContext:ExecuteTasks()

Error occurs when running this line, YoutubePlayer.cs line 63: var streamManifest = await youtubeClient.Videos.Streams.GetManifestAsync(videoUrl);

Do you have an answer to this error?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
DaniloCCPcommented, Dec 10, 2020

I have updated YoutubeExplode to 5.1.9, which should fix the issue.

How it can I get the latest (5.1.9) dll from YouTubeExplode? then I think that dll should be put in the plugin folder overwriting the existing one

It is simple actually. You can download the nuget package from https://www.nuget.org/packages/YoutubeExplode/, rename the file extension from .nupkg to .zip, extract, find the file lib/net461/YoutubeExplode.dll, and replace the file under Assets/YoutubePlayer/Plugins/YoutubeExplode.dll. If dependencies of the nuget package changes, dependencies need to be updated as well. There are nuget managers for Unity that could potentially do this cleanly, but I haven’t looked into this yet (since this repo is basically a prof-of-concept, nothing more).

Thank you. In the mean time I downloaded the YoutubeExplode Repository, recompiled it and put the dll in Assets/YoutubePlayer/Plugins/YoutubeExplode.dll. It seems to work well, at least for now

1reaction
iBichacommented, Dec 10, 2020

I have updated YoutubeExplode to 5.1.9, which should fix the issue.

How it can I get the latest (5.1.9) dll from YouTubeExplode? then I think that dll should be put in the plugin folder overwriting the existing one

It is simple actually. You can download the nuget package from https://www.nuget.org/packages/YoutubeExplode/, rename the file extension from .nupkg to .zip, extract, find the file lib/net461/YoutubeExplode.dll, and replace the file under Assets/YoutubePlayer/Plugins/YoutubeExplode.dll. If dependencies of the nuget package changes, dependencies need to be updated as well. There are nuget managers for Unity that could potentially do this cleanly, but I haven’t looked into this yet (since this repo is basically a prof-of-concept, nothing more).

Read more comments on GitHub >

github_iconTop Results From Across the Web

JsonreaderException Please help!!!! : r/playrust
i'm having the same problem..and its been a week i bought rust and i'm unable to play....official server list is zero always and...
Read more >
'a' is an invalid start of a property name · Issue #479 · Tyrrrz ...
Hi There, I'm starting to see this issue pop up now. ---> System.Text.Json.JsonReaderException: 'a' is an invalid start of a property name.
Read more >
Amazon Lambda in C# - JsonReaderException
My experience with AWS Lambda in C# in a little limited, but this is the kind of error I get when the input...
Read more >
Scene Manager won't load Player when loading next scene
So, I'm new to Game Development and Unity/C#, and currently am struggling with the Scene Manager from Epitome's Youtube tutorial on 2D game....
Read more >
load new scene error: only one PartyManager instance ...
I have a game (unity) where the players do matchmaking and join a party in the first scene, and then they're all moved...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found