CamFiStorage.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using ToneTuneToolkit.Data;
  5. namespace MartellGroupPhoto
  6. {
  7. public class CamFiStorage : MonoBehaviour
  8. {
  9. private static string configPath = "/camficonfig.json";
  10. public static string CamFiIP = "192.168.50.101";
  11. private static string CamFiPort = "80";
  12. private static string CamFiEventPort = "8080";
  13. public static string CamFiLiveViewPort = "890";
  14. public static string CamFiRESTAddress { get { return $"http://{CamFiIP}:{CamFiPort}"; } }
  15. public static string CamFiEventAddress { get { return $"http://{CamFiIP}:{CamFiEventPort}/socket.io/"; } }
  16. public static string CamFiLiveViewAddress { get { return $"http://{CamFiIP}:{CamFiLiveViewPort}"; } }
  17. public static string Live { get { return $"{CamFiRESTAddress}/live"; } }
  18. public static string TakePic { get { return $"{CamFiRESTAddress}/takepic/true"; } }
  19. public static string GetFileList { get { return $"{CamFiRESTAddress}/files/0/4"; } }
  20. public static string GetRawFile { get { return $"{CamFiRESTAddress}/raw/"; } }
  21. public static string StartLiveView { get { return $"{CamFiRESTAddress}/capturemovie"; } }
  22. public static string StopLiveView { get { return $"{CamFiRESTAddress}/stopcapturemovie"; } }
  23. // ==================================================
  24. private void Awake()
  25. {
  26. Init();
  27. }
  28. // ==================================================
  29. private void Init()
  30. {
  31. configPath = Application.streamingAssetsPath + configPath;
  32. CamFiIP = JsonManager.GetJson(configPath, "CamFi IP");
  33. return;
  34. }
  35. }
  36. }