-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
139 lines (106 loc) · 3.64 KB
/
index.html
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style type="text/css">
p {
white-space: nowrap;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
</head>
<body style="background-color: black;">
<div class="container-fluid">
<div class="jumbotron">
<h1>.Net Coders</h1>
<p>Redtube (Zona Leste)</p>
<div class="input-group">
<input id="itemSearch" type="text" class="form-control" placeholder="Mia Khalifa...">
<span class="input-group-btn">
<button id="btn-search" class="btn btn-default" type="button">Pesquisar</button>
</span>
</div><!-- /input-group -->
</div>
<div class="progress" id="div-loading" style="display: none;">
<div class="progress-bar progress-bar-danger progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
<span class="sr-only">45% Complete</span>
</div>
</div>
<div class="row" id="conteudo">
</div>
</div>
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"></h4>
</div>
<div class="modal-body" style="height: 500px">
<iframe id="embed-video" width="100%" height="100%"> </iframe>
</div>
</div>
</div>
</div>
<script type="text-html" id="template">
<div class="col-sm-6 col-md-3 video" style="height: 315px" data-titulo="${video.title}" data-url="${video.embed_url}">
<div class="thumbnail">
<img src="${video.default_thumb}" style="cursor: pointer; height: 200px; width: 100%; display: block;" class="thumb-video">
<div class="caption">
<h3></h3>
<p>${video.title}</p>
</div>
</div>
</div>
</script>
<script src="libs/jquery-3.1.1.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
<script type="text/javascript">
var pesquisarVideos = function ()
{
debugger;
var search = $("#itemSearch").val();
$.ajax(
{
url: 'https://crossorigin.me/http://api.redtube.com/?data=redtube.Videos.searchVideos&output=json&search=' + search,
method: 'GET',
beforeSend: function ()
{
$("#div-loading").show();
},
success: function (retorno)
{
$(".video").remove();
$("#template").tmpl(retorno.videos).appendTo('#conteudo');
},
error: function()
{
alert('DEU RUIM');
},
complete: function ()
{
$("#div-loading").hide();
}
});
}
$("#btn-search").on('click', pesquisarVideos);
$("#conteudo").on('click', '.thumb-video', function ()
{
var elemento = $(this);
var embed_url = elemento.closest('.video').data('url');
var titulo = elemento.closest('.video').data('titulo');
$(".modal-title").html(titulo);
$("#embed-video").attr('src', "https://crossorigin.me/" + embed_url);
$("#myModal").modal();
})
</script>
</body>
</html>