79 lines
2.4 KiB
C#
79 lines
2.4 KiB
C#
using Hanatric.Unity.Video.FFmpegPlayer;
|
|
using Newtonsoft.Json;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
public class UI_BGPanel : BasePanel
|
|
{
|
|
public Button btn_h51, btn_h52;
|
|
public FFmpegPlayerBasicRawImage mediaPlayer1;
|
|
public FFmpegPlayerBasicRawImage mediaPlayer2;
|
|
public FFmpegPlayerBasicRawImage mediaPlayer3;
|
|
public FFmpegPlayerBasicRawImage mediaPlayer4;
|
|
public FFmpegPlayerBasicRawImage mediaPlayerHW;
|
|
public FFmpegPlayerBasicRawImage mediaPlayerZW;
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
FFmpegPlayerMono.Init(Application.streamingAssetsPath + "/FFmpegNativeLib");
|
|
btn_h51 = GetControl<Button>("btn_h51");
|
|
btn_h52 = GetControl<Button>("btn_h52");
|
|
btn_h51.onClick.AddListener(() =>
|
|
{
|
|
WebViewController.Instance.canvash51Prefab.gameObject.SetActive(true);
|
|
WebViewController.Instance.canvash52Prefab.gameObject.SetActive(false);
|
|
//WebViewController.Instance.canvash51Prefab.
|
|
});
|
|
btn_h52.onClick.AddListener(() =>
|
|
{
|
|
WebViewController.Instance.canvash51Prefab.gameObject.SetActive(false);
|
|
WebViewController.Instance.canvash52Prefab.gameObject.SetActive(true);
|
|
}
|
|
);
|
|
}
|
|
void Start()
|
|
{
|
|
OnLoadVideo();
|
|
}
|
|
private void OnLoadVideo()
|
|
{
|
|
string liveUrl = "rtsp://admin:pyss2017@221.214.127.18:8200/cam/realmonitor?channel=19&subtype=0&proto=Private3";
|
|
mediaPlayer1.UseTcp = true;
|
|
mediaPlayer1.OpenPlayUrl(liveUrl);
|
|
|
|
mediaPlayer2.UseTcp = true;
|
|
mediaPlayer2.OpenPlayUrl(liveUrl);
|
|
|
|
mediaPlayer3.UseTcp = true;
|
|
mediaPlayer3.OpenPlayUrl(liveUrl);
|
|
|
|
mediaPlayer4.UseTcp = true;
|
|
mediaPlayer4.OpenPlayUrl(liveUrl);
|
|
|
|
mediaPlayerHW.UseTcp = true;
|
|
mediaPlayerHW.OpenPlayUrl(liveUrl);
|
|
|
|
mediaPlayerZW.UseTcp = true;
|
|
mediaPlayerZW.OpenPlayUrl(liveUrl);
|
|
|
|
}
|
|
}
|
|
|
|
public class LiveUrlData
|
|
{
|
|
/// <summary>
|
|
/// ³µÅƺÅ
|
|
/// </summary>
|
|
[JsonProperty("licensePlateNumber")]
|
|
public string LicensePlateNumber { get; set; }
|
|
/// <summary>
|
|
/// ³µÁ¾Æ·ÅÆ
|
|
/// </summary>
|
|
[JsonProperty("vehicleBrand")]
|
|
public string VehicleBrand { get; set; }
|
|
/// <summary>
|
|
/// ³µÁ¾ÐͺÅ
|
|
/// </summary>
|
|
[JsonProperty("vehicleModel")]
|
|
public string VehicleModel { get; set; }
|
|
}
|