1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System;
- using Vinno.IUS.Common.Network.Leaf;
- using Vinno.vCloud.FIS.CrossPlatform.Common.LiveVideo;
- using Vinno.vCloud.FIS.CrossPlatform.Common.LiveVideo.Interface;
- namespace Vinno.vCloud.Common.FIS.LiveVideos
- {
- public class SonopostLiveVideoPusher : LiveVideoPusher
- {
- /// <summary>
- /// 推流状态改变时触发,主要给预览用
- /// </summary>
- public event EventHandler<PusherState> PusherStateChanged;
- /// <summary>
- /// 当前的推流器
- /// </summary>
- public ILiveVideoPusherForSonopost LivePusher => _pusher;
- public SonopostLiveVideoPusher(ClientLeaf leaf, string terminalId, string terminalName) : base(leaf, terminalId, terminalName)
- {
- }
- protected override void StartPusher(IExtendedData pushParams)
- {
- PusherStateChanged?.Invoke(this, PusherState.Preparing);
- base.StartPusher(pushParams);
- PusherStateChanged?.Invoke(this, PusherState.Prepared);
- }
- protected override void StopPusher(bool isPaused)
- {
- PusherStateChanged?.Invoke(this, PusherState.Preparing);
- base.StopPusher(isPaused);
- if (!isPaused)
- {
- PusherStateChanged?.Invoke(this, PusherState.Prepared);
- }
- }
- }
- }
|