0
Waiting for user's reply

dinamic images script

juankgp 4 years ago in General updated by Dmitry - support (expert) 4 years ago 4

Hello please I need your help, I have in my project 2 dinamic images of 2 cameras using rtsp protocol, I review the info about the script to manage the dinamic images I use it because the internet company change some times the public IP and I write an Script to change this with the info contain in the text box in the same GUI, but the problem that I have is if I delete de dianamic image and only use the script it doesn't work and If the IP changes the script don't change the IP

The field parm is necessary to it works

and the code is


ipPUB=IR.GetItem("OFICINA").GetItem("Item 5").Text;

IR.GetItem("OFICINA").GetItem("Item 1").GetState(0).Image = ("rtsp://web:web123456@"+ipPUB+":65535/MPEG-4/ch2/sub/av_stream");


so please I need your help to do the ip public config works


Thanks

Answer

Answer
Waiting for user's reply

Hello!

You have a script error:

ipPUB=IR.GetItem("OFICINA").GetItem("Item 5").Text;

IR.GetItem("OFICINA").GetItem("Item 1").GetState(0).Image = ("rtsp://web:web123456@"+ipPUB+":65535/MPEG-4/ch2/sub/av_stream");

Try this

ipPUB=IR.GetItem("OFICINA").GetItem("Item 5").GetState(1).Text;

IR.GetItem("OFICINA").GetItem("Item 1").GetState(0).Image = ("rtsp://web:web123456@"+ipPUB+":65535/MPEG-4/ch2/sub/av_stream");

We use two images, one image with the settings for each IP address that we need


Then change the image for the on the dynamic image as required


Eg

IR.GetItem("Security").GetItem("Door Small").Image = 'Door Onsite';


IR.GetItem("Security").GetItem("Door Small").Image = 'Door Remote';


The images cannot be deleted

Sorry but I don't understand your reply please could you explain me with more detail please

Thanks

+1

Have two dynamic images, one setup for onsite access, and one setup with the remote access

Onsite Image name: Hikvision Picture LAN



Remote Image name: Hikvision Picture Remote


The make a script that changes which image is used

function ChangeToLAN(){
IR.GetItem("Security").GetItem("Door_Front").GetState(0).Image = 'Hikvision Picture LAN';
}

function ChangeToRemote(){
IR.GetItem("Security").GetItem("Door_Front").GetState(0).Image = 'Hikvision Picture Remote';
}

The use a script call on button press to show the local or remote image


FYI you can resolve the issue of ISP changing the IP address by using a DYNDNS

Answer
Waiting for user's reply

Hello!

You have a script error:

ipPUB=IR.GetItem("OFICINA").GetItem("Item 5").Text;

IR.GetItem("OFICINA").GetItem("Item 1").GetState(0).Image = ("rtsp://web:web123456@"+ipPUB+":65535/MPEG-4/ch2/sub/av_stream");

Try this

ipPUB=IR.GetItem("OFICINA").GetItem("Item 5").GetState(1).Text;

IR.GetItem("OFICINA").GetItem("Item 1").GetState(0).Image = ("rtsp://web:web123456@"+ipPUB+":65535/MPEG-4/ch2/sub/av_stream");