• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by sirius_black9999 · Oct 13, 2015 at 05:59 PM · webcamtexturewebcamwindows phone 8

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



Comment
schpinn
jijieciprian
eemre

People who like this

3 Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Pawscal · Jan 29, 2016 at 03:21 PM 1
Share

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!

avatar image schpinn · Jul 13, 2016 at 03:58 PM 0
Share

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.

1 Reply

  • Sort: 
avatar image

Answer by eemre · May 07, 2018 at 01:57 PM

Any progress on this?

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta on June 13. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

32 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

how to check if webcam is used by another application 0 Answers

Projector with WebCamTexture as texture 0 Answers

problem accessing webcamtexture.videorotation angle on windows phone 8 0 Answers

Take photo from webcam (not grab frame from video stream) 0 Answers

Problems with webcam 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges