Assembla home | Assembla project page
 

Changeset 73

Show
Ignore:
Timestamp:
06/22/07 14:26:01 (1 year ago)
Author:
digitalspaghetti
Message:

Improved YouTube? Player on site

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branch/controllers/videos_controller.php

    r72 r73  
    99        } 
    1010 
    11         function viewuser($id = null) { 
     11        function viewplaylist($id = null) { 
    1212                 
    1313                vendor('phpYoutube/phpYoutube'); 
    1414                $phpYoutube = new phpYoutube($this->dev_id); 
    1515                 
    16                 //pr($phpYoutube->videos_listbyuser($id)); 
    17                 $this->set('videos', $phpYoutube->videos_listbyuser($id)); 
     16                $results = $this->Video->read(null,$id); 
     17                $this->set('results', $results); 
     18                //pr($results); 
     19                $this->set('videos', $phpYoutube->videos_listbyplaylist($results['Video']['playlist_id'])); 
    1820        } 
    1921         
  • branch/models/video.php

    r69 r73  
    66        var $actsAs = array('CounterCache','Tag'); 
    77         
    8         var $validate = array( 
    9                 'title' => VALID_NOT_EMPTY, 
    10                 'url' => VALID_NOT_EMPTY, 
    11                 'video_location' => VALID_NOT_EMPTY, 
    12                 'video_date' => VALID_NOT_EMPTY, 
    13                 'body' => VALID_NOT_EMPTY, 
    14                 'copyright_owner' => VALID_NOT_EMPTY, 
    15                 'copyright_id' => VALID_NOT_EMPTY, 
    16                 'published' => VALID_NOT_EMPTY, 
    17                 'user_id' => VALID_NOT_EMPTY, 
    18                 'subject_id' => VALID_NOT_EMPTY, 
    19                 'tags' => VALID_NOT_EMPTY, 
    20         ); 
     8        var $validate = array(); 
    219 
    2210        //The Associations below have been created with all possible keys, those that are not needed can be removed 
    2311        var $belongsTo = array( 
    24                         'Copyright' => array('className' => 'Copyright', 
    25                                                                 'foreignKey' => 'copyright_id', 
    26                                                                 'conditions' => '', 
    27                                                                 'fields' => '', 
    28                                                                 'order' => '', 
    29                                                                 'counterCache' => ''), 
    3012                        'User' => array('className' => 'User', 
    3113                                                                'foreignKey' => 'user_id', 
  • branch/views/videos/video.ctp

    r72 r73  
    1 <object width="425" height="350"> 
    2 <param name="movie" value="http://www.youtube.com/v/<?php e($video_id);?>"></param> 
    3 <param name="wmode" value="transparent"></param> 
    4 <embed src="http://www.youtube.com/v/<?php e($video_id);?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed> 
    5 </object> 
     1<div class="video-view"> 
     2        <p align="center"> 
     3                <object width="425" height="350"> 
     4                <param name="movie" value="http://www.youtube.com/v/<?php e($video_id);?>"></param> 
     5                <param name="wmode" value="transparent"></param> 
     6                <embed src="http://www.youtube.com/v/<?php e($video_id);?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed> 
     7                </object> 
     8        </p> 
     9        <p> 
     10                <h2>Video Details</h2> 
     11                <dl class="video-details"> 
     12                        <dd>Video Title:</dd> 
     13                        <dt><?php e($video['title']);?></dt> 
     14                        <dd>Description:</dd> 
     15                        <dt><?php e($video['description']);?></dt> 
     16                        <dd>Length:</dd> 
     17                        <dt><?php if ($video['length_seconds'] > 0) { 
     18                                        $mins = floor ($video['length_seconds'] / 60); 
     19                                        $secs = $video['length_seconds'] % 60; 
     20                                                printf ("%d:%2.0f", $mins, $secs); 
     21                                        } 
     22                                ?></dt> 
     23                        <dd>Rating:</dd> 
     24                        <dt><?php e($video['rating_avg']);?></dt> 
     25                        <dd>Views:</dd> 
     26                        <dt><?php e($video['view_count']);?></dt> 
     27                </dl> 
     28 
     29        </p> 
     30</div> 
  • branch/views/videos/viewplaylist.ctp

    r72 r73  
    11<div class="video"> 
    2 <h2>View Video</h2> 
    3 Found <?php e($videos['total']);?> videos 
     2       <h2>View Video</h2> 
     3       Found <?php e($videos['total']);?> videos 
    44 
    5 <dl class="video-gallery"> 
    6         <?php foreach($videos['video'] as $video) : ?> 
    7                 <dt><a href="/videos/video/<?php e($video['id']);?>" class="thickbox" title="<?php e($video['description']);?>"><?php e($video['title']);?></a></dt> 
    8                 <dd><a href="/videos/video/<?php e($video['id']);?>" class="thickbox" title="<?php e($video['description']);?>"><img src="<?php e($video['thumbnail_url']);?>" /></a></dd> 
    9                          
    10                 <dd>Views: <?php e($video['view_count']);?></dd> 
    11  
    12                 <dd>Comments: <?php e($video['comment_count']);?></dd> 
     5        <div class="video-gallery"> 
     6                <p align="center"> 
     7                <ul> 
     8                <?php foreach($videos['video'] as $video) : ?> 
     9                        <li> 
     10                                <a href="/videos/video/<?php e($video['id']);?>" class="videolink" title="<?php e($video['description']);?>"> 
     11                                <img src="<?php e($video['thumbnail_url']);?>" /> 
     12                                </a>                     
     13                        </li> 
     14                <?php endforeach; ?> 
     15                </ul> 
     16                </p> 
     17        </div> 
     18         
     19        <div class="video-player"> 
    1320                 
    14                 <dd>Ave Rating: <?php e($video['rating_avg']);?></dd> 
    15                  
    16                 <dd>Length: <?php if ($video['length_seconds'] > 0) { 
    17                                         $mins = floor ($video['length_seconds'] / 60); 
    18                                         $secs = $video['length_seconds'] % 60; 
    19                                                 printf ("%d:%2.0f", $mins, $secs); 
    20                                         } 
    21                                 ?></dd> 
    22         <br style="clear:left;" /> 
    23         <?php endforeach; ?> 
    24 </dl> 
    25  
     21        </div> 
    2622</div> 
  • branch/webroot/css/default.css

    r72 r73  
    235235 
    236236div.video { 
    237         margin: auto 0; 
    238         width:60%; 
    239         text-align:center; 
    240 
    241  
    242 dl.video-gallery { 
    243          
    244 
    245  
    246 dl.video-gallery dt { 
    247         /*clear:left;*/ 
    248         text-align:left; 
    249 
    250  
    251 dl.video-gallery dd { 
     237        width:620px; 
     238        margin:0 auto; 
     239
     240 
     241div.video h2 { 
     242        background: url('../img/h2_top.png') repeat-x; 
     243
     244 
     245div.video-gallery { 
     246        width:160px; 
     247        height:600px; 
     248        overflow:auto;   
     249        float:right; 
     250        padding: auto auto; 
     251
     252 
     253div.video-gallery ul { 
     254        list-style:none; 
     255
     256 
     257div.video-gallery ul li { 
    252258        float:left; 
    253259        margin-right:30px; 
    254260} 
     261 
     262div.video-player { 
     263        background:#000; 
     264        border:3px solid #fff; 
     265        width:450px; 
     266        height:600px; 
     267        overflow:auto; 
     268} 
  • branch/webroot/js/webrocket.js

    r72 r73  
    5151        $j('ul.jd_menu').jdMenu(); 
    5252         
     53        $j('a.videolink').bind('click', function(){ 
     54                        $j('div.video-player').load(this.href); 
     55                        return false; 
     56        }); 
     57         
    5358        /*var options = {  
    5459        target:        '#content',   // target element(s) to be updated with server response