[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 () {

	}
}

Any progress on this?