Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by inferno-prime

  1. according to an article it does have a handle that you choose to set.
  2. Went to the functions file to change the wp_enqueue_script ('name' to something else now I have the new renamed script plus the previous one showing. I did some more research concerning this is the functions file the only place you use the : wp_enqueue_script/styles command for inserting script or styles for wordpress ?
  3. I would like to learn how. Is that alright?
  4. Sorry I meant the javascript. When viewing in the inspect element in firefox it has a name for each script in the head section.
  5. Did some searching on google could not find anything so far. I have a wordpress theme and I would like to change the name of the script id if that won't be to hard.
  6. I encode it as vp8 on my pc first because of the major size difference.
  7. Do you mean these ? -vcodec copy -vb 2k -acodec copy -ar 44100 -f webm
  8. I'm sorry. Please be more straight forward with me in the future. So let me ask how should I go about trying to make sure they are created equal if possible ?
  9. Alright I'll check into it. The weird this is I used another video cms called avideo and the webm played just fine.
  10. Well I just found out some facts. The video does play I tried it on a friends phone and it worked fine. But for some reason on my iphone 5s it won't play. Can I pm you a link to the site to test on your mobile ? Would you be willing to test it ?
  11. I want people to be able to view video from both their desktop and mobile devices. No, I did not. I already tested it too and it works fine for desktop viewing. Have you heard "it is a go no-go situation" before ? It is not working on mobile for some reason when I view it I see the thumbnail but no video plays and I want it to play. I will say it again because I can't stress it enough how much I appreciate your help or anyone's help on the matter.I have started trying to learn php to hopefully help some if any on this or future problems. If you have anymore questions please let me know.
  12. Sorry,no I only want to use webm for both mobile and desktop
  13. This is the page for the mobile theme. <script> cumulusClips.lang.errorComment = <?=json_encode(Language::getText('error_comment'))?>; cumulusClips.lang.reply = <?=json_encode(Language::getText('reply'))?>; cumulusClips.lang.replyTo = <?=json_encode(Language::getText('reply_to'))?>; cumulusClips.videoId = <?=$video->videoId?>; cumulusClips.commentCount = <?=$commentCount?>; </script> <div class="video-player-container block"> <div class="video-player"> <?php if ($video->gated && !$loggedInUser): ?> <img width="100%" height="200" src="<?=$config->thumbUrl?>/<?=$video->filename?>.jpg" alt="" /> <div class="gate"> <p><?=Language::getText('gated_video')?></p> <a class="login-link" href=""><?=Language::getText('login')?></a> <?php if ($config->enableRegistrations): ?> <a href="<?=HOST?>/register/"><?=Language::getText('register')?></a> <?php endif; ?> </div> <?php else: ?> <video width="100%" height="100%" controls poster="<?=$config->thumbUrl?>/<?=$video->filename?>.jpg"> <source src="<?= $config->webmUrl ?>/<?= $video->filename ?>.webm" type="video/webm" /> </video> <?php endif; ?> </div> <h1><?=$video->title?></h1> <div class="play-tabs" data-role="navbar"> <ul> <li><a href="" data-block="about-container" class="ui-btn-active" data-ajax="false"><?=Language::getText('about')?></a></li> <li><a href="" data-block="suggestions-container" data-ajax="false"><?=Language::getText('suggestions')?></a></li> <li><a href="" data-block="comments-container" data-ajax="false"><?=Language::getText('comments')?></a></li> </ul> </div> </div> <div class="tab-blocks"> <!-- About --> <div class="about-container"> <h1><?=Language::getText('about')?></h1> <div class="block"> <p><strong><?=Language::getText('duration')?>:</strong> <?=$video->duration?></p> <p><strong><?=Language::getText('views')?>:</strong> <?=$video->views?></p> <p><strong><?=Language::getText('by')?>:</strong> <?=$video->username?></p> <p><strong><?=Language::getText('description')?>:</strong> <?=$video->description?></p> </div> </div> <!-- Suggestions --> <div class="suggestions-container"> <h1><?=Language::getText('suggestions_header')?></h1> <div class="block block-listview"> <ul data-role="listview"> <?php if (count($relatedVideos) > 0): ?> <?php $this->repeatingBlock('video.phtml', $relatedVideos); ?> <?php else: ?> <li><p><?=Language::getText('no_suggestions')?></p></li> <?php endif; ?> </ul> </div> </div> <!-- Comments --> <div class="comments-container"> <div class="header"> <h1><?=Language::getText('comments_header')?></h1> &bull; <span><?=$commentCount?></span> <?php if ($loggedInUser): ?> <a href="#post-comment-<?=$video->videoId?>" data-transition="pop" data-rel="popup" data-position-to="window"><?=Language::getText('comments_button')?></a> <?php else: ?> <?php if ($config->enableRegistrations): ?> <p><?=Language::getText('comments_login_register', array('login_link' => '', 'register_link' => HOST . '/register/'))?></p> <?php else: ?> <p><?=Language::getText('comments_login', array('login_link' => ''))?></p> <?php endif; ?> <?php endif; ?> </div> <div class="block block-listview"> <ul data-role="listview" class="comment-list"> <?php if ($commentCount > 0): ?> <?php foreach ($commentCardList as $commentCard): ?> <li data-comment="<?=$commentCard->comment->commentId?>" class="comment"> <div class="avatar"> <img width="40" height="40" src="<?=($commentCard->avatar) ? $commentCard->avatar : $this->options->themeUrl . '/images/avatar.gif'?>" /> </div> <div class="content"> <p> <?=$commentCard->author->username?> <?=date('m/d/Y', strtotime($commentCard->comment->dateCreated))?> <?php if ($loggedInUser): ?> <a href="#post-comment-<?=$video->videoId?>" class="comment-reply" data-parent-comment="<?=$commentCard->comment->commentId?>" data-transition="pop" data-rel="popup" data-position-to="window"><?=Language::getText('reply')?></a> <?php endif; ?> </p> <?php if ($commentCard->comment->parentId != 0): ?> <p class="reply"><?=Language::getText('reply_to')?> <?=$commentCard->parentAuthor->username?></p> <?php endif; ?> <p class="comment-text"><?=nl2br($commentCard->comment->comments)?></p> </div> </li> <?php endforeach; ?> <?php if (count($commentCardList) < $commentCount): ?> <li data-icon="false" data-limit="5" class="load-more"><a href=""><?=Language::getText('load_more')?></a></li> <?php endif; ?> <?php else: ?> <li class="no-comments"><p><?=Language::getText('no_comments')?></p></li> <?php endif; ?> </ul> </div> </div> </div> <div id="post-comment-<?=$video->videoId?>" class="post-comment" data-role="popup" data-tolerance="15" data-overlay-theme="b"> <a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a> <div> <div class="message block"></div> <h3><?=Language::getText('comments_post_header')?></h3> <form action="<?=HOST?>/actions/comment/add/" method="post" data-ajax="false"> <textarea name="comments" style="height:auto;" placeholder="<?=Language::getText('comments')?>" rows="4"></textarea> <input type="hidden" name="video-id" value="<?=$video->videoId?>" /> <input type="hidden" name="parent-comment-id" value="" /> <button type="submit" class="ui-btn ui-corner-all"><?=Language::getText('comments_button')?></button> </form> </div> </div> Line 23 was originally this :<source src="<?=$config->mobileUrl?>/<?=$video->filename?>.mp4" type="video/mp4" />. Tried changing some lines for the mobile folder in bootstrap and encode.php but no go. Is it true that today's smartphone browsers cannot play the webm format ? Basically that's what I am trying to achieve here.
  14. Found the problem I had to remove this line : <source src="<?= $config->h264Url ?>/<?= $video->filename ?>.mp4" type="video/mp4" /> under the begin video section. <?php $this->addMeta('videoId', $video->videoId); $this->addMeta('theme', $this->options->themeUrl); $this->addMeta('loggedIn', (bool) $loggedInUser); $this->addMeta('reply_to', Language::getText('reply_to')); $this->addMeta('report_abuse', Language::getText('report_abuse')); if ($loggedInUser && !$video->commentsClosed) { $this->addMeta('reply', Language::getText('reply')); } $this->addCss($this->options->themeUrl . '/css/vendor/video-js.css'); $this->addJs($this->options->themeUrl . '/js/vendor/video.min.js'); //$this->addJs($this->options->themeUrl . '/js/general.js'); $this->addJs($this->options->themeUrl . '/js/vendor/moment.min.js'); $this->addJs($this->options->themeUrl . '/js/vendor/jsrender.min.js'); $this->addJs($this->options->themeUrl . '/js/comments.js'); ?> <div class="container-fluid"> <div class="row pt-5"> <div class="col-md-8"> <div class="header-secondary"> <h1 class="video-title"><?php echo htmlspecialchars($video->title); ?></h1> <?php (isset($message)) ? showAlertMessage($message, $message_type) : ''; ?> </div> <?php if ($video->gated && !$loggedInUser) : ?> <div id="player-gated"> <img width="100%" height="auto" src="<?= getVideoThumbUrl($video) ?>" alt="<?= htmlspecialchars($video->title); ?>" /> <div> <p><?= Language::getText('gated_video') ?></p> <a href="<?= HOST ?>/login/?redirect=<?= urlencode($this->getService('Video')->getUrl($video)) ?>" class="button_small"><?= Language::getText('login') ?></a> <?php if ($config->enableRegistrations) : ?> <a href="<?= HOST ?>/register/" class="button_small"><?= Language::getText('register') ?></a> <?php endif; ?> </div> </div> <?php else : ?> <!-- BEGIN VIDEO --> <div id="player" class="mb-1"> <video class="video-js vjs-big-play-centered" controls preload="auto" data-setup='{ "autoplay": false, "fluid": true, "aspectRatio": "16:9"}' poster="<?= getVideoThumbUrl($video) ?>"> <source src="<?= $config->h264Url ?>/<?= $video->filename ?>.mp4" type="video/mp4" /> <?php if ($webmEncodingEnabled) : ?> <source src="<?= $config->webmUrl ?>/<?= $video->filename ?>.webm" type="video/webm" /> <?php endif; ?> <?php if ($theoraEncodingEnabled) : ?> <source src="<?= $config->theoraUrl ?>/<?= $video->filename ?>.ogg" type="video/ogg" /> <?php endif; ?> </video> </div> <!-- END VIDEO --> <?php endif; ?> <!-- BEGIN ACTIONS --> <div class="row actions"> <div class="col-md-6"> <p class="large">Viewed <?= $video->views ?> times.</p> </div> <div class="col-md-6"> <div class="btn-toolbar float-right" role="toolbar" aria-label="Video actions."> <div class="btn-group mr-2" role="group" aria-label="Like/Rating buttons."> <?php if (isRated($video, $loggedInUser)) : ?> <a id="liked" class="like rating btn btn-sm btn-outline-primary disabled" href="#" data-rating="0" data-video_id=<?= $video->videoId; ?> role="button"><i class="fas fa-heart like-icon" alt="Click to like this video."></i> <span class="likes badge badge-light"><?= $rating->likes ?></span> <span class="sr-only"> likes for this video.</span> </a> <?php else : ?> <a id="like" class="like rating btn btn-sm btn-outline-primary" href="" data-rating="1" data-video_id=<?= $video->videoId; ?> role="button"><i class="far fa-heart like-icon" alt="Click to like this video."></i> <span class="likes badge badge-light"><?= $rating->likes ?></span> <span class="sr-only"> likes for this video.</span> </a> <?php endif; ?> </div> <?php if ($loggedInUser) : ?> <div class="btn-group button-actions" role="group" aria-label="Playlist Actions."> <?php include $this->getFallbackPath("blocks/playlist-buttons.phtml"); ?> </div> <?php endif; ?> </div> </div> </div> <!-- END ACTIONS --> <!-- BEGIN TABS --> <div class="row actions"> <div class="col"> <nav> <div class="nav nav-tabs" id="nav-tab" role="tablist"> <a class="nav-item nav-link active" id="nav-about-tab" data-toggle="tab" href="#nav-about" role="tab" aria-controls="nav-about" aria-selected="true"><?= Language::getText('about') ?></a> <a class="nav-item nav-link" id="nav-share-tab" data-toggle="tab" href="#nav-share" role="tab" aria-controls="nav-share" aria-selected="false">Embed/Share</a> <a class="nav-item nav-link" id="nav-flag-tab" data-toggle="tab" href="#nav-flag" role="tab" aria-controls="nav-flag" aria-selected="false">Report</a> </div> </nav> </div> </div> <!-- END TABS --> <!-- BEGIN TAB CONTENT --> <div class="row"> <div class="col"> <div class="tab-content" id="nav-tabContent"> <div class="tab-pane fade show active" id="nav-about" role="tabpanel" aria-labelledby="nav-about-tab"> <?php include 'blocks/watch/about.php'; ?> </div> <div class="tab-pane fade show" id="nav-share" role="tabpanel" aria-labelledby="nav-share-tab"> <?php include 'blocks/watch/share.php'; ?> </div> <div class="tab-pane fade show" id="nav-flag" role="tabpanel" aria-labelledby="nav-flag-tab"> <?php include 'blocks/watch/report.php'; ?> </div> </div> </div> </div> <!-- END TAB CONTENT --> <!-- BEGIN COMMENTS SECTION --> <?php if ($video->commentsClosed) : ?> <div id="comments-closed" class="row"> <div class="col alert alert-info"> <p class="commentMessage"><?= Language::getText('comments_closed') ?></p> </div> </div> <?php else : ?> <div id="comments" class="row comments-form-block comments-actionable"> <div class="col commentForm"> <div class="comment-form-head"> <h3 class="d-inline-block"><?= Language::getText('comments_header') ?> </h3> <span id="comment-count" class="badge badge-info align-top "><?= $commentCount ?></span> <span class="sr-only"><?= Language::getText('comments_total') ?></span> </div> <?php include 'blocks/watch/comments_form.php'; ?> <div class="comment-alerts"></div> </div> </div> <div class="row comment-stream mt-4"> <div id="comments-list-block" class="col comments-actionable report-abuse-container"> <?php include 'blocks/watch/comments_list.php'; ?> </div> </div> <div class="row"> <div class="col"> <?php if ($commentCount > 5) : ?> <div class="loadMoreComments"> <button href="" class="btn btn-outline-primary btn-lg btn-block" data-loading_text="<?= Language::getText('loading') ?>"><i class="fas fa-caret-down pr-3"></i> <?= Language::getText('load_more') ?> <i class="fas fa-caret-down pl-3"></i></button> </div> <?php endif; ?> </div> </div> <?php endif; ?> <?php readfile('templates/comment_card.html', true); ?> </div> <!-- END COMMENTS SECTION --> <aside class="col-md-4 pt-3"> <!-- BEGIN RELATED VIDEOS --> <?php if ($playlist) : ?> <?php include 'blocks/watch/playlist.php'; ?> <?php endif; ?> <!-- BEGIN RELATED VIDEOS --> <?php include 'blocks/watch/related.php'; ?> <!-- END RELATED VIDEOS --> </aside> </div> </div> Now the webm will play. Now my next problem is that this script has a mobile side as well but it forces you to encode a seperate video for that side. I simply want to use the same video from the desktop side. So I will see if I can either replace that same url for the mobile size or if I change the mobile videos folder to match the desktop one.
  15. Well considering I don't know much about php I have only been able to piece some things together. But give me some time and ill see what I can dig up. Ill check back as soon as I can with an update.
  16. I did what you said and it worked but now I have a new problem. After encoding is done its still looking for the mp4 file for some reason and it wont play the webm file even though its there.
  17. I found a topic here That looks like it mite work. Now I did try this but I get a post 404 on the new ajax url which is /ajax/ which then I can't do anything in the dashboard. I would told the api was not meant for this but honestly I don't know what to say as long as the code works I really don't see a problem with using it. BTW I am using this code : // This will change the url for admin-ajax.php to /ajax/ function modify_adminy_url_for_ajax( $url, $path, $blog_id ) { if ( 'admin-ajax.php' == $path ) { $url = site_url('/ajax/'); } return $url; } add_filter( 'admin_url', 'modify_adminy_url_for_ajax', 10, 3 ); And this goes into the .htaccess RewriteRule ^/?ajax/?$ /wp-admin/admin-ajax.php?&%{QUERY_STRING} [L,QSA]
  18. I did try this but then it said it could not find the video after conversion. I will try again and update you.
  19. Hello First off I want to say thank to those who helped me with my last visit here they were a tremendous help. I am using this script for encoding my video. this script encodes both webm and mp4 at the same time which is something I don't want. I was hoping to make that option select-able but I fear that would be to much to ask now. I'll admit I don't know much about php but I really do appreciate the help. I have the encode file here I tried commenting some lines out but had no success. I will also mention that I tried their forums but they are no help since they expect everyone who comes there to magically know php. I asked for help several times and most of the time got no reply. <?php // Startup application include_once(dirname(__FILE__) . '/bootstrap.php'); // Validate CLI parameters passed to script $arguments = getopt('', array('video:', 'import::')); if (!$arguments || !preg_match('/^[0-9]+$/', $arguments['video'])) exit(); // Validate provided import job if (!empty($arguments['import'])) { if (file_exists(UPLOAD_PATH . '/temp/import-' . $arguments['import'])) { $importJobId = $arguments['import']; } else { exit('An invalid import job was passed to the video encoder.'); } } else { $importJobId = null; } // Establish page variables, objects, arrays, etc $video_id = $arguments['video']; $ffmpegPath = Settings::get('ffmpeg'); $qtFaststartPath = Settings::get('qtfaststart'); $videoMapper = new VideoMapper(); $videoService = new \VideoService(); // Update any failed videos that are still marked processing $videoService->updateFailedVideos(); // Set MySQL wait_timeout to 10 hours to prevent 'MySQL server has gone away' errors $db->query("SET @@session.wait_timeout=36000"); // Debug Log if ($config->debugConversion) { App::log(CONVERSION_LOG, "\n\n// Converter Called..."); App::log(CONVERSION_LOG, "Values passed to encoder:\n" . print_r ($arguments, TRUE)); } try { ///////////////////////////////////////////////////////////// // STEP 1 // // Check Permissions on Transcoding Binaries // ///////////////////////////////////////////////////////////// // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "\nChecking FFMPEG permissions...") : null; if (strpos($ffmpegPath, DOC_ROOT) !== false && Filesystem::getPermissions($ffmpegPath) != '0777') { try { Filesystem::setPermissions($ffmpegPath, 0777); } catch (Exception $e) { throw new Exception("Unable to update permissions for FFMPEG. Please make sure it ($ffmpegPath) has 777 executeable permissions.\n\nAdditional information: " . $e->getMessage()); } } // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "\nChecking qt-faststart permissions...") : null; if (strpos($qtFaststartPath, DOC_ROOT) !== false && Filesystem::getPermissions($qtFaststartPath) != '0777') { try { Filesystem::setPermissions($qtFaststartPath, 0777); } catch (Exception $e) { throw new Exception("Unable to update permissions for qt-faststart. Please make sure it ($qtFaststartPath) has 777 executeable permissions.\n\nAdditional information: " . $e->getMessage()); } } ///////////////////////////////////////////////////////////// // STEP 2 // // Validate Requested Video // ///////////////////////////////////////////////////////////// // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, 'Validating requested video...') : null; // Validate requested video $video = $videoMapper->getVideoByCustom(array('video_id' => $video_id, 'status' => VideoMapper::PENDING_CONVERSION)); if (!$video) throw new Exception("An invalid video was passed to the video encoder."); // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, 'Establishing variables...') : null; // Retrieve video information $video->status = VideoMapper::PROCESSING; $video->jobId = posix_getpid(); $videoMapper->save($video); $debugLog = LOG . '/' . $video->filename . '.log'; $rawVideo = UPLOAD_PATH . '/temp/' . $video->filename . '.' . $video->originalExtension; $h264TempFilePath = UPLOAD_PATH . '/h264/' . $video->filename . '_temp.mp4'; $h264FilePath = UPLOAD_PATH . '/h264/' . $video->filename . '.mp4'; $theoraFilePath = UPLOAD_PATH . '/theora/' . $video->filename . '.ogg'; $webmFilePath = UPLOAD_PATH . '/webm/' . $video->filename . '.webm'; $mobileTempFilePath = UPLOAD_PATH . '/mobile/' . $video->filename . '_temp.mp4'; $mobileFilePath = UPLOAD_PATH . '/mobile/' . $video->filename . '.mp4'; $thumb = UPLOAD_PATH . '/thumbs/' . $video->filename . '.jpg'; // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, 'Verifying raw video exists...') : null; // Verify Raw Video Exists if (!file_exists ($rawVideo)) throw new Exception("The raw video file does not exists. The id of the video is: $video->videoId"); // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, 'Verifying raw video was valid size...') : null; // Verify Raw Video has valid file size // (Greater than min. 5KB, anything smaller is probably corrupted if (!filesize ($rawVideo) > 1024*5) throw new Exception("The raw video file is not a valid filesize. The id of the video is: $video->videoId"); ///////////////////////////////////////////////////////////// // STEP 3 // // Encode raw video to H.264 // ///////////////////////////////////////////////////////////// // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "\nPreparing for: H.264 Encoding...") : null; // Encode raw video to H.264 $h264Command = "$ffmpegPath -i $rawVideo " . Settings::get('h264_encoding_options') . " $h264TempFilePath >> $debugLog 2>&1"; // Debug Log $logMessage = "\n\n\n\n==================================================================\n"; $logMessage .= "H.264 ENCODING\n"; $logMessage .= "==================================================================\n\n"; $logMessage .= "H.264 Encoding Command: $h264Command\n\n"; $logMessage .= "H.264 Encoding Output:\n\n"; $config->debugConversion ? App::log(CONVERSION_LOG, 'H.264 Encoding Command: ' . $h264Command) : null; App::log($debugLog, $logMessage); // Execute H.264 encoding command exec($h264Command); // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, 'Verifying H.264 video was created...') : null; // Verify temp H.264 video was created successfully if (!file_exists($h264TempFilePath) || filesize($h264TempFilePath) < 1024*5) { throw new Exception("The temp H.264 file was not created. The id of the video is: $video->videoId"); } ///////////////////////////////////////////////////////////// // STEP 4 // // Shift Moov atom on H.264 video // ///////////////////////////////////////////////////////////// // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "\nShifting moov atom on H.264 video...") : null; // Prepare shift moov atom command $h264ShiftMoovAtomCommand = "$qtFaststartPath $h264TempFilePath $h264FilePath >> $debugLog 2>&1"; // Debug Log $logMessage = "\n\n\n\n==================================================================\n"; $logMessage .= "H.264 SHIFT MOOV ATOM\n"; $logMessage .= "==================================================================\n\n"; $logMessage .= "H.264 Shift Moov Atom Command: $h264ShiftMoovAtomCommand\n\n"; $logMessage .= "H.264 Shift Moov Atom Output:\n\n"; $config->debugConversion ? App::log(CONVERSION_LOG, 'H.264 Shift Moov Atom Command: ' . $h264ShiftMoovAtomCommand) : null; App::log($debugLog, $logMessage); // Execute shift moov atom command exec($h264ShiftMoovAtomCommand); // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, 'Verifying final H.264 file was created...') : null; // Verify H.264 video was created successfully if (!file_exists($h264FilePath) || filesize($h264FilePath) < 1024*5) { throw new Exception("The final H.264 file was not created. The id of the video is: $video->videoId"); } ///////////////////////////////////////////////////////////// // STEP 5 // // Encode raw video to WebM // ///////////////////////////////////////////////////////////// $webmEncodingEnabled = (Settings::get('webm_encoding_enabled') == '1') ? true : false; $webmEncodingOptions = Settings::get('webm_encoding_options'); if ($webmEncodingEnabled) { // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "\nPreparing for: WebM Encoding...") : null; // Encode raw video to WebM $webmCommand = "$ffmpegPath -i $rawVideo " . $webmEncodingOptions . " $webmFilePath >> $debugLog 2>&1"; // Debug Log $logMessage = "\n\n\n\n==================================================================\n"; $logMessage .= "WebM ENCODING\n"; $logMessage .= "==================================================================\n\n"; $logMessage .= "WebM Encoding Command: $webmCommand\n\n"; $logMessage .= "WebM Encoding Output:\n\n"; $config->debugConversion ? App::log(CONVERSION_LOG, 'WebM Encoding Command: ' . $webmCommand) : null; App::log($debugLog, $logMessage); // Execute WebM encoding command exec($webmCommand); // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, 'Verifying WebM video was created...') : null; // Verify temp WebM video was created successfully if (!file_exists($webmFilePath) || filesize($webmFilePath) < 1024*5) { throw new Exception("The WebM file was not created. The id of the video is: $video->videoId"); } } ///////////////////////////////////////////////////////////// // STEP 6 // // Encode raw video to Theora // ///////////////////////////////////////////////////////////// $theoraEncodingEnabled = (Settings::get('theora_encoding_enabled') == '1') ? true : false; $theoraEncodingOptions = Settings::get('theora_encoding_options'); if ($theoraEncodingEnabled) { // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "\nPreparing for: Theora Encoding...") : null; // Encode raw video to Theora $theoraCommand = "$ffmpegPath -i $rawVideo " . $theoraEncodingOptions . " $theoraFilePath >> $debugLog 2>&1"; // Debug Log $logMessage = "\n\n\n\n==================================================================\n"; $logMessage .= "Theora ENCODING\n"; $logMessage .= "==================================================================\n\n"; $logMessage .= "Theora Encoding Command: $theoraCommand\n\n"; $logMessage .= "Theora Encoding Output:\n\n"; $config->debugConversion ? App::log(CONVERSION_LOG, 'Theora Encoding Command: ' . $theoraCommand) : null; App::log($debugLog, $logMessage); // Execute Theora encoding command exec($theoraCommand); // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, 'Verifying Theora video was created...') : null; // Verify temp Theora video was created successfully if (!file_exists($theoraFilePath) || filesize($theoraFilePath) < 1024*5) { throw new Exception("The Theora file was not created. The id of the video is: $video->videoId"); } } ///////////////////////////////////////////////////////////// // STEP 7 // // Encode raw video to Mobile // ///////////////////////////////////////////////////////////// $mobileEncodingEnabled = (Settings::get('mobile_encoding_enabled') == '1') ? true : false; $mobileEncodingOptions = Settings::get('mobile_encoding_options'); if ($mobileEncodingEnabled) { // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "\nPreparing for: Mobile Encoding...") : null; // Encode raw video to Mobile $mobileCommand = "$ffmpegPath -i $rawVideo " . $mobileEncodingOptions . " $mobileTempFilePath >> $debugLog 2>&1"; // Debug Log $logMessage = "\n\n\n\n==================================================================\n"; $logMessage .= "Mobile ENCODING\n"; $logMessage .= "==================================================================\n\n"; $logMessage .= "Mobile Encoding Command: $mobileCommand\n\n"; $logMessage .= "Mobile Encoding Output:\n\n"; $config->debugConversion ? App::log(CONVERSION_LOG, 'Mobile Encoding Command: ' . $mobileCommand) : null; App::log($debugLog, $logMessage); // Execute Mobile encoding command exec($mobileCommand); // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, 'Verifying Mobile video was created...') : null; // Verify temp Mobile video was created successfully if (!file_exists($mobileTempFilePath) || filesize($mobileTempFilePath) < 1024*5) { throw new Exception("The Mobile file was not created. The id of the video is: $video->videoId"); } ///////////////////////////////////////////////////////////// // STEP 8 // // Shift Moov atom on Mobile video // ///////////////////////////////////////////////////////////// // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "\nShifting moov atom on Mobile video...") : null; // Execute Faststart Command $faststartCommand = "$qtFaststartPath $mobileTempFilePath $mobileFilePath >> $debugLog 2>&1"; // Debug Log $logMessage = "\n\n\n\n==================================================================\n"; $logMessage .= "FASTSTART\n"; $logMessage .= "==================================================================\n\n"; $logMessage .= "Faststart Command: $faststartCommand"; $logMessage .= "Faststart Output:\n\n"; $config->debugConversion ? App::log(CONVERSION_LOG, 'Faststart Command: ' . $faststartCommand) : null; App::log($debugLog, $logMessage); // Execute Faststart command exec($faststartCommand); // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, 'Verifying final Mobile file was created...') : null; // Verify Mobile video was created successfully if (!file_exists($mobileFilePath) || filesize($mobileFilePath) < 1024*5) throw new Exception("The final Mobile file was not created. The id of the video is: $video->videoId"); } ///////////////////////////////////////////////////////////// // STEP 9 // // Get Video Duration // ///////////////////////////////////////////////////////////// // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "\nRetrieving video duration...") : null; // Retrieve duration of raw video file. $durationCommand = "$ffmpegPath -i $rawVideo 2>&1 | grep Duration:"; exec($durationCommand, $durationResults); // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "Duration command results:\n" . print_r ($durationResults, TRUE)) : null; $durationResultsCleaned = preg_replace('/^\s*Duration:\s*/', '', $durationResults[0]); preg_match ('/^[0-9]{2}:[0-9]{2}:[0-9]{2}/', $durationResultsCleaned, $duration); $sec = Functions::durationToSeconds($duration[0]); // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "Duration in Seconds: $sec") : null; // Calculate thumbnail position $thumbPosition = round ($sec / 2); // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "Thumb Position: $thumbPosition") : null; ///////////////////////////////////////////////////////////// // STEP 10 // // Create Thumbnail Image // ///////////////////////////////////////////////////////////// // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "\nPreparing to create video thumbnail...") : null; // Create video thumbnail image $thumbCommand = "$ffmpegPath -i $rawVideo -ss $thumbPosition " . Settings::get('thumb_encoding_options') . " $thumb >> $debugLog 2>&1"; // Debug Log $logMessage = "\n\n\n\n==================================================================\n"; $logMessage .= "THUMB CREATION\n"; $logMessage .= "==================================================================\n\n"; $logMessage .= "Thumb Creation Command: $thumbCommand"; $logMessage .= "Thumb Creation Output:\n\n"; $config->debugConversion ? App::log(CONVERSION_LOG, "Thumbnail Creation Command: " . $thumbCommand) : null; App::log($debugLog, $logMessage); exec($thumbCommand); // Execute Thumb Creation Command // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, 'Verifying valid thumbnail was created...') : null; // Verify valid thumbnail was created if (!file_exists($thumb) || filesize($thumb) == 0) throw new Exception("The video thumbnail is invalid. The id of the video is: $video->videoId"); ///////////////////////////////////////////////////////////// // STEP 11 // // Update Video Information // ///////////////////////////////////////////////////////////// // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "\nUpdating video information...") : null; // Update database with new video status information $video->duration = Functions::formatDuration($duration[0]); $video->status = \VideoMapper::PENDING_APPROVAL; $video->jobId = null; $videoMapper->save($video); // Activate video $videoService->approve($video, 'activate'); ///////////////////////////////////////////////////////////// // STEP 12 // // Notify Import Script // ///////////////////////////////////////////////////////////// if ($importJobId) { // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, "\nNotifying import script of completed video...") : null; \ImportManager::executeImport($importJobId); } ///////////////////////////////////////////////////////////// // STEP 13 // // Clean up // ///////////////////////////////////////////////////////////// try { // Debug Log $config->debugConversion ? App::log(CONVERSION_LOG, 'Deleting raw video...') : null; // Delete pre-faststart files Filesystem::delete($h264TempFilePath); if ($mobileEncodingEnabled) Filesystem::delete($mobileTempFilePath); // Delete original video if (Settings::get('keep_original_video') != '1') { Filesystem::delete($rawVideo); } // Delete encoding log files if ($config->debugConversion) { App::log(CONVERSION_LOG, "Video ID: $video->videoId, has completed processing!\n"); } else { Filesystem::delete($debugLog); } } catch (Exception $e) { App::alert('Error During Video Encoding', $e->getMessage()); App::log(CONVERSION_LOG, $e->getMessage()); } } catch (Exception $e) { // Update video status if ($video) { $video->status = \VideoMapper::FAILED; $video->jobId = null; $videoMapper->save($video); } // Notify import script of error if ($importJobId) { \ImportManager::executeImport($importJobId); } App::alert('Error During Video Encoding', $e->getMessage()); App::log(CONVERSION_LOG, $e->getMessage()); exit(); }
  20. Alright I will do some more digging but till then how would you suggest I do that.
  21. I did some digging and I don't know if this is right or not but it seems that the url is dynamic for the video and changes depending on which video you are watching. Here is the line of code which I'm guessing is php : <source src="<?=$config->h264Url?>/<?=$video->filename?>.mp4" type="video/mp4" /> Since the video url changes I bet that's why videojs keeps saying the video is not defined. I did find the line thats giving the error from videojs : var player = video-js('myvideo');. So how do you specify a dynamic url to videojs ?
  22. This is a video sharing script so all the videos play on videojs player.
  23. <?php if ($playlist) $this->addBodyClass('is-playlist'); $this->addMeta('videoId', $video->videoId); $this->addMeta('theme', $this->options->themeUrl); $this->addMeta('loggedIn', (boolean) $loggedInUser); $this->addCss('video-js.css'); $this->addCss('video-theatermode.css'); $this->addCss('scrollbar.css'); $this->addJs('video.plugin.js'); $this->addJs('video.theatermode.js'); $this->addJs('scrollbar.js'); $this->setLayout('full'); ?> <div class="row"> <div class="col-md-8 play-left"> <div class="alert hidden"></div> <!-- BEGIN Video Player --> <?php if ($video->gated && !$loggedInUser): ?> <div id="player-gated"> <img width="750" height="420" src="<?=$config->thumbUrl?>/<?=$video->filename?>.jpg" alt="" /> <div> <p><?=Language::getText('gated_video')?></p> <a href="<?=BASE_URL?>/login/" class="button_small"><?=Language::getText('login')?></a> <?php if ($config->enableRegistrations): ?> <a href="<?=BASE_URL?>/register/" class="button_small"><?=Language::getText('register')?></a> <?php endif; ?> </div> </div> <?php else: ?> <div class="video-player-container"> <video id="video-player" class="video-js vjs-default-skin vjs-16-9" data-setup='{ "controls": true, "autoplay": true, "preload": "auto" }' width="750" height="420" poster="<?=$config->thumbUrl?>/<?=$video->filename?>.jpg"> <source src="<?=$config->h264Url?>/<?=$video->filename?>.mp4" type="video/mp4" /> <?php if ($webmEncodingEnabled): ?> <source src="<?=$config->webmUrl?>/<?=$video->filename?>.webm" type="video/webm" /> <?php endif; ?> <?php if ($theoraEncodingEnabled): ?> <source src="<?=$config->theoraUrl?>/<?=$video->filename?>.ogg" type="video/ogg" /> <?php endif; ?> </video> </div> <?php endif; ?> <script src="https://www.example.com/tv/cc-content/themes/corporate/js/video.plugin.js"></script> <link rel="stylesheet" href="https://www.example.com/tv/cc-content/themes/corporate/css/video-theatermode.css"> <script src="https://www.example.com/tv/cc-content/themes/corporate/js/video.theatermode.js"></script> <script> var player = video-player-container('my-video'); player.theaterMode({ elementToToggle: 'page', className: 'theater-mode' }); player.on('theaterMode', function(elm, data) { if (data.theaterModeIsOn) { // do something } else { // do something else } }); </script> <!-- END Video Player --> <!-- BEGIN Playlist --> <?php if ($playlist): ?> <div id="playlist"> <header> <a class="playlist-collapse pull-right hidden-lg" href="#playlist .video-list" data-toggle="collapse"> <span class="glyphicon glyphicon-triangle-bottom"></span> </a> <h5><?=Functions::cutOff($this->getService('Playlist')->getPlaylistName($playlist), 85)?></h5> <?php $playlistAuthor = $this->getMapper('User')->getUserById($playlist->userId); ?> <p class="small"> <span class="author"><?=Language::getText('by')?>: <a href="<?=BASE_URL?>/members/<?=$playlistAuthor->username?>/"><?=$playlistAuthor->username?></a></span> <?=Language::getText('videos')?>: <?=count($playlistVideos)?> </p> </header> <div class="scrollbar-outer"> <div class="video-list collapse in"> <?php $videoService = $this->getService('Video'); ?> <?php foreach ($playlistVideos as $playlistVideo): ?> <div class="video video-small media <?=($playlistVideo->videoId == $video->videoId) ? 'active' : ''?>"> <div class="media-left thumbnail"> <a href="<?=$videoService->getUrl($playlistVideo)?>/?playlist=<?=$playlist->playlistId?>" title="<?=$playlistVideo->title?>"> <span class="glyphicon glyphicon-play"></span> <img class="media-object" width="100" height="56" src="<?=$config->thumbUrl?>/<?=$playlistVideo->filename?>.jpg" /> </a> </div> <div class="media-body"> <p class="media-heading"><a href="<?=$videoService->getUrl($playlistVideo)?>/?playlist=<?=$playlist->playlistId?>" title="<?=$playlistVideo->title?>"><?=$playlistVideo->title?></a></p> <div class="small"> <?=Language::getText('by')?>:</strong> <a href="<?=BASE_URL?>/members/<?=$playlistVideo->username?>/" title="<?=$playlistVideo->username?>"><?=$playlistVideo->username?></a> <span class="duration"><span class="glyphicon glyphicon-time"></span> <?=$playlistVideo->duration?></span> </div> </div> </div> <?php endforeach; ?> </div> </div> </div> <?php endif; ?> <!-- END Playlist --> <!-- BEGIN Actions --> <div class="panel panel-default actions"> <div class="panel-body row"> <div class="col-xs-12"> <h1><?=$video->title?></h1> </div> <div class="col-xs-6"> <p> <span class="like"> <span class="glyphicon glyphicon-thumbs-up"></span> <?=$rating->likes?> </span> <span class="dislike"> <span class="glyphicon glyphicon-thumbs-down"></span> <?=$rating->dislikes?> </span> </p> </div> <div class="col-xs-6 text-right"> <a class="rating" href="" data-video="<?php echo $video->videoId; ?>" data-rating="1" title="<?=Language::getText('like')?>"> <span class="glyphicon glyphicon-thumbs-up"></span> <?=Language::getText('like')?> </a> <a class="rating" href="" data-video="<?php echo $video->videoId; ?>" data-rating="0" title="<?=Language::getText('dislike')?>"> <span class="glyphicon glyphicon-thumbs-down"></span> <?=Language::getText('dislike')?> </a> </div> </div> </div> <!-- END Actions --> <!-- BEGIN Action Tabs --> <ul class="nav nav-tabs"> <li><a href="#about" data-toggle="tab"><?=Language::getText('about')?></a></li> <li><a href="#share" data-toggle="tab"><?=Language::getText('share')?></a></li> <li><a href="#add-to-playlist" data-toggle="tab" id="playlist-toggle"><?=Language::getText('add')?></a></li> <li><a href="" class="flag" data-type="video" data-id="<?=$video->videoId?>"><?=Language::getText('flag')?></a></li> </ul> <!-- END Action Tabs --> <!-- BEGIN Tab Panes --> <div class="tab-content"> <!-- BEGIN About Tab --> <div class="tab-pane" id="about"> <h4><?=Language::getText('about')?></h4> <div class="panel panel-default"> <div class="panel-body row"> <div class="col-xs-12 col-sm-10 media"> <div class="media-left"> <?php $avatar = $this->getService('User')->getAvatarUrl($member); ?> <img class="media-object" width="65" height="65" src="<?=($avatar) ? $avatar : $this->options->themeUrl . '/images/avatar.gif'?>" alt="<?=$member->username?>" /> </div> <div class="media-body"> <p><strong><?=Language::getText('by')?>:</strong> <a href="<?=BASE_URL?>/members/<?=$member->username?>/" title="<?=$member->username?>"><?=$member->username?></a></p> <p><strong><?=Language::getText('date_uploaded')?>:</strong> <?=date('m/d/Y', strtotime($video->dateCreated))?></p> <p><strong><?=Language::getText('tags')?>:</strong> <?php foreach ($video->tags as $value): ?> <a href="<?=BASE_URL?>/search/?keyword=<?=$value?>" title="<?=$value?>"><?=$value?></a> <?php endforeach; ?> </p> <?php if (!empty($attachments)): ?> <p><strong><?=Language::getText('attachments')?>:</strong> <?php foreach ($attachments as $attachment): ?> <a class="attachment" href="<?php echo $this->getService('File')->getUrl($attachment); ?>" title="<?php echo htmlspecialchars($attachment->name); ?> (<?php echo \Functions::formatBytes($attachment->filesize, 0); ?>)" ><i class="glyphicon glyphicon-paperclip"></i> <?php echo htmlspecialchars($attachment->name); ?> (<?php echo \Functions::formatBytes($attachment->filesize, 0); ?>) </a> <?php endforeach; ?> </p> <?php endif; ?> </div> </div> <div class="col-xs-12 col-sm-2"> <a href="" class="btn btn-primary subscribe" title="<?=Language::getText($subscribe_text)?>" data-type="<?=$subscribe_text?>" data-user="<?=$video->userId?>"><?=Language::getText($subscribe_text)?></a> </div> <p class="col-xs-12"><?=$video->description?></p> </div> </div> </div> <!-- END About Tab --> <!-- BEGIN Share Tab --> <div class="tab-pane" id="share"> <h4><?=Language::getText('share')?></h4> <div class="panel panel-default"> <div class="panel-body row"> <div class="col-xs-4"> <!-- Share Widget Notes - Please replace <your_app_id> in the FaceBook share URL with your actual app id obtained from FaceBook's website. This widget will not work until that happens. - FaceBook, and Google + widgets require the video's URL to be publicly accessible, otherwise the widgets will not work. --> <!-- FACEBOOK BUTTON --> <meta property="og:url" content="<?=$this->getService('Video')->getUrl($video)?>/" /> <meta property="og:title" content="<?=$video->title?>" /> <meta property="og:description" content="<?=$video->description?>" /> <meta property="og:image" content="<?=$config->thumbUrl?>/<?=$video->filename?>.jpg" /> <meta property="og:type" content="video" /> <meta property="og:video" content="<?=$config->h264Url?>/<?=$video->filename?>.mp4"> <meta property="og:video:type" content="video/mp4"> <meta property="og:video:width" content="640"> <meta property="og:video:height" content="360"> <script>if (window.location.hash === '#facebook-share') {window.close();}</script> <a class="facebook" href="https://www.facebook.com/dialog/share?app_id=<your_app_id>&display=popup&href=<?=urlencode($this->getService('Video')->getUrl($video) . '/')?>&redirect_uri=<?=urlencode($this->getService('Video')->getUrl($video) . '/#facebook-share')?>" onClick="window.open(this.href, 'sharewindow','width=550,height=300');return false;">Share on Facebook</a> <!-- TWITTER BUTTON --> <a class="twitter" href="" onClick="window.open('https://twitter.com/share?url=<?=urlencode($this->getService('Video')->getUrl($video) . '/')?>&text=<?=urlencode(Functions::cutOff($video->description, 140))?>','sharewindow','width=650,height=400');return false;">Share on Twitter</a> <!-- Google +BUTTON --> <a class="google" href="https://plus.google.com/share?url=<?=urlencode($this->getService('Video')->getUrl($video) . '/')?>" onClick="javascript:window.open(this.href, 'sharewindow', 'height=600,width=600');return false;">Share</a> </div> <?php if ($video->disableEmbed == '0' && $video->gated == '0'): ?> <!-- EMBED CODE --> <div class="col-xs-8"> <p class="h4"><?=Language::getText('embed')?></p> <p><?=Language::getText('embed_text')?></p> <textarea class="form-control" rows="5" cols="58"><iframe src="<?=BASE_URL?>/embed/<?=$video->videoId?>/" width="480" height="360" frameborder="0" allowfullscreen></iframe></textarea> </div> <?php endif; ?> </div> </div> </div> <!-- END Share Tab --> <!-- BEGIN Add Tab --> <div class="tab-pane" id="add-to-playlist"> <h4><?=Language::getText('add_to')?></h4> <div class="panel panel-default"> <div class="panel-body"> <?php if ($loggedInUser): ?> <div class="test col-xs-12 col-sm-5"> <div class="scrollbar-outer playlist-container" > <ul> <?php $playlistService = $this->getService('Playlist'); ?> <li class="<?php echo $playlistService->checkListing($video, $favoritesList) ? 'added' : ''; ?>"> <i class="glyphicon glyphicon-ok-sign"></i> <i class="glyphicon glyphicon-plus-sign"></i> <a data-playlist_id="<?=$favoritesList->playlistId?>" href="" data-video="<?php echo $video->videoId; ?>" ><?=Language::getText('favorites')?></a> </li> <li class="<?php echo $playlistService->checkListing($video, $watchLaterList) ? 'added' : ''; ?>"> <i class="glyphicon glyphicon-ok-sign"></i> <i class="glyphicon glyphicon-plus-sign"></i> <a data-playlist_id="<?=$watchLaterList->playlistId?>" href="" data-video="<?php echo $video->videoId; ?>" ><?=Language::getText('watch_later')?></a> </li> <?php if (count($userPlaylists) > 0): ?> <li><strong><?=Language::getText('playlists')?></strong></li> <?php foreach ($userPlaylists as $userPlaylist): ?> <li class="<?php echo $playlistService->checkListing($video, $userPlaylist) ? 'added' : ''; ?>"> <i class="glyphicon glyphicon-ok-sign"></i> <i class="glyphicon glyphicon-plus-sign"></i> <a data-playlist_id="<?=$userPlaylist->playlistId?>" href="" data-video="<?php echo $video->videoId; ?>" ><?=$userPlaylist->name?> (<?=count($userPlaylist->entries)?>)</a> </li> <?php endforeach; ?> <?php endif; ?> </ul> </div> </div> <div class="col-xs-12 col-sm-5 col-sm-offset-2"> <p class="h4"><?=Language::getText('create_new_playlist')?></p> <form> <div class="form-group"> <label class="control-label"><?=Language::getText('playlist_name')?>:</label> <input class="form-control" type="text" name="playlist_name" /> </div> <div class="form-group"> <label class="control-label"><?=Language::getText('visibility')?>:</label> <select class="form-control" name="playlist_visibility"> <option value="public"><?=Language::getText('public')?></option> <option value="private"><?=Language::getText('private')?></option> </select> </div> <input type="hidden" name="action" value="create" /> <input type="hidden" name="video_id" value="<?=$video->videoId?>" /> <input class="btn btn-primary" type="submit" value="<?=Language::getText('create_playlist_button')?>" /> </form> </div> <?php else: ?> <?=Language::getText('playlist_login', array('url' => BASE_URL . '/login/?redirect=' . urlencode($this->getService('Video')->getUrl($video))))?> <?php endif; ?> </div> </div> </div> <!-- END Add Tab --> </div> <!-- END Tab Panes --> <!-- BEGIN Comments Header --> <div class="row" id="comments-header"> <h4 class="col-xs-6"> <?=Language::getText('comments_header')?> <?=($video->commentsClosed) ? '' : ' (<span class="comment-total">' . $commentCount . '</span>)'?> </h4> <?php if (!$loggedInUser && $config->enableRegistrations): ?> <p class="col-xs-6 text-right"><?=Language::getText('comments_login_register', array('login_link' => BASE_URL . '/login/?redirect=' . urlencode($this->getService('Video')->getUrl($video)), 'register_link' => BASE_URL . '/register/'))?></p> <?php elseif (!$loggedInUser && !$config->enableRegistrations): ?> <p class="col-xs-6 text-right"><?=Language::getText('comments_login', array('login_link' => BASE_URL . '/login/?redirect=' . urlencode($this->getService('Video')->getUrl($video))))?></p> <?php endif; ?> </div> <!-- END Comments Header --> <!-- BEGIN Comments Container --> <div id="comments" class="panel panel-default"> <div class="panel-body"> <?php if ($video->commentsClosed): ?> <?=Language::getText('comments_closed')?> <?php else: ?> <?php if ($loggedInUser): ?> <!-- BEGIN Comments Form --> <div class="collapsed comment-form comment-form-main row"> <form action="" method="post"> <div class="col-xs-12 collapsed-show"> <textarea class="form-control" rows="2" cols="50" name="comments" placeholder="<?=Language::getText('comments_button')?>"></textarea> </div> <div class="col-xs-12 collapsed-hide"> <textarea class="form-control" rows="4" cols="50" name="comments" placeholder="<?=Language::getText('comments')?>"></textarea> </div> <div class="col-xs-6 col-sm-3 collapsed-hide"> <a class="cancel" href=""><?=Language::getText('cancel')?></a> </div> <div class="col-xs-6 col-sm-3 col-sm-offset-6 text-right collapsed-hide"> <input type="hidden" name="videoId" value="<?=$video->videoId?>" /> <input type="hidden" name="parentCommentId" value="" /> <input class="btn btn-primary" type="submit" name="button" value="<?=Language::getText('comments_button')?>" /> </div> </form> </div> <!-- END Comments Form --> <?php endif; ?> <!-- BEGIN Comments List --> <div class="comment-list"> <?php if ($commentCount > 0): ?> <?php foreach ($commentCardList as $commentCard): ?> <?php $commentIndentClass = getCommentIndentClass($commentCard->comment); ?> <div class="media comment <?=$commentIndentClass?>" data-comment="<?=$commentCard->comment->commentId?>"> <div class="media-left"> <img class="media-object" width="60" height="60" src="<?=($commentCard->avatar) ? $commentCard->avatar : $this->options->themeUrl . '/images/avatar.gif'?>" /> </div> <div class="media-body row"> <div class="col-xs-8"> <a href="<?=getUserProfileLink($commentCard->author)?>" class="comment-author"><?=$commentCard->author->username?></a> <span class="comment-date"><?=date('m/d/Y', strtotime($commentCard->comment->dateCreated))?></span> <?php if ($commentCard->comment->parentId != 0): ?> <span class="comment-reply"><?=Language::getText('reply_to')?> <a class="comment-parent-author" href="<?=getUserProfileLink($commentCard->parentAuthor)?>"><?=$commentCard->parentAuthor->username?></a> </span> <?php endif; ?> </div> <div class="col-xs-4 comment-action text-right"> <a class="reply" href=""><?=Language::getText('reply')?></a> <a class="flag" data-type="comment" data-id="<?=$commentCard->comment->commentId?>" href=""><?=Language::getText('report_abuse')?></a> </div> <p class="col-xs-12 comment-text"><?=nl2br($commentCard->comment->comments)?></p> </div> </div> <?php endforeach; ?> <?php else: ?> <p class="no-comments"><?=Language::getText('no_comments')?></p> <?php endif; ?> </div> <!-- END Comments List --> <?php endif; ?> </div> <?php if ($commentCount > 5): ?> <div class="panel-footer text-center load-more"> <button class="btn btn-primary load-more-btn" data-total="<?php echo $commentCount; ?>" data-video="<?php echo $video->videoId; ?>" data-loading-text="<?=Language::getText('loading')?>" ><?=Language::getText('load_more')?></button> </div> <?php endif; ?> </div> <!-- END Comments Container --> </div> <!-- END PLAY LEFT --> <!-- BEGIN PLAY RIGHT --> <div class="col-md-4 play-right"> <?php $this->Block ('ad300.phtml'); ?> <!-- BEGIN RELATED VIDEOS --> <div class="related-videos"> <h4><?=Language::getText('suggestions_header')?></h4> <?php if (count($relatedVideos) > 0): ?> <div class="video-list"> <?php $videoService = $this->getService('Video'); ?> <?php foreach ($relatedVideos as $relatedVideo): ?> <div class="video video-medium media"> <div class="media-left thumbnail"> <a href="<?=$videoService->getUrl($relatedVideo)?>/" title="<?=$relatedVideo->title?>"> <span class="glyphicon glyphicon-play"></span> <img class="media-object" width="140" height="78" src="<?=$config->thumbUrl?>/<?=$relatedVideo->filename?>.jpg" /> </a> </div> <div class="media-body"> <p class="media-heading"><a href="<?=$videoService->getUrl($relatedVideo)?>/" title="<?=$relatedVideo->title?>"><?=$relatedVideo->title?></a></p> <div class="small"> <?=Language::getText('by')?>: <a href="<?=BASE_URL?>/members/<?=$relatedVideo->username?>/" title="<?=$relatedVideo->username?>"><?=$relatedVideo->username?></a> <span class="duration"><span class="glyphicon glyphicon-time"></span> <?=$relatedVideo->duration?></span> </div> </div> </div> <?php endforeach; ?> </div> <?php else: ?> <strong><?=Language::getText('no_suggestions')?></strong> <?php endif; ?> </div> <!-- END RELATED VIDEOS --> </div> <!-- END PLAY RIGHT --> </div> I'm sure I got something wrong in there. I found some course on udemy to help with my lack of knowledge. But again I really appreciate the help.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.