fix issue naming in nameddepthkitplayer causing a crash
parent
13eacfaca7
commit
6e9b67cfb8
|
@ -30,16 +30,36 @@ public class NamedDepthkitPlayer : ComponentHandler {
|
|||
|
||||
public override string ContentLabel() {
|
||||
UpdateComponent();
|
||||
string filename = depthkitClip.metadataFilePath;
|
||||
if (depthkitClip.metadataSourceType == MetadataSourceType.TextAsset) {
|
||||
filename = depthkitClip.metadataFile.name;
|
||||
// string filename = "dummy-metadatafilepath"; // depthkitClip.metadataFilePath;
|
||||
// Debug.Log($"NamedDepthkitPlayer.ContentLabel metadataFilePath {depthkitClip.metadataFilePath}");
|
||||
// string filename = depthkitClip.metadataFilePath;
|
||||
// Debug.Log($"NamedDepthkitPlayer.ContentLabel metadataFile {depthkitClip.metadataFile}");
|
||||
// Debug.Log($"NamedDepthkitPlayer.ContentLabel metadataFile {depthkitClip.metadataFile.name}");
|
||||
if (depthkitClip.metadataFile != null) {
|
||||
return depthkitClip.metadataFile.name;
|
||||
}
|
||||
return filename;
|
||||
if (depthkitClip.poster != null) {
|
||||
return depthkitClip.poster.name;
|
||||
}
|
||||
if (depthkitClip.player != null) {
|
||||
return depthkitClip.player.GetVideoPath();
|
||||
}
|
||||
return "undefined-contentlabel";
|
||||
// if (depthkitClip.metadataFile == null) {
|
||||
// filename = depthkitClip.metadataFile.name;
|
||||
// }
|
||||
// if (depthkitClip.metadataSourceType == MetadataSourceType.TextAsset) {
|
||||
// filename = depthkitClip.metadataFile.name;
|
||||
// }
|
||||
// return filename;
|
||||
}
|
||||
|
||||
public override void UpdateComponent() {
|
||||
base.UpdateComponent();
|
||||
depthkitClip = GetComponent<Depthkit.Clip>();
|
||||
if (depthkitClip == null) {
|
||||
Debug.Log($"NamedDepthkitPlayer.UpdateComponent depthkitClip is null");
|
||||
}
|
||||
}
|
||||
|
||||
public Depthkit.Clip depthkitClip;
|
||||
|
|
Loading…
Reference in New Issue