AudioPlayerControl Not working in Offline smart Client

Hi,

I just wondering becaues I take 2-3 day try to solve problem but still not get it to work. The problem is when user export video as “X-protection” and when I open Export Project it will open smart client normally with Playback Page the video that export working property with audio but as I write SDK to create custom workspace

I use imageViewerControl() to display video and use AudioPlayerControl to be able to listen to Audio of camera that being exported but the problem is when play video the image display perfectly but the Audio nerver get to work

Here function when I Selected Camera

private void SelectCam(Item _selectedItem)
        {
            //Control Camera 1 
            _imageViewerControl = ClientControl.Instance.GenerateImageViewerControl();
            _imageViewerControl.Dock = DockStyle.Fill;
            ViewCam.Controls.Clear();  
            ViewCam.Controls.Add(_imageViewerControl);
            _imageViewerControl.CameraFQID = _selectedItem.FQID;
            SelectCamera.Text = _selectedItem.Name;
 
            _imageViewerControl.EnableMousePtzEmbeddedHandler = true;
            _imageViewerControl.MaintainImageAspectRatio = true;
            _imageViewerControl.SetVideoQuality(0, 1);
 
            _imageViewerControl.Initialize();
            _imageViewerControl.Connect();
            _imageViewerControl.Selected = true;
 
            _playbackUserControl = ClientControl.Instance.GeneratePlaybackUserControl(this.WindowInformation);
            _playbackUserControl.Dock = DockStyle.Fill;
            panelPlaybackControl.Controls.Add(_playbackUserControl);
 
            _playbackUserControl.ShowTallUserControl = true;
            _playbackUserControl.ShowSpeedControl = true;
            _playbackUserControl.ShowTimeSpanControl = true;
 
            _playbackFQID = ClientControl.Instance.GeneratePlaybackController();
            _playbackUserControl.Init(_playbackFQID);
            _imageViewerControl.PlaybackControllerFQID = _playbackFQID;
 
             _audioPlayerControl1 = ClientControl.Instance.GenerateAudioPlayerControl();
                this.Controls.Add(_audioPlayerControl1);
 
            _related1Microphone = null;
            List<Item> related = _selectedItem.GetRelated();
 
            if (related != null)
            {
                foreach (Item item in related)
                {
                    if (item.FQID.Kind == Kind.Microphone)
                    {
                        MessageBox.Show("YEp");
                        _related1Microphone = item;
                        _audioPlayerControl1.MicrophoneFQID = _related1Microphone.FQID;
                        _audioPlayerControl1.Initialize();
                        _audioPlayerControl1.Connect();
                    }
                }
            }
 
            EnvironmentManager.Instance.Mode = Mode.ClientPlayback;
 
            EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(
                MessageId.SmartClient.PlaybackCommand,
                new PlaybackCommandData() { Command = PlaybackData.PlayStop }), _playbackFQID);
            DateTime dt = recordTime;
            DateTime ut = DateTime.SpecifyKind(dt, DateTimeKind.Utc);
 
            EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(
                MessageId.SmartClient.PlaybackCommand,
                new PlaybackCommandData()
                {
                    Command = PlaybackData.Goto,
                    DateTime = recordTime
                }), _playbackFQID);
 
            EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(
                MessageId.SmartClient.PlaybackCommand,
                new PlaybackCommandData() { Command = PlaybackData.PlayForward, Speed = 1.0 }), _playbackFQID);
 
            EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(
             MessageId.SmartClient.PlaybackCommand,
             new PlaybackCommandData() { Command = PlaybackData.PlayStop }), _playbackFQID);
 
            _playbackUserControl.SetCameras(new List<FQID>() { _selectedItem.FQID });
 
        }

Noted: This is exported Project there for it not connected to Milsotne Server

Thank you

Quick question: The audio functionality works prior to export but not in the exported version, correct?

One guess up front-

You have

_imageViewerControl.PlaybackControllerFQID = _playbackFQID;

Are we missing a

_audioPlayerControl1.PlaybackControllerFQID = _playbackFQID;

?

-Can you test this?

Quick question: The audio functionality works prior to export but not in the exported version, correct?

Yes

I try to put _audioPlayerControl1.PlaybackControllerFQID = _playbackFQID; but getting an error

_audioPlayerControl1 = ClientControl.Instance.GenerateAudioPlayerControl();
            this.Controls.Add(_audioPlayerControl1);
 
            _imageViewerControl.EnableMousePtzEmbeddedHandler = true;
            _imageViewerControl.MaintainImageAspectRatio = true;
            _imageViewerControl.SetVideoQuality(0, 1);
 
            _imageViewerControl.Initialize();
            _imageViewerControl.Connect();
            _imageViewerControl.Selected = true;
 
            _playbackUserControl = ClientControl.Instance.GeneratePlaybackUserControl(this.WindowInformation);
            _playbackUserControl.Dock = DockStyle.Fill;
            panelPlaybackControl.Controls.Add(_playbackUserControl);
 
            _playbackUserControl.ShowTallUserControl = true;
            _playbackUserControl.ShowSpeedControl = true;
            _playbackUserControl.ShowTimeSpanControl = true;
 
            _playbackFQID = ClientControl.Instance.GeneratePlaybackController();
            _playbackUserControl.Init(_playbackFQID);
            _imageViewerControl.PlaybackControllerFQID = _playbackFQID;
            _audioPlayerControl1.PlaybackControllerFQID = _playbackFQID;

