- Home /
[WP8.1] WebcamTexture won't play
The code
this.texture = new WebCamTexture();
this.texture.Play();
Causes the error
Error: operation has failed with error 0x80028019: old format or invalid type library.
(C:/Buildslave/unity/build/PlatformDependant/MetroPlayer/VideoTexture.cpp:WebcamTexture::Play at 388)
and won't play the webcam texture.
Player settings:
webcam and microphone access are enabled
compilation overrides is set to "none"
API compatibility level is .net 2.0
Build settings:
Build target: windows store
SDK: Phone 8.1
development build
the rest is pretty much kept at the default settings, there is 1 script, a panel and a preview texture on screen
here's the full code of the script:
using UnityEngine;
using System.Collections;
using UnityEngine.Events;
using UnityEngine.UI;
public class FindCameras : MonoBehaviour
{
public RawImage preview;
public GameObject templateButton;
private WebCamTexture texture;
// Use this for initialization
void Start () {
foreach ( var child in GetComponentsInChildren<Transform>() )
{
if(!child.gameObject.name.Equals("Panel"))
Destroy(child.gameObject);
}
for ( int i = 0; i < WebCamTexture.devices.Length; i++ )
{
GameObject button = Instantiate ( templateButton );
Button actualButton = button.GetComponent < Button>();
Button.ButtonClickedEvent evt = new Button.ButtonClickedEvent();
int i1 = i;
evt.AddListener(
() =>
{
texture.Stop();
this.texture = new WebCamTexture(WebCamTexture.devices[i1].name);
preview.texture = texture;
this.texture.Play();
} );
actualButton.onClick = evt;
button.GetComponentInChildren < Text > ().text = WebCamTexture.devices [ i1 ].name;
button.transform.parent = transform;
}
this.texture = new WebCamTexture();
this.texture.Play();
preview.texture = texture;
}
// Update is called once per frame
void Update () {
}
}
Hi there. I've got the same problem. We are expreimenting with multiple platforms and my webcam test works everywhere but when building for WindowsStore.
So far i've spent a lot of time looking for an answer, found stuff about either localisation or x64/x86 but but have not been able to fix the issue.
I was wondering if you had found a solution to your problem.
Will post an update if i get it to work.
Thanx!
Has anyone ever found a fix for this issue? I've encountered it as well and can't get to the bottom of what's causing it.
Your answer
![](https://koobas.hobune.stream/wayback/20220612041206im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
how to track object motion with webcam 0 Answers
Webcam GetPixels is only returning black 1 Answer
Show a WebCamTexture with alpha 1 Answer
WebcamTexture not refreshing 0 Answers
Web Cam Texture on UI Panel 0 Answers