4 Sep 2013

Published 10:12 by with 6 comments

PHPMOTION VIDEOJS PLAYER INTEGRATION

videojs is the open source HTML5 video player. today we are going to see how videojs player can be integrated with phpmotion video script. some popular sites using videojs are http://twitpic.com/ , http://telly.com/ , http://vine.co/ , http://www.theonion.com/ ,http://web.mit.edu/  , https://www.airbnb.com/?cdn_locale_redirect=1

phpmotion videojs player integration tutorial by renruhak.org




you may follow below steps for videojs player integration with phpmotion.

step 01. open themes/default/main_1.htm
find </head> and add the below code before </head> tag


<link href="http://vjs.zencdn.net/4.1/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/4.1/video.js"></script>


step 02. open index.php
find the below code


$browse_videos = array();

if ( $featured_display == 'random' )
$sql = "SELECT indexer, video_id, type, title, title_seo, date_uploaded, user_id, video_length, featured, approved, public_private, number_of_views FROM videos WHERE featured = 'yes' AND approved='yes' AND public_private = 'public' ORDER BY RAND() DESC LIMIT 1";//$sql = "SELECT indexer, video_id, type, title, title_seo, date_uploaded, user_id, video_length, featured, approved, public_private, number_of_views FROM videos WHERE featured = 'yes' AND approved='yes' AND public_private = 'public' ORDER BY RAND() DESC LIMIT $limit";
else
$sql = "SELECT indexer, video_id, type, title, title_seo, date_uploaded, user_id, video_length, featured, approved, public_private, number_of_views FROM videos WHERE featured = 'yes' AND approved='yes' AND public_private = 'public' ORDER BY indexer DESC LIMIT $limit";

$query = @mysql_query($sql);

while ($result_videos = @mysql_fetch_array($query)) {

echo " in while loop";

$change_date = dateTimeDiff($result_videos['date_uploaded']);
$result_videos['date_uploaded'] = $change_date;
$uploaded_by = mysql_real_escape_string($result_videos['user_id']);
$video_length = mysql_real_escape_string($result_videos['video_length']);
$video_id = mysql_real_escape_string($result_videos['indexer']);


and add code below


 $my_video_id = $result_videos['video_id'];
 $extension = $result_videos['type'];


step 03. themes/default/inner_index.htm
find <div id="index-player-container"> and remove code in it upto closing of it i meant
remove content in between  <div id="index-player-container">  and </div>
and add the below code


<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="710" height="350"
      poster="[var.base_url]/uploads/thumbs/[var.my_video_id].jpg"
      data-setup="{}">
    <source src="[var.base_url]/uploads/[var.my_video_id].[var.extension]" type='video/flv' />
    <!-- Tracks need an ending tag thanks to IE9 -->
   </video>


you may apply similar steps for adding videojs player at video play page.

good day
    email this       edit

6 comments:

  1. You can integrate this player on any server that is installed PHPmotion or need some special requirement

    ReplyDelete
  2. hi,
    welcome to my blog,
    yes its possible to integrate this player on any server that is installed PHPMotion. no any other special requirements.

    good day,
    Hiren Patel

    ReplyDelete
  3. Hi Hiren: this player has rectricciones or commercial use is free?

    ReplyDelete
  4. hi
    welcome to blog,
    sorry i am not sure regarding the commercial use of this player but you may confirm the details from https://github.com/videojs/video.js/blob/master/LICENSE

    Good Day,
    Hiren Patel

    ReplyDelete
  5. Hi Hiren
    Some example to add playlist there ?
    Thanks in advance

    ReplyDelete
  6. Hi,
    I will post blog about that for sure.
    thanks for the interest .

    Good Day,
    Hiren Patel

    ReplyDelete

Hi, Thanks for the comment will try to reply at the earliest.

Good Day,
Hiren Patel
http://www.renruhak.org