-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathonl_vid2.php
206 lines (177 loc) · 7.81 KB
/
onl_vid2.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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<?php
include'all.php';
?>
<style>
.li-hover:hover{
}
.bg-title{
background: rgba(221,75,57,1);
background: -moz-linear-gradient(left, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 59%, rgba(241,111,92,1) 97%, rgba(241,111,92,1) 100%);
background: -webkit-gradient(left top, right top, color-stop(0%, rgba(221,75,57,1)), color-stop(0%, rgba(221,75,57,1)), color-stop(59%, rgba(221,75,57,1)), color-stop(97%, rgba(241,111,92,1)), color-stop(100%, rgba(241,111,92,1)));
background: -webkit-linear-gradient(left, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 59%, rgba(241,111,92,1) 97%, rgba(241,111,92,1) 100%);
background: -o-linear-gradient(left, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 59%, rgba(241,111,92,1) 97%, rgba(241,111,92,1) 100%);
background: -ms-linear-gradient(left, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 59%, rgba(241,111,92,1) 97%, rgba(241,111,92,1) 100%);
background: linear-gradient(to right, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 59%, rgba(241,111,92,1) 97%, rgba(241,111,92,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dd4b39', endColorstr='#f16f5c', GradientType=1 );
}
.bg-title2{
background: rgba(221,75,57,1);
background: -moz-linear-gradient(left, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 27%, rgba(241,111,92,1) 90%, rgba(241,111,92,1) 100%);
background: -webkit-gradient(left top, right top, color-stop(0%, rgba(221,75,57,1)), color-stop(0%, rgba(221,75,57,1)), color-stop(27%, rgba(221,75,57,1)), color-stop(90%, rgba(241,111,92,1)), color-stop(100%, rgba(241,111,92,1)));
background: -webkit-linear-gradient(left, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 27%, rgba(241,111,92,1) 90%, rgba(241,111,92,1) 100%);
background: -o-linear-gradient(left, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 27%, rgba(241,111,92,1) 90%, rgba(241,111,92,1) 100%);
background: -ms-linear-gradient(left, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 0%, rgba(221,75,57,1) 27%, rgba(241,111,92,1) 90%, rgba(241,111,92,1) 100%);
}
@media only screen and (max-width: 500px)
{
.iframec{
height:auto;
width:250px ;
}
}
@media only screen and (max-width: 990px) {
.pm, .pro-box{
border-bottom:solid 1px silver;
padding-bottom: 10px;
}
.boxzol{
margin-bottom:20px;
}
.forum{
margin-left:5px;
margin-right:5px;
}
.forum2{
margin-left:5px;
margin-right:5px;
}
.topinfo{
margin-left:2px;
margin-right:2px;
}
}
@media only screen and (min-width: 990px) {
.pm{
border-right:solid 1px silver;
border-left:solid 1px silver;
}
.boxzol{
margin-bottom:10px;
}
.topinfo{
margin-left:10px;
margin-right:10px;
}
.forum2{
padding-left: 0px;
}
}
</style>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<section class="content">
<div class="row" style="background-color:#ecf0f5;height:5px;">
</div>
<?php
$playlistId=$_GET['id'];
$api_url = "https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=".$playlistId."&key=AIzaSyBuXwD3VLLeT3Dae50q9I3mSulyBCU-fwk&maxResults=50";
$data=json_decode(file_get_contents($api_url));
?>
<script type="javascript">
$(document).ready(function () {
$('.vid-item').each(function(index){
$(this).on('click', function(){
var current_index = index+1;
$('.vid-item .thumb').removeClass('active');
$('.vid-item:nth-child('+current_index+') .thumb').addClass('active');
});
});
});
</script>
<!-- Main row -->
<!-- /.row -->
<div class="row" style="margin:10px -7px; ">
<!-- Left col -->
<!-- /.col -->
<div class="col-md-10 col-md-offset-1 forum">
<!-- Info Boxes Style 2 -->
<!-- PRODUCT LIST -->
<div class="box box-primary" style="border-top-color:#d2d6de;">
<div class="box-header with-border bg-title" style="">
<h3 class="box-title" style="color:white;">Online Video Lecture</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="col-md-7 col-md-offset-2">
<!-- Box Comment -->
<div class="box box-widget">
<div class="box-header with-border">
<div class="user-block">
<img class="img-circle" src="users/default.jpg" alt="User Image">
<span class="username"><a href="#"><?php echo $_GET['name'];?></a></span>
<span class="description">Shared publicly</span>
</div>
<!-- /.user-block -->
<div class="box-tools">
<button type="button" class="btn btn-box-tool" data-toggle="tooltip" title="" data-original-title="Mark as read">
<i class="fa fa-circle-o"></i></button>
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
<!-- /.box-tools -->
</div>
<!-- /.box-header -->
<div class="box-body text-center">
<div class="vid-container">
<iframe class="iframec" id="vid_frame" style="margin-left:0px;" width="100%" height="360px" src="https://www.youtube.com/embed/<?php echo $data->items[0]->snippet->resourceId->videoId;?>" frameborder="0"></iframe>
</div>
<p></p>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-share"></i> Share</button>
<button type="button" class="btn btn-default btn-xs"><i class="fa fa-thumbs-o-up"></i> Like</button>
</div>
<!-- /.box-body -->
<div class="box-footer box-comments">
<?php
foreach($data->items as $video)
{
$title=$video->snippet->title;
$description=$video->snippet->description;
$thumbnail=$video->snippet->thumbnails->high->url;
$videoId=$video->snippet->resourceId->videoId;
$date=$video->snippet->publishedAt;
?>
<div class="box-comment">
<!-- User image -->
<img class="img-md" src="<?php echo $thumbnail?>" alt="User Image">
<div class="comment-text">
<span class="username">
<a href="javascript:void();" onClick="document.getElementById('vid_frame').src='https://youtube.com/embed/<?php echo $videoId;?>'"><?php echo $title; ?></a>
<span class="text-muted pull-right"><?php echo $date; ?></span>
</span><!-- /.username -->
<?php //echo $description; ?>
</div>
<!-- /.comment-text -->
</div>
<?php } ?>
<!-- /.box-comment -->
</div>
<!-- /.box-footer -->
<!-- /.box-footer -->
</div>
<!-- /.box -->
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php
include'footer.php';
?>