Changeset 3412197
- Timestamp:
- 12/05/2025 12:40:50 PM (3 months ago)
- Location:
- media-stream
- Files:
-
- 21 added
- 5 edited
-
tags/1.0.9 (added)
-
tags/1.0.9/app (added)
-
tags/1.0.9/app/APIController.php (added)
-
tags/1.0.9/app/AjaxController.php (added)
-
tags/1.0.9/app/MainController.php (added)
-
tags/1.0.9/assets (added)
-
tags/1.0.9/assets/css (added)
-
tags/1.0.9/assets/css/style.css (added)
-
tags/1.0.9/assets/imgs (added)
-
tags/1.0.9/assets/imgs/logo-bunnynet-icon.svg (added)
-
tags/1.0.9/assets/js (added)
-
tags/1.0.9/assets/js/hls.js (added)
-
tags/1.0.9/assets/js/hls.min.js (added)
-
tags/1.0.9/assets/js/public-script.js (added)
-
tags/1.0.9/assets/js/script.js (added)
-
tags/1.0.9/index.php (added)
-
tags/1.0.9/license.txt (added)
-
tags/1.0.9/media-stream.php (added)
-
tags/1.0.9/readme.txt (added)
-
tags/1.0.9/views (added)
-
tags/1.0.9/views/settings.php (added)
-
trunk/app/AjaxController.php (modified) (2 diffs)
-
trunk/app/MainController.php (modified) (1 diff)
-
trunk/assets/js/script.js (modified) (2 diffs)
-
trunk/media-stream.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
media-stream/trunk/app/AjaxController.php
r3391139 r3412197 19 19 add_action('wp_ajax_mediaStream_upload_missing_video', [$this, 'mediaStream_upload_missing_video_clbk']); 20 20 add_action('wp_ajax_reencode_bunny_video', [$this, 'reencode_bunny_video_clbk']); 21 add_action('wp_ajax_removelocal_bunny_video', [$this, 'removelocal_bunny_video_clbk']); 21 22 add_action('wp_ajax_mediaStream_get_media_status_ping', [$this, 'mediaStream_get_media_status_ping_clbk']); 22 23 } … … 139 140 exit(); 140 141 } 142 143 public function removelocal_bunny_video_clbk(){ 144 $resp = ['status' => 400, 'message' => 'Original file is missing']; 145 146 if (isset($_POST['_']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['_'])), 'mediaStream_ajax_request')){ 147 $attachment_id = isset($_POST['attachment_id']) ? sanitize_text_field(wp_unslash($_POST['attachment_id'])) : ''; 148 if ($attachment_id != "") { 149 $attachment_file = get_attached_file($attachment_id); 150 if(file_exists($attachment_file) && unlink($attachment_file)){ 151 $resp = ['status' => 200, 'message' => 'Removed']; 152 update_post_meta(intval($attachment_id), 'mediaStream_local_removed', true); 153 }else{ 154 $resp = ['status' => 400, 'message' => 'Invalid']; 155 } 156 } 157 } 158 wp_send_json($resp, $resp['status'], JSON_PRETTY_PRINT); 159 exit(); 160 } 141 161 142 162 public function mediaStream_save_settings_callback() -
media-stream/trunk/app/MainController.php
r3389424 r3412197 131 131 } 132 132 $resp_html .= '<button class="button reencode_bunny_video" data_attch_id="' . $post->ID . '" data_video_id="' . $video_id . '">Re-encode</button>'; 133 if(get_post_meta(intval($post->ID), 'mediaStream_local_removed', true) != true){ 134 $resp_html .= '<br><br><button class="button removelocal_bunny_video" data_attch_id="' . $post->ID . '" data_video_id="' . $video_id . '" style="color: #d63638;border-color: #d63638;">Remove Local copy</button>'; 135 } 133 136 } 134 137 -
media-stream/trunk/assets/js/script.js
r3399591 r3412197 186 186 }); 187 187 }); 188 189 jQuery(document).on('click', '.removelocal_bunny_video', function () { 190 const this_btn = jQuery(this); 191 const video_id = this_btn.attr('data_video_id'); 192 const this_id = this_btn.attr('data_attch_id'); 193 this_btn.text('Please wait...').attr('disabled', 'disabled'); 194 jQuery.ajax({ 195 url: ajaxurl, 196 type: "POST", 197 data: { 198 action: 'removelocal_bunny_video', 199 video_id: video_id, 200 attachment_id: this_id, 201 _: mediaStream_var.nonce 202 }, 203 }).done((res) => { 204 console.log(res); 205 if (res.status == 200) { 206 // this_btn.remove(); 207 location.reload(); 208 } 209 }).fail((err) => { 210 console.log(err); 211 }); 212 }); 188 213 189 214 … … 267 292 }); 268 293 269 jQuery(document).ready(function() {270 setTimeout(function(){271 window.cstm_call_all_scrip();272 }, 1000);273 });294 // jQuery(document).ready(function() { 295 // setTimeout(function(){ 296 // window.cstm_call_all_scrip(); 297 // }, 1000); 298 // }); -
media-stream/trunk/media-stream.php
r3399591 r3412197 6 6 * Author: Blurr Studio 7 7 * Author URI: https://blurr.it/ 8 * Version: 1.0. 88 * Version: 1.0.9 9 9 * License: GPL v2 or later 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html -
media-stream/trunk/readme.txt
r3399591 r3412197 4 4 Tested up to: 6.8 5 5 Requires PHP: 7.2 6 Stable tag: 1.0. 86 Stable tag: 1.0.9 7 7 License: GPLv2 or later 8 8 Contributors: aryans … … 60 60 == Changelog == 61 61 62 = 1.0.9 = 63 * Feature to remove local media 64 * Improved media handling 65 62 66 = 1.0.8 = 63 67 * Optimized loading time
Note: See TracChangeset
for help on using the changeset viewer.