28 lines
816 B
C#
28 lines
816 B
C#
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);
|
||
}
|
||
}
|
||
}
|