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
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
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
Hiren Patel.
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>
<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
Hiren Patel.
You can integrate this player on any server that is installed PHPmotion or need some special requirement
ReplyDeletehi,
ReplyDeletewelcome 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
Hi Hiren: this player has rectricciones or commercial use is free?
ReplyDeletehi
ReplyDeletewelcome 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
Hi Hiren
ReplyDeleteSome example to add playlist there ?
Thanks in advance
Hi,
ReplyDeleteI will post blog about that for sure.
thanks for the interest .
Good Day,
Hiren Patel
Thanks for sharing this informative content with us. We are working on html5 video player . It is really helpful for me and I get my lots of solution.
ReplyDelete