Skip to content

Commit

Permalink
Unity 2019 Fixes (#86)
Browse files Browse the repository at this point in the history
* Updating the Canvas Player example scene to fix Unity 2019 Audio Source on RectTransform bug 🐛

* Removing PS2 as a build target as it is no longer supported in Unity 2019 (#82)

* Making the CanvasPlayer menu item create an AudioSource on the camera to avoid making a 2D RectTransform AudioSource (#85)

* Fixing adaptive URL unit testing so it takes the test platform into account (#87)

If it is an Apple platform expect HLS manifest, else expect a DASH manifest
  • Loading branch information
juniorxsound authored May 3, 2019
1 parent 4a97efd commit 1635589
Show file tree
Hide file tree
Showing 4 changed files with 2,323 additions and 158 deletions.
27 changes: 14 additions & 13 deletions Assets/Tests/Unit/VimeoVideoTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ public void GetDashUrl_Works_For_Play_Response()
}

[Test]
// TODO somehow test different application platforms
// Note: this fails (correctly) when testing on Mac
public void GetAdaptiveVideoFileURL_Returns_Dash_By_Default()
public void GetAdaptiveVideoFileURL_Returns_Correct_Adaptive_Manifest_Based_On_Platform()
{
Assert.AreEqual(video.GetAdaptiveVideoFileURL(), video.getDashUrl());
if (isApple()) {
Assert.AreEqual(video.GetAdaptiveVideoFileURL(), video.getHlsUrl());
} else {
Assert.AreEqual(video.GetAdaptiveVideoFileURL(), video.getDashUrl());
}
}

[Test]
Expand All @@ -135,20 +137,19 @@ public void GetDashUrl_Returns_Null_For_Files_Response()
Assert.AreEqual(video.getDashUrl(), null);
}

[Test]
// TODO somehow test different application platforms
// Note: this fails (correctly) when testing on Mac
public void GetAdaptiveVideoFileURL_Defaults_To_Hls_For_Files_Response()
{
UnityEngine.TestTools.LogAssert.Expect(LogType.Warning, "[Vimeo] No DASH manfiest found. Defaulting to HLS.");
video = new VimeoVideo(JSONNode.Parse(mockProductionJson));
Assert.AreEqual(video.GetAdaptiveVideoFileURL(), video.getHlsUrl());
}
#endregion

[TearDown]
public void _After()
{

}

public bool isApple()
{
return Application.platform == RuntimePlatform.OSXPlayer ||
Application.platform == RuntimePlatform.OSXEditor ||
Application.platform == RuntimePlatform.IPhonePlayer ||
Application.platform == RuntimePlatform.tvOS;
}
}
Loading

0 comments on commit 1635589

Please sign in to comment.