1

If i dynamicaly load an url for a videoplayer on mac it works correctly, but when build and play on iphone i receive this error, instead on android it works:

 CredStore - performQuery - Error copying matching creds.  Error=-25300, query={
     class = inet;
     "m_Limit" = "m_LimitAll";
     "r_Attributes" = 1;
     sync = syna;
 }

This is the function:

public void WI_PlayVideo(string target, string video)
     {

         MyVideo = GameObject.Find(target).GetComponent<VideoPlayer>();

         if (MyVideo == null)
         {
             Debug.Log("player non trovato");
         }
         else
         {
             //here there's the file name that is public whithout credential request
             MyVideo.url = "https://myspace.ams3.digitaloceanspaces.com/" + video;
             MyVideo.Play();
         }

Anyone have idea of what credential ios asking to me?

Add comment

Programmer
  • 121,791
  • 22
  • 236
  • 328
Simone Garza
  • 11
  • 1
  • 2

1 Answers1

1

You should always call VideoPlayer.Prepare() and wait for it to finish before calling the VideoPlayer.Play() function to play the video. See this for example.

If you have done that but the issue is still there then this is likely a https bug in Unity's VideopPlayer API when trying to play video from certain url.

The first thing you should do is update your Unity to the latest version then test and see if this bug has been fixed. If it has not been fixed, I suggest you file for a bug report with your current project and make sure to include the complete video url there since that's necessary to recreate your issue.


While waiting for this to be fixed, a workaround to this issue is to download and save the video with the API. This is how to do that. After that play the video from the local drive.


If the video size is so big and downloading and saving it would take so much time, you can instead download the video data in chunk with the DownloadHandlerScript API, create a local server with HttpListener and send the chunk data to the connected client while it is downloading. See this post for a complete example of how to create a local server and playing video from it. You just need to replace the data you're sending to the client with the one from DownloadHandlerScript.

Programmer
  • 121,791
  • 22
  • 236
  • 328
  • Did you read the post? Did you try what's in this answer? I told you that a workaround is to download the video then play it or stream it with `HttpListener`. Your comment didn't show that you've done any of these... – Programmer Jul 27 '18 at 14:00
  • @Programmer, I have a quick question for you. I'm getting the same error just using the Video Player component. I tested the project first by embedding the video in the project. However I'm taking a class and I must use a URL in my project. I'm working on my script now and will use the VideoPlayer.Prepare() to see if that fixes the problem. Does this error signify a video file that's too large for URL streaming? – Pamela Cook - LightBe Corp Jul 27 '18 at 22:08
  • @PamelaCook-LightBeCorp No. It's just a bug with the VideoPlayer API but I put several ways in my answer to get around it – Programmer Jul 27 '18 at 22:53
  • Thanks. I asked because I have a smaller video using the URL that does not get the error. I’ve saved this question for future reference if I get that error again after writing my script. – Pamela Cook - LightBe Corp Jul 28 '18 at 08:53