mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-12 07:39:01 +08:00
Add define to allow camera to be streamed on another page
This commit is contained in:
parent
917cd071b6
commit
2c7953055f
@ -152,6 +152,13 @@
|
|||||||
//#define CAMERA_DEVICE_FLIP_HORIZONTALY//comment to disable
|
//#define CAMERA_DEVICE_FLIP_HORIZONTALY//comment to disable
|
||||||
#define CUSTOM_CAMERA_NAME "ESP32-CAM"
|
#define CUSTOM_CAMERA_NAME "ESP32-CAM"
|
||||||
|
|
||||||
|
//Allow remote access by enabling cross origin access
|
||||||
|
//check https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
||||||
|
//this should be enabled only in specific cases
|
||||||
|
//like show the camera in web page different than device web server
|
||||||
|
//if you do not know what is that then better left it commented
|
||||||
|
//#define ESP_ACCESS_CONTROL_ALLOW_ORIGIN
|
||||||
|
|
||||||
//Extra features /////////////////////////////////////////////////////////////////////////
|
//Extra features /////////////////////////////////////////////////////////////////////////
|
||||||
/************************************
|
/************************************
|
||||||
*
|
*
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#define _VERSION_ESP3D_H
|
#define _VERSION_ESP3D_H
|
||||||
|
|
||||||
//version and sources location
|
//version and sources location
|
||||||
#define FW_VERSION "3.0.0.a17"
|
#define FW_VERSION "3.0.0.a18"
|
||||||
#define REPOSITORY "https://github.com/luc-github/ESP3D"
|
#define REPOSITORY "https://github.com/luc-github/ESP3D"
|
||||||
|
|
||||||
#endif //_VERSION_ESP3D_H
|
#endif //_VERSION_ESP3D_H
|
||||||
|
@ -54,6 +54,9 @@ static esp_err_t stream_handler(httpd_req_t *req)
|
|||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
esp3d_camera.connect(true);
|
esp3d_camera.connect(true);
|
||||||
|
#ifdef ESP_ACCESS_CONTROL_ALLOW_ORIGIN
|
||||||
|
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
|
||||||
|
#endif //ESP_ACCESS_CONTROL_ALLOw_ORIGIN
|
||||||
camera_fb_t * fb = NULL;
|
camera_fb_t * fb = NULL;
|
||||||
esp_err_t res = ESP_OK;
|
esp_err_t res = ESP_OK;
|
||||||
size_t _jpg_buf_len = 0;
|
size_t _jpg_buf_len = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user