Quantcast
Channel: Questions in topic: "exception"
Viewing all articles
Browse latest Browse all 470

Try Catch not working with VideoPlayer

$
0
0
I am trying to play a video using Unity's VideoPlayer which I have attached to the camera. I want the user to be able to enter the file path of a local video file and the VideoPlayer should then play the video. I got this working fine but I can't seem to handle exceptions when the user enters a path that is not valid, for instance: try { videoPlayer.url = @"C:\blah"; } catch { print ("error"); } does not print "error" but instead continues execution and gives me an error in the console saying "Can't play movie [C:\blah]" ---------- I can't think of any reason why this error shouldn't be caught by using the try catch method. I am using the latest version of Unity. If you cannot use the try catch method to catch this exception, then I need a way to test if the url is valid and will play properly (e.g. the file is not corrupt)

Viewing all articles
Browse latest Browse all 470

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>