2026-04-01 19:15:20 +08:00

28 lines
816 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using RenderHeads.Media.AVProVideo;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ZXKFramework;
namespace YiLiao.XinFeiTingZhen
{
public class VideoPanel : UIBase
{
public override string GroupName => "VideoPanel";
public override string Name => "VideoPanel";
MediaPlayer mp;
public override void Init(IUIManager uictrl)
{
base.Init(uictrl);
mp = transform.FindFirst<MediaPlayer>("MediaPlayer");
}
public void PlayVideo(string name)
{
SetActive(true);
//通过插件中的方法加载参数为1.加载路径格式与面板上相对应2.加载的文件名 3.默认是否开始播放)
mp.OpenMedia(MediaPathType.RelativeToStreamingAssetsFolder, name, true);
}
}
}