Hello,
I am quite new to Untiy Scripting and have encountered the WindowsVideoMedia error 0x80070002 when trying to load a Video with videoPlayer.url command.
Every time I try to use the “url” method to access any video from my PC or even the Project Assets folder the error occurs and is followed by
VideoPlayer cannot play: url: /videoname.mp4
The video files work perfectly fine when inserting them manually in the Video Player interface - both as URL and a Clip.
I’ve been trying all sorts of solutions I found online, but the only thing that worked until now was streaming a video from website.
Does anybody here know what I did wrong and why I don’t seem to be able to play videos through
the url command?
(using Unity 2018.3.7f1 Personal)
```csharp
*using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;
public class LoadVideo : MonoBehaviour {
// Use this for initialization
void Start () {
// GameObject sphere = GameObject.Find("vSphere");
var videoPlayer = gameObject.AddComponent<UnityEngine.Video.VideoPlayer>();
videoPlayer.playOnAwake = false;
var m_Path = Application.dataPath;
Debug.Log("Path 1: " + m_Path);
var s_Path = Application.streamingAssetsPath;
Debug.Log("Path 2: " + s_Path);
videoPlayer.source = VideoSource.Url;
/* None of this seems to be working...*/
// videoPlayer.url = "ricoh";
// videoPlayer.url = System.IO.Path.Combine(Application.streamingAssetsPath, "ricoh.mp4");
// videoPlayer.url = "Ressources/Videos/ricoh";
videoPlayer.url = "/Users/TW/Videos/ricoh_1.mp4";
// videoPlayer.url = System.IO.Path.Combine(Application.streamingAssetsPath, "/ricoh_01.mp4");
/*only this seems functional but doesn't really help me at all as I'm looking for a local solution*/
// videoPlayer.url = "http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4";
// videoPlayer.Play();
var vClip = Resources.Load<VideoClip>("ricoh") as VideoClip; ;
videoPlayer.clip = vClip;
videoPlayer.frame = 5;
videoPlayer.Play();
}
// Update is called once per frame
void Update () {
// videoPlayer.Play();
}
}*
```
I hope someone can help me with this problem. I’ve spent days pulling my hair out over this. ![]()