Author Topic: Livestreaming  (Read 1297 times)

OmarBarnabas

  • Newbie
  • *
  • Posts: 2
Livestreaming
« on: June 07, 2011, 03:50:54 AM »
This  is a mod for livestreaming on phpmotion V2. It would work just the same on V3 with small adaptation of course. But here is what it is.
First you are going to open an account on livestream.com and upload some videos to your account and you will be able also to do direct live streaming once you are set up with them.
You will create a channel name.
And then you will go to https://secure.livestream.com/myaccount/channels
Then on that same account you will have to create an API key
Wich looks like devkey=xR7p8N7iFU6wveertyeq1uwuDPM98WS4DLDfdoijhdgLDAlnpTPFVe0JvYpJLRgjd3x1Vi-UXuY-nPzjTZavEfdjmxq34PGslzMYOqxQKBg
And the name of your channel; yourchannel
1-You are going to add some files to your script which are original files that have been changed to fit our purpose:
make a copy of index.php and rename it indexlive.php
make a copy of inner_play.htm and rename it inner_replay
A)   Open indexlive.php in your favorite editor and find

Quote
//what to display when user logged in
if ($_SESSION["user_id"] != ""){
$template = "templates/main_1.htm";
$inner_template1 = "templates/inner_index.htm";//middle of page

Replace with
Quote
//what to display when user logged in
if ($_SESSION["user_id"] != ""){
$template = "templates/main_1.htm";
$inner_template1 = "templates/inner_replay.htm";//middle of page
Same with
Quote
//what to display when not logged - and remove such things as login box
$show_login_box = 1;   
$template = "templates/main_1.htm";
$inner_template1 = "templates/inner_index.htm";//middle of page
Replace with
Quote
//what to display when not logged - and remove such things as login box
$show_login_box = 1;   
$template = "templates/main_1.htm";
$inner_template1 = " templates/inner_replay.htm ";//middle of page
B)   Open inner_replay in your favorite editor and replace the script between these two limits 
<!--start of flv player-->
<!-- end of flv player -->

Replace with
Quote
<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" style="width: 550px; height: 345px">
<param name="movie" value="[var.base_url] /player.swf" />
 <param name="allowfullscreen" value="true" />
 <param name="allowscriptaccess" value="always" />
<param name="flashvars" value="file=NAMEOFYOURCHANNEL&type=livestream&livestream.devkey=HEREYOURDEVKEY&amp;logo=[var.base_url] /image_s/playerlogo.png&amp;skin=[var.base_url] /silverywhite.swf&autostart=true " />
 </object>
PS:Change the name of the skin to fit your needs.
Now we need to create a link from the top menu to that Live Stream page .
Open main_1.htm and look for
Quote
<div class="Menu_Container">
    <!-- main menu -->
    <div class="MenuButtons_main">
    <ul>
      <li><a href="index.php">Home[/url]</li>
Below
Quote
      <li><a href="index.php">Home[/url]</li>
Add
Quote
<li><a href="index.php">Our TV[/url]</li>

I f you like Alternativly  instead of using inner_play.htm  you can use inner_index.htm to have the “OurTv” page look like the Index page .In inner_index.htm look for.
Quote
  <!-- start of now showing -->
  <div id="IndexNowShowing">
           <object type="application/x-shockwave-flash" data="watchingnow.swf?x=watchingnow.php&t=Videos being watched right now..." width="550" height="115" align="top">
       <param name="allowScriptAccess" value="sameDomain">
       <param name="movie" value="watchingnow.swf?x=watchingnow.php&t=Videos being watched right now...">
       <param name="quality" value="high">
       <param name="bgcolor" value="">
     </object>
  </div>
  <!--end of now showing -->
  <div id="IndexRecentlyAdded_title" class="font4_14"> &nbsp;&nbsp;Recently Added Videos</div>
  <!-- Start of Carousel -->
  <div id="mycarousel" class="carousel-component">
    <div class="carousel-prev"> <img id="prev-arrow" class="left-button-image"
            src="carousel_files/images/left-enabled.gif" alt="Previous"/> </div>
    <div class="carousel-next"> <img id="next-arrow" class="right-button-image"
            src="carousel_files/images/right-enabled.gif" alt="Next Button"/> </div>
    <div class="carousel-clip-region">
      <ul class="carousel-list">
        <li id="mycarousel-item-1"><a href="[var.base_url]/play.php?vid=[mp.indexer]"><img width="116" height="90" src="[var.base_url]/uploads/thumbs/[mp.video_id;block=li].jpg" alt="[mp.title:block=td]"/>[/url]
          <!--[mp.title;block=div;ope=max:15;comm]-->
         

          <!--[mp.date_uploaded;block=div;comm]-->
         

        </li>
      </ul>
    </div>
  </div>
  <!-- End of Carousel -->
And replace it with
Quote
<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" style="width: 550px; height: 345px">
<param name="movie" value="[var.base_url] /player.swf" />
 <param name="allowfullscreen" value="true" />
 <param name="allowscriptaccess" value="always" />
<param name="flashvars" value="file=NAMEOFYOURCHANNEL&type=livestream&livestream.devkey=HEREYOURDEVKEY&amp;logo=[var.base_url] /image_s/playerlogo.png&amp;skin=[var.base_url] /silverywhite.swf&autostart=true " />
 </object>
Upload all those files to your site using ftp
indexlive.php in the root folder (if your phpmotion script is in the root folder)
And inner_replay.htm and main_1.htm to the templates folder.
You are done .

seo5000

  • Full Member
  • ***
  • Posts: 464
Re: Livestreaming
« Reply #1 on: June 08, 2011, 12:36:38 AM »
Looks pretty good but do you have a demo?

But,

If you are merely putting a Livestream player on the homepage, couldn't you just embed it?

OmarBarnabas

  • Newbie
  • *
  • Posts: 2
Re: Livestreaming
« Reply #2 on: June 09, 2011, 06:02:10 AM »
To Seo5000 .Well the difference with embeding the Livestream player and this is that you wil have the same player with the same skin you are using with the rest of your site, and you will be able to display your logo as well.

seo5000

  • Full Member
  • ***
  • Posts: 464
Re: Livestreaming
« Reply #3 on: June 10, 2011, 01:41:54 PM »
To Seo5000 .Well the difference with embeding the Livestream player and this is that you wil have the same player with the same skin you are using with the rest of your site, and you will be able to display your logo as well.

Thats pretty cool. I will have to give it a test try.