• 大小: 36.52MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-17
  • 语言: 其他
  • 标签: VLC  Player  for  Unity  

资源简介

VLC Player for Unity插件使用测试工程,讲解脚本控制RTSP视频的播放

资源截图

代码片段和文件信息

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class VideoPlayTest : MonoBehaviour {

    public Gameobject videoOnPanel = null;
    public Text texBtnPlay = null;
    private PlayVLC vlcPlayer = null;
    private bool videoShow = false;
    //当前后台打开的VLC视频播放进程在关闭时会有一点延迟,必须确保完全退出,才能进行下一次的重新开启
    private bool videoWaitExit = false;

// Use this for initialization
void Start () {

        vlcPlayer = videoOnPanel.GetComponent();
        vlcPlayer.VideoPath = “rtsp://192.168.11.136:554“;
}

// Update is called once per frame
void Update () {

        CheckVlcPlayerState();
}

    void OnApplicationQuit()
    {
        if (videoWaitExit) return;

        if (videoShow)
        {
            vlcPlayer.StopVideo();
        }
    }

    public void PlayVideo()
    {
        if (videoWaitExit) return;

        if (videoShow)
        {
            vlcPlayer.StopVideo();
            videoWaitExit = true;

            texBtnPlay.text = “打开视频“;
        }
        else
        {
            videoOnPanel.SetActive(true);
            vlcPlayer.Play();

            texBtnPlay.text = “关闭视频“;
        }

        videoShow = !videoShow;
    }

/// 
/// 检查当前打开的VLC进程是否完全关闭
/// 

    private void CheckVlcPlayerState()
    {
        if (false == videoWaitExit) return;

        if (false == vlcPlayer.IsPlaying)
        {
            videoOnPanel.SetActive(false);

            videoWaitExit = false;
        }
    }

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     448512  2016-08-13 15:37  VideoPlayTestProject\Assets\Plugins\System.Drawing.dll

     文件        394  2016-08-13 15:37  VideoPlayTestProject\Assets\Plugins\System.Drawing.dll.meta

     文件    3053568  2016-08-13 15:36  VideoPlayTestProject\Assets\Plugins\System.Windows.Forms.dll

     文件        394  2016-08-13 15:36  VideoPlayTestProject\Assets\Plugins\System.Windows.Forms.dll.meta

     文件        193  2016-08-13 15:38  VideoPlayTestProject\Assets\Plugins.meta

     文件      17578  2016-08-13 15:36  VideoPlayTestProject\Assets\StreamingAssets\vlc\AUTHORS.txt

     文件        176  2016-08-13 15:36  VideoPlayTestProject\Assets\StreamingAssets\vlc\AUTHORS.txt.meta

     文件     944659  2016-08-13 15:38  VideoPlayTestProject\Assets\StreamingAssets\vlc\axvlc.dll

     文件        294  2016-08-13 15:38  VideoPlayTestProject\Assets\StreamingAssets\vlc\axvlc.dll.manifest

     文件        176  2016-08-13 15:38  VideoPlayTestProject\Assets\StreamingAssets\vlc\axvlc.dll.manifest.meta

     文件        176  2016-08-13 15:38  VideoPlayTestProject\Assets\StreamingAssets\vlc\axvlc.dll.meta

     文件      18431  2016-08-13 15:36  VideoPlayTestProject\Assets\StreamingAssets\vlc\COPYING.txt

     文件        176  2016-08-13 15:36  VideoPlayTestProject\Assets\StreamingAssets\vlc\COPYING.txt.meta

     文件      79379  2016-08-13 15:37  VideoPlayTestProject\Assets\StreamingAssets\vlc\libgcc_s_seh-1.dll

     文件        176  2016-08-13 15:37  VideoPlayTestProject\Assets\StreamingAssets\vlc\libgcc_s_seh-1.dll.meta

     文件     143891  2016-08-13 15:38  VideoPlayTestProject\Assets\StreamingAssets\vlc\libvlc.dll

     文件        176  2016-08-13 15:38  VideoPlayTestProject\Assets\StreamingAssets\vlc\libvlc.dll.meta

     文件    2750483  2016-08-13 15:35  VideoPlayTestProject\Assets\StreamingAssets\vlc\libvlccore.dll

     文件        176  2016-08-13 15:35  VideoPlayTestProject\Assets\StreamingAssets\vlc\libvlccore.dll.meta

     文件      80345  2016-08-13 15:38  VideoPlayTestProject\Assets\StreamingAssets\vlc\lua\extensions\VLSub.luac

     文件        176  2016-08-13 15:38  VideoPlayTestProject\Assets\StreamingAssets\vlc\lua\extensions\VLSub.luac.meta

     文件        193  2016-08-13 15:38  VideoPlayTestProject\Assets\StreamingAssets\vlc\lua\extensions.meta

     文件       3817  2016-08-13 15:36  VideoPlayTestProject\Assets\StreamingAssets\vlc\lua\http\css\main.css

     文件        176  2016-08-13 15:36  VideoPlayTestProject\Assets\StreamingAssets\vlc\lua\http\css\main.css.meta

     文件       2732  2016-08-13 15:37  VideoPlayTestProject\Assets\StreamingAssets\vlc\lua\http\css\mobile.css

     文件        176  2016-08-13 15:37  VideoPlayTestProject\Assets\StreamingAssets\vlc\lua\http\css\mobile.css.meta

     文件        201  2016-08-13 15:36  VideoPlayTestProject\Assets\StreamingAssets\vlc\lua\http\css\ui-lightness\images\ui-bg_diagonals-thick_18_b81900_40x40.png

     文件        176  2016-08-13 15:36  VideoPlayTestProject\Assets\StreamingAssets\vlc\lua\http\css\ui-lightness\images\ui-bg_diagonals-thick_18_b81900_40x40.png.meta

     文件        197  2016-08-13 15:38  VideoPlayTestProject\Assets\StreamingAssets\vlc\lua\http\css\ui-lightness\images\ui-bg_diagonals-thick_20_666666_40x40.png

     文件        176  2016-08-13 15:38  VideoPlayTestProject\Assets\StreamingAssets\vlc\lua\http\css\ui-lightness\images\ui-bg_diagonals-thick_20_666666_40x40.png.meta

............此处省略2549个文件信息

评论

共有 条评论