forked from WWBN/AVideo-Encoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideosId.php
57 lines (56 loc) · 2.68 KB
/
videosId.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
if (empty($advancedCustom->doNotAllowUpdateVideoId)) {
?>
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-desktop"></i> <?php echo __('Update existing video'); ?></div>
<div class="panel-body">
<img id="inputNextVideo-poster" src="view/img/notfound.jpg" class="ui-state-default img img-responsive" alt="" />
<input type="text" class="form-control" id="videoSearch" name="videoSearch" placeholder="<?php echo __('Search for a video'); ?>" />
<input type="number" class="form-control" id="update_video_id" name="update_video_id" placeholder="<?php echo __('Video Id'); ?>" />
</div>
</div>
<script>
$(function() {
$("#videoSearch").autocomplete({
minLength: 0,
source: function(req, res) {
$.ajax({
url: '<?php echo Login::getStreamerURL(); ?>objects/videos.json.php?rowCount=6',
data: {
searchPhrase: req.term,
users_id: '<?php echo Login::getStreamerUserId(); ?>',
user: '<?php echo Login::getStreamerUser(); ?>',
pass: '<?php echo Login::getStreamerPass(); ?>',
encodedPass: true
},
/*
xhrFields: {
//withCredentials: true
},
*/
type: 'post',
success: function(data) {
res(data.rows);
}
});
},
focus: function(event, ui) {
$("#videoSearch").val(ui.item.title);
return false;
},
select: function(event, ui) {
$("#videoSearch").val(ui.item.title);
$("#update_video_id").val(ui.item.id);
console.log(ui.item.videosURL);
console.log(ui.item.videosURL.jpg);
$("#inputNextVideo-poster").attr("src", ui.item.videosURL.jpg.url);
return false;
}
}).autocomplete("instance")._renderItem = function(ul, item) {
return $("<li>").append("<div>" + item.title + "</div>").appendTo(ul);
};
});
</script>
<?php
}
?>