W
W
WebforSelf2020-06-23 13:49:40
WordPress
WebforSelf, 2020-06-23 13:49:40

How to connect ip camera to wordpress website?

There is an online camera available via IP and authorization (login password)

How to connect it to the site on Wordpress? maybe there are solutions? I wrote in support, they said that they do not provide anything from their side, they say there are solutions. Search. Ip and login password is enough.
RVi-IPC12SW (2.8)
Where to start digging?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Gavrilov, 2020-06-23
@thexaver

To begin with, I would indicate the version of the camera

S
Sergey Ermilov, 2020-06-23
@sergeiermilov

There are some ready made solutions. For example, the plugin "Broadcast Live Video - Live Streaming : HTML5, WebRTC, HLS, RTSP, RTMP" ( link ).
It's hard to say how much it suits you.
There is another solution where you need to specify a username, password, URL and dig a little. Plus I don't know how working solution is:

// **************************************************** showCamera ****************************************************
// *                                                                                                                  *
// *      showCamera will display the video feed from an IP-based camera.  It accepts the following parameters:       *
// *      url - this is the url of the camera (http://dockcam.jkshay.com, for example)                                *
// *      port - this is the port on which the camera is listening                                                    *
// *      user - this is the username used to access the camera                                                       *
// *             I suggest creating a camera user with the username 'guest'                                           *
// *      password - this is the password for the user specified above                                                *
// *             I suggest creating a password 'guest' for the user specified above                                   *
// *      width - this is the width of the videostream                                                                *
// *      refresh - the number of milliseconds between image refreshes for IE                                         *
// *      class - a CSS class attribute applied to the videostream to facilitate styling via CSS                      *
// *                                                                                                                  *
// *     NOTE: The credentials necessary to view your camera WILL be available to anyone who views the page source    *
// *               DO NOT USE ADMINISTRATOR CREDENTIALS UNLESS YOU WANT PEOPLE TO MESS WITH YOUR CAMERA               *
// *                                                                                                                  *
// ********************************************************************************************************************
 
function showCamera($parameters)
{
// Define accepted parameters and convert to PHP variables
 
extract(shortcode_atts(array('url' => 'http://dockcam.jkshay.com', 'port' => '84', 'user' => 'guest', 'password' => 'guest', 'width' => '480', 'refresh' => '1000', 'class' => 'alignleft',), $parameters));
 
// Build string of HTML code to be returned by the function call
$results = "";
 
// IE is unable to accept the videostream.cgi viewing method, so we need to deliver an alternate viewing method
// We do this by introducing a javascript that will reload static images at a predefined rate
 
// Check if the user is using Internet Explorer
$results = $results."
<!--[if IE]>";
 
// Introduce javascript function to determine when to reload static image
$results = $results."
<script language='JavaScript' type='text/javascript'>
function reload()
{
   setTimeout('reloadImg(\"refresh\")',".$refresh.")
};";
 
// Introduce javascript function to reload the static image
$results = $results."
function reloadImg(id)
{
   var obj = document.getElementById(id);
   var date = new Date();
   obj.src = '".$url.":".$port."/snapshot.cgi?user=".$user."&pwd=".$password."&t=' + Math.floor(date.getTime()/1000);
}
</script>";
 
// Insert the HTML <img> tag to load the static image
$results = $results."
<img src='".$url.":".$port."/snapshot.cgi?user=".$user."&pwd=".$password."&t=' name='refresh' id='refresh' class=".$class." onload='reload(this)' onerror='reload(this)' width='".$width."'>";
 
// Close the 'User is using IE IF block'
$results = $results."
<![endif]-->";
 
// Check if the user is NOT using IE
$results = $results."
<![if !IE]>";
 
// Insert the HTML <img> tag to load the videostream
$results = $results."
<img src='".$url.":".$port."/videostream.cgi?user=".$user."&pwd=".$password."' class='".$class."' width='".$width."' alt='Live Feed'/>";
 
// Close the 'User is NOT using IE IF block'
$results = $results."
<![endif]>
";
 
// Return function results
return $results;
}
 
// Register this function with the WordPress framework as a shortcode
add_shortcode('showCamera', 'showCamera');
// ********************************************************************************************************************

Add themes to functions.php. Then display the [showCamera] shortcode on a page or article.
Also here is a list of related plugins (paid and free):
1. VideoWhisper
2. S3Bubble WordPress Video Streaming
3. bzplayer Pro
4. All-in-One Video Gallery
5. EmbedPlus for YouTube

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question