Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Doug Clark 30 posts 52 karma points
    Apr 14, 2011 @ 22:47
    Doug Clark
    0

    Invalid JSON primitive

    I'm helping a client with this problem. They have embedded several YouTube videos, but one of them is now causing an Invalid JSON primitive error.

    Stack trace as follows:

    [ArgumentException: Invalid JSON primitive: .]
       System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject() +895298
       System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +376
       System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) +120
       System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(String input) +94
       CPalm.Umbraco.Macro.OEmbed.usercontrols.CPalmUmbracoMacroOEmbed.Page_Load(Object sender, EventArgs e) in D:\Solutions\CPalm\Umbraco\CPalm.Umbraco.Macro.OEmbed\usercontrols\CPalmUmbracoMacroOEmbed.ascx.cs:57
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
       System.Web.UI.Control.LoadRecursive() +71
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3048

    Any ideas?

    Thanks!

  • Olie 11 posts 52 karma points
    Apr 18, 2011 @ 05:28
    Olie
    0

    I also encountered this issue. I resolved it by changing the max height parameter to 300 from 241. Try setting the max height/width to other values and see if this resolves it.

  • James Galloway 5 posts 25 karma points
    Apr 18, 2011 @ 05:29
    James Galloway
    0

    Hi Doug,

    I just encountered the same error - for me it seems to be related to the height property that is inserted. For some bizzare reason setting the height to 241 pixels will results in the error. Any other number I have tried seems to work with no drama?? Cannot understand how this is breaking it but that is all I can put it down to. Width is set to 300 if somehow they're related.

    Cheers,
    James

    [ArgumentException: Invalid JSON primitive: .]
       System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject() +562290
       System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +263
       System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) +80
       System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) +44
       System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(String input) +74
       CPalm.Umbraco.Macro.OEmbed.usercontrols.CPalmUmbracoMacroOEmbed.Page_Load(Object sender, EventArgs e) in D:\Solutions\CPalm\Umbraco\CPalm.Umbraco.Macro.OEmbed\usercontrols\CPalmUmbracoMacroOEmbed.ascx.cs:57
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnLoad(EventArgs e) +91
       System.Web.UI.Control.LoadRecursive() +74
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

  • James Galloway 5 posts 25 karma points
    Apr 18, 2011 @ 05:30
    James Galloway
    0

    Olie and myself encountered this together - not some great coincidence ;)

  • Doug Clark 30 posts 52 karma points
    Apr 18, 2011 @ 19:00
    Doug Clark
    0

    Thanks guys! Fixed by setting the max height to 300px, as suggested. Thanks!

  • Jason Prothero 422 posts 1243 karma points c-trib
    Apr 26, 2011 @ 01:36
    Jason Prothero
    0

    I had to uninstall to get this fixed.  Couldn't find the offending embed.

  • Glenn Franquet 18 posts 71 karma points
    Apr 26, 2011 @ 10:38
    Glenn Franquet
    0

    Also other sizes could cause this error. In the case of my client the width was set to 465, changing it to 460 resolved the problem. Could be interesting to know why this happens.

  • Owen Hope 119 posts 140 karma points
    May 03, 2011 @ 19:52
    Owen Hope
    0

    I am having the same problem.

    My video heights are set to "385" some work, some show the JSON primitive error. When I change the error'ed videos height to any number other than the original (385) the video works again.

    Any update on this would be great!

    Owen

  • Dan 1285 posts 3917 karma points c-trib
    May 18, 2011 @ 11:08
    Dan
    0

    Same here.  Errors seem really sporadic - even for videos with the same dimensions - but often deleting the macro and re-adding it works.  Not great for client confidence though so a patch would be massively welcome.

  • Glenn Franquet 18 posts 71 karma points
    May 24, 2011 @ 10:52
    Glenn Franquet
    1

    Think I found the reason for this error.

    The call to youtube is done via http://oohembed.com/. ; That means that youtube receive a lot of request from this site and send the message "Sorry for the interruption. We have been receiving a large volume of requests from your network. To continue with your YouTube experience, please enter the verification code below."

    You can try this by yourself, when you get the error message, by building the url like done in the package code.
    Ex; http://oohembed.com/oohembed/?url=http://www.youtube.com/watch?v=MD5nU7kt7pg

    Not sure what could be a solution for this.  Maybe giving the possibility to change the oohembed Url to something else.  It's then possible to call another sites who provide the same service or to a local installation of  the oohembed code.

    Other solution could be to add an exception for youtube and call directly the youtube oembed code instead of going via oohembed.
    Ideal situation would be to do this for all the different providers but is a lot more work.

     

Please Sign in or register to post replies

Write your reply to:

Draft