63 $this->
widget = new \YAWK\widget();
74 public function init()
76 echo $this->
getHeading($this->plyrHeading, $this->plyrSubtext);
93 if (isset($this->plyrMediaFile) && (!empty($this->plyrMediaFile)))
95 if (strpos($this->plyrMediaFile,
'.mp4') !==
false)
97 $this->plyrFiletype =
"video/mp4";
99 if (strpos($this->plyrMediaFile,
'.webm') !==
false)
101 $this->plyrFiletype =
"video/webm";
106 echo
"Plyr Error: unable to detect media file type - no file was set!";
112 if (isset($this->plyrPoster) && (!empty($this->plyrPoster)))
114 $this->plyrPosterHtml =
"poster=\"$this->plyrPoster\"";
118 $this->plyrPosterHtml =
"poster=\"\"";
125 if (isset($this->plyrTextTrackFile) && (!empty($this->plyrTextTrackFile)))
127 if (!isset($this->plyrTextTrackSrcLang) || (empty($this->plyrTextTrackSrcLang)))
129 $this->plyrTextTrackSrcLang =
"en";
132 if (!isset($this->plyrTextTrackLabel) || (empty($this->plyrTextTrackLabel)))
134 $this->plyrTextTrackLabel =
"English";
137 $this->plyrTextTrackFileHtmlOutput =
"<track kind=\"captions\" label=\"$this->plyrTextTrackLabel\" srclang=\"$this->plyrTextTrackSrcLang\" src=\"$this->plyrTextTrackFile\" default>";
141 $this->plyrTextTrackFileHtmlOutput =
'';
148 <!-- output plyr html player -->
150 <video '.$this->plyrPosterHtml.
' controls style="width: '.$this->plyrWidth.
'">
151 <source src="'.$this->plyrMediaFile.
'" type="'.$this->plyrFiletype.
'">
152 <!-- Text track file -->
153 '.$this->plyrTextTrackFileHtmlOutput.
'
154 <!-- Fallback for browsers that dont support the <video> element -->
155 <a href="'.$this->plyrMediaFile.
'" download>Download</a>
160 <script src="system/widgets/plyr/js/plyr.js"></script>
164 "autoplay":'.$this->plyrAutoplay.
',
165 "disableContextMenu": '.$this->plyrDisableContextMenu.
',
166 "hideControls": '.$this->plyrHideControls.
',
167 "showPosterOnEnd": '.$this->plyrShowPosterOnEnd.
',
168 "clickToPlay": '.$this->plyrClickToPlay.
'
172 <link type="text/css" rel="stylesheet" href="system/widgets/plyr/js/plyr.css">
174 <!-- Rangetouch to fix <input type="range"> on touch devices (see https://rangetouch.com) -->
175 <script src="system/widgets/plyr/js/rangetouch.js" async></script>';
if(isset($_POST['save'])) $settings