I have try to put audiocontrol as below still not working

_related1Microphone = item;
                        _audioPlayerControl1.MicrophoneFQID = _related1Microphone.FQID;
                        _audioPlayerControl1.Initialize();
                        _audioPlayerControl1.Connect();
                        _audioPlayerControl1.PlaybackControllerFQID = _playbackFQID;

To use the built-in audioplayer in live and playback mode, insert this line when a camera is selected to let the Smart Client know that the ViewItem contains a camera, and it’s related microphone:

_viewItemManager.SetProperty(ClientControl.EmbeddedCameraFQIDProperty, _viewItemManager.SelectedCamera.FQID.ToString());

Is it like this but still not get it correct?

private void SelectCam(Item _selectedItem)
        {
            //Control Camera 1 
            _imageViewerControl = ClientControl.Instance.GenerateImageViewerControl();
            _imageViewerControl.Dock = DockStyle.Fill;
            ViewCam.Controls.Clear();  
            ViewCam.Controls.Add(_imageViewerControl);
            _imageViewerControl.CameraFQID = _selectedItem.FQID;
            SelectCamera.Text = _selectedItem.Name;
 
            _audioPlayerControl1 = ClientControl.Instance.GenerateAudioPlayerControl();
            this.Controls.Add(_audioPlayerControl1);
 
            _imageViewerControl.EnableMousePtzEmbeddedHandler = true;
            _imageViewerControl.MaintainImageAspectRatio = true;
            _imageViewerControl.SetVideoQuality(0, 1);
 
            _imageViewerControl.Initialize();
            _imageViewerControl.Connect();
            _imageViewerControl.Selected = true;
 
            _viewItemManager.SetProperty(ClientControl.EmbeddedCameraFQIDProperty, _viewItemManager.FQID.ToString());
 
            _playbackUserControl = ClientControl.Instance.GeneratePlaybackUserControl(this.WindowInformation);
            _playbackUserControl.Dock = DockStyle.Fill;
            panelPlaybackControl.Controls.Add(_playbackUserControl);
 
            _playbackUserControl.ShowTallUserControl = true;
            _playbackUserControl.ShowSpeedControl = true;
            _playbackUserControl.ShowTimeSpanControl = true;
 
            _playbackFQID = ClientControl.Instance.GeneratePlaybackController();
            _playbackUserControl.Init(_playbackFQID);
            _imageViewerControl.PlaybackControllerFQID = _playbackFQID;
          
 
            _related1Microphone = null;
            List<Item> related = _selectedItem.GetRelated();
 
            if (related != null)
            {
                foreach (Item item in related)
                {
                    if (item.FQID.Kind == Kind.Microphone)
                    {
                        _related1Microphone = item;
                        _audioPlayerControl1.MicrophoneFQID = _related1Microphone.FQID;
                        _audioPlayerControl1.Initialize();
                        
                    }
                }
            }

When I put _viewItemManager.SelectedCamera.FQID.ToString()); it said _viewManager doesn’t not contain SelectedCamera

For the Camera view and playback control I use similar code as SCIndependentPlayback and as I tested SCIndependentPlayback use to playback recorded video there no sound as well

We also find issues in the Milestone Support test-lab, our first conclusion is that something is not working as intended. We will update you when we have done a deep investigation to find a solution.

Thank you So much Please update as soon as your team find issue because we currently very late on implementation stage

Milestone Development have discovered that it is not possible to playback audio for a MIP item. This is now on the devlopment backlog.

If you create a viewitem (instead of a workspace) that will be usable in the regular Playback tab in Smart Client it is possible to get audio playback to work.

When you implement the regular viewitem you will have to use - VideoOS.Platform.Messaging.MessageId.SmartClient.SelectMicrophoneCommand

How about If I use ComponentSample (“VideoFIleViewer”) because it exported file is it able to read audio too and if so which file I need to call to open Milstone BLK file because when exported the system will generate ClientFile with Data Directory inside

from that directory there is also another direcotrt called MediaData so I just wondering which directory and file inside MediaData should I open

Thank you

You would not be able to use this Component sample within the Smart Client as a plugin. I assume you want something that works as a plugin.

I see the best possibility in developing a view/viewitem instead of developing a workspace.

Alternatively wait. Milestone Development plan to have the functionality (playback -audio in MIP items) implemented in 2017R2 version. (Estimated release in medio 2017).

Is SCIndependentPlayback.csproj sample is using view/ViewItem?

Then I use

- VideoOS.Platform.Messaging.MessageId.SmartClient.SelectMicrophoneCommand

in order audio to be out? because is it so that mean SCIndependentPlayback dosent implement that command in example

Thank

OK I try to make test viewItem because it exproted project (.scp) when I try to open camera from view it say “unable to show live fees from camera insffcient user right”

Which API I have to called to get playback mode from view

In an exported project live feeds would not make sense. The suspicion is that your initialization order somehow causes this.

Can you show us the source code?

also - Does playback mode work prior to exporting?

Hi got it to work Thank you, We need to use ItemView instead of Pannel but this only work in playback mode as Temporary But anyway we still look forward to Next updated SDK