@WebforSelf

Как подключить Ip камеру на сайт wordpress?

Есть онлайн камера доступная по айпи и авторизации (логин пароль)

Как подключить ее к сайту на Wordpress? может есть готовые решения? Писал в поддержку, сказали что с их стороны они ничего не предоставляют, мол есть решения. Ищите. Ip и логина пароля достаточно.
RVi-IPC12SW (2.8)
Откуда начать копать ?
  • Вопрос задан
  • 782 просмотра
Пригласить эксперта
Ответы на вопрос 2
Для начала бы я бы указал, версию камеры
Ответ написан
sergeiermilov
@sergeiermilov
Веб-дизайн, фронтенд и WordPress разработка
Есть некоторые готовые решения. Например, плагин "Broadcast Live Video – Live Streaming : HTML5, WebRTC, HLS, RTSP, RTMP" (ссылка).

Насколько он вам может подойти - сказать сложно.

Есть еще такое решение, где нужно указать логин, пароль, URL и немного покопаться. Плюс я не знаю насколько рабочее решение:

// **************************************************** 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');
// ********************************************************************************************************************


Добавляете в functions.php темы. Потом выводите шорткод [showCamera] на страницу или в статью.

Также вот список плагинов по теме (платные и бесплатные):

1. VideoWhisper
2. S3Bubble WordPress Video Streaming
3. bzplayer Pro
4. All-in-One Video Gallery
5. EmbedPlus for YouTube
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы