i want to play VCR controls on live stream using XPMobileSDK
Please give us details. Which sdk are you using - js, android, ios or .net. Do you want to pause on Live or Playback.
Yes, I’m using .js sdk.
Thanks.
Hi amandeep,
Do you need to “pause” live stream or “playback” one ?
Hi Petar,
I want to “pause” live stream and again play to live stream.
Well, probably the best approach will be to close the stream and request it again afterwards.
If you want the stream to remain open in this time and just to stop presentation of JPEG image on the screen, you could try to modify your “videoConnectionReceivedFrame” callback.
I suppose you do have something like:
XPMobileSDK.RequestStream(RequestStreamParams(Id, 'Live'), requestStreamCallback, function (error) { } );
var videoConnectionObserver = {
videoConnectionReceivedFrame: videoConnectionReceivedFrame
}
function requestStreamCallback(videoConnection) {
videoConnection.addObserver(videoConnectionObserver);
}
function videoConnectionReceivedFrame(frame) {
if (! paused) {
...
}
}
You have to modify the state of the “paused” variable.
Please bear in mind that in this case video stream will stay active during “pause” and will use resources in both Mobile server and web client (also in recording server as well).
Hi Petar,
There is some change in requirement. I want to pause live stream and play back with recorded one. Please give your input on this
Thanks,
Actually similar workflow is demonstrated in video sample
(/XPMobileSDK/Samples/Video/videoSample.html).
There could be seen how to start live stream and how to switch to playback afterwards (close live and request new one for playback).
When playback is started, it shows latest video frame from the end of the DB in the RS and is in “paused” state.
Further could be started playback in forward or backward direction.
The relevant code could be found in
“\XPMobileSDK\Samples\lib\js\application.js”
(this base js for almost all the samples)
Interesting methods there are:
“function switchToLive(e)”
“function switchToPlayback()”
as well as
“function playbackChangeSpeed(speed)”
Thanks for your interest.
Can you provide below files or package as i m unable to search that /XPMobileSDK/Samples/Video/videoSample.html
\XPMobileSDK\Samples\lib\js\application.js
Regards.
I’m a little bit surprised how you will make JS integration without having the SDK at the first place.
Nevertheless at the forum main page you can find this link “Downloads”.
Navigate down to find “Download MIP SDK Mobile 2019 R2”.
Furthermore JS part of the MIP SDK Mobile is available with every installation of the Mobile server.
Physically it is located in the Mobile server installation folder under sub-folder “Web\XPMobileSDK”.
Yes, i have downloaded this folder. but the folder which i have does not contain these paths and files. there is no video folder in sample folder.
Thankyou.
When you look at the folder structure which comes pre-installed with your Mobile server there is “XPMobileSDK” folder, where web part of the SDK is put.
In the package that is externally downloaded “Samples” is directly under “Web”.
More interesting articles for you could be:
https://developer.milestonesys.com/s/article/Display-video-from-XProtect-Mobile-Server-in-an-iframe
https://developer.milestonesys.com/s/question/0D50O00005l3wqzSAA/how-to-run-web-mobile-sdk
Thankyou it looks helpful.
Can you help me on how can i get video link after successfully export with getExport function call.
As when i execute getExport function in success function its giving its state as 0. Is there is any method to check status of export untill it get successfully exported.
At the official documentation page (Getting started → Mobile server protocol → Command channel) there a sample response and description of the GetExport command:
<?xml version="1.0" encoding="utf-8"?>
<Communication
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ConnectionId>7fdc93c5-d1f6-4f17-acc3-a332e898a778</ConnectionId>
<Command SequenceId="49">
<Type>Response</Type>
<Name>GetExport</Name>
<InputParams/>
<OutputParams/>
<Exports>
<Export CameraId="25c9a2d9-d044-4d1e-bb74-eb7e0ae9eb05"
CameraName="Axis Q7404 Video Server (10.4.13.6) - Camera 1"
CompletedTime="1352971268945"
EndTime="1352971229000"
ExportId="b146c13f-496f-40d9-a2c9-798f38f59673"
Link="XProtectMobile/Export/virtualtest/b146c13f-496f-40d9-a2c9-798f38f59673/Axis Q7404 Video Server (10.4.13.6) - Camera 1.Avi"
Name="Axis Q7404 Video Server (10.4.13.6) - Camera 1.Avi"
QueuedTime="1352971258577"
Size="292015643"
StartTime="1352970989000"
State="101"
ThumbLink="XProtectMobile/Export/virtualtest/b146c13f-496f-40d9-a2c9-798f38f59673/Axis Q7404 Video Server (10.4.13.6) - Camera 1.Avi.thumbnail.jpeg"
Type="Avi"
User="VirtualTest"/>
</Exports>
<Result>OK</Result>
</Command>
</Communication>
Notice “Link” attribute value.
You should concatenate it with mobile server main address.
For example:
http://address:port + <link_attribute_value>
In order to be available “State” should become value of 101 - Ready (Export is ready to be downloaded)
Is there any method to check state value? As i’m getting state value as 0. but i didn’t found any method which can check state of export.
Then you should Stop the live stream, by calling ChangeStream with Speed 0 and request new playback stream.
