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
<div class="col-lg-9 order-md-1 course_col" id = "video_player_area">
<!-- <div class="" style="background-color: #333;"> -->
<div class="" style="text-align: center;">
<?php
$lesson_details = $this->crud_model->get_lessons('lesson', $lesson_id)->row_array();
$lesson_thumbnail_url = $this->crud_model->get_lesson_thumbnail_url($lesson_id);
$opened_section_id = $lesson_details['section_id'];
// If the lesson type is video
// i am checking the null and empty values because of the existing users does not have video in all video lesson as type
if($lesson_details['lesson_type'] == 'video' || $lesson_details['lesson_type'] == '' || $lesson_details['lesson_type'] == NULL):
$video_url = $lesson_details['video_url'];
$provider = $lesson_details['video_type'];
?>
<!-- If the video is youtube video -->
<?php if (strtolower($provider) == 'youtube'): ?>
<!------------- PLYR.IO ------------>
<link rel="stylesheet" href="<?php echo base_url();?>assets/global/plyr/plyr.css">
<div class="plyr__video-embed" id="player">
<iframe height="500" src="<?php echo $video_url;?>?origin=https://plyr.io&iv_load_policy=3&modestbranding=1&playsinline=1&showinfo=0&rel=0&enablejsapi=1" allowfullscreen allowtransparency allow="autoplay"></iframe>
</div>
<script src="<?php echo base_url();?>assets/global/plyr/plyr.js"></script>
<script>const player = new Plyr('#player');</script>
<!------------- PLYR.IO ------------>
<!-- If the video is vimeo video -->
<?php elseif (strtolower($provider) == 'vimeo'):
$video_details = $this->video_model->getVideoDetails($video_url);
$video_id = $video_details['video_id'];?>
<!------------- PLYR.IO ------------>
<link rel="stylesheet" href="<?php echo base_url();?>assets/global/plyr/plyr.css">
<div class="plyr__video-embed" id="player">
<iframe height="500" src="https://player.vimeo.com/video/<?php echo $video_id; ?>?loop=false&byline=false&portrait=false&title=false&speed=true&transparent=0&gesture=media" allowfullscreen allowtransparency allow="autoplay"></iframe>
</div>
<script src="<?php echo base_url();?>assets/global/plyr/plyr.js"></script>
<script>const player = new Plyr('#player');</script>
<!------------- PLYR.IO ------------>
<!-- If the video is html5 video -->
<?php else :?>
<!------------- PLYR.IO ------------>
<link rel="stylesheet" href="<?php echo base_url();?>assets/global/plyr/plyr.css">
<video poster="<?php echo $lesson_thumbnail_url;?>" id="player" playsinline controls>
<?php if (get_video_extension($video_url) == 'mp4'): ?>
<source src="<?php echo $video_url; ?>" type="video/mp4">
<?php elseif (get_video_extension($video_url) == 'webm'): ?>
<source src="<?php echo $video_url; ?>" type="video/webm">
<?php else: ?>
<h4><?php get_phrase('video_url_is_not_supported'); ?></h4>
<?php endif; ?>
</video>
<script src="<?php echo base_url();?>assets/global/plyr/plyr.js"></script>
<script>const player = new Plyr('#player');</script>
<!------------- PLYR.IO ------------>
<?php endif; ?>
<?php elseif ($lesson_details['lesson_type'] == 'quiz'): ?>
<div class="mt-5">
<?php include 'quiz_view.php'; ?>
</div>
<?php else: ?>
<div class="mt-5">
<a href="<?php echo base_url().'uploads/lesson_files/'.$lesson_details['attachment']; ?>" class="btn btn-sign-up" download style="color: #fff;">
<i class="fa fa-download" style="font-size: 20px;"></i> <?php echo get_phrase('download').' '.$lesson_details['title']; ?>
</a>
</div>
<?php endif; ?>
</div>
<div class="" style="margin: 20px 0;" id = "lesson-summary">
<div class="card">
<div class="card-body">
<h5 class="card-title"><?php echo $lesson_details['lesson_type'] == 'quiz' ? get_phrase('instruction') : get_phrase("note"); ?>:</h5>
<?php if ($lesson_details['summary'] == ""): ?>
<p class="card-text"><?php echo $lesson_details['lesson_type'] == 'quiz' ? get_phrase('no_instruction_found') : get_phrase("no_summary_found"); ?></p>
<?php else: ?>
<p class="card-text"><?php echo $lesson_details['summary']; ?></p>
<?php endif; ?>
</div>
</div>
</div>
</div>