How to add Youtube Video in the Profile page

Dear All,

Is there a way i can add Youtube Embedded codes in the edit profile area and get shown in profile page? please help me on this.

I tried to put embedded code in the about us editor, but in the user panel it shows the same iframe code instead of showing the video.

 

Please help me on this

 

  • Atlast i found no one will answer my question, but i got some solution and this will work for some one else.

     

    The below code will give the details for the user uploaded new videos (Only video), but you can change this into any FILE format

     


    $fffww = elgg_get_entities_from_metadata(array(
    'types' => 'object',
    'subtypes' =>  array('file'),
    'metadata_name_value_pairs' => array(array('name' => 'simpletype', 'value' => 'video')),
    'owner_guids' => page_owner_entity()->guid,
    'full_view' => false,
    'view_toggle_type' => false
    ));

     

    ========================= +

     

    Please download the plugin "VeePlay Plugin" and alter their codes like this

     

    elgg_load_js('veeplay');
    // Set location variables
    $swf_url = elgg_get_site_url() . 'mod/veeplay/player/player.swf';
    $file_url = elgg_get_site_url() . 'file/download/'.$fffww[0]['guid'];
    $view_url = elgg_get_site_url() . 'file/view/'.$fffww[0]['guid'];
    // Set JW-Player options
    $skin_url = "";
    if($plugin_skin_typev = elgg_get_plugin_setting("skin_typev", "veeplay")){
    $skins_home = elgg_get_site_url() . 'mod/veeplay/player/skins/';
    switch ($plugin_skin_typev){
        case glow:
        $skin_url = $skins_home."glow/glow.xml";
            break;
        case blueratio:
        $skin_url = $skins_home."blueratio/blueratio.xml";
            break;
        case darksunset:
        $skin_url = $skins_home."darksunset/darksunset.xml";
            break;
        case grungetape:
        $skin_url = $skins_home."grungetape/grungetape.xml";
            break;
        case stijl:
        $skin_url = $skins_home."stijl/stijl.xml";
            break;
        default:// catches empty or unknown skins
        $skin_url = "";
            break;
        }
    }
    $widthv = '560';
    if($plugin_video_wd = elgg_get_plugin_setting("video_wd", "veeplay")){
        $widthv = $plugin_video_wd;
    }
    $heightv = '315';
    if($plugin_video_ht = elgg_get_plugin_setting("video_ht", "veeplay")){
        $heightv = $plugin_video_ht;
    }
    $autostartv = 'false';
    if($plugin_video_start = elgg_get_plugin_setting("video_start", "veeplay")){
        $autostartv = $plugin_video_start;
    }
    $sharing = "";
    if($plugin_med_sharing = elgg_get_plugin_setting("med_sharing", "veeplay")){
        if($plugin_med_sharing == 'on') {
        $sharing = 'sharing-3';
        }
    }
    // Go to DB and pull down filename data
    $result = mysql_query("SELECT {$CONFIG->dbprefix}metastrings.string
    FROM {$CONFIG->dbprefix}metastrings
    LEFT JOIN {$CONFIG->dbprefix}metadata
    ON {$CONFIG->dbprefix}metastrings.id = {$CONFIG->dbprefix}metadata.value_id
    LEFT JOIN {$CONFIG->dbprefix}objects_entity
    ON {$CONFIG->dbprefix}metadata.entity_guid = {$CONFIG->dbprefix}objects_entity.guid
    WHERE ({$CONFIG->dbprefix}objects_entity.guid =  '{$fffww[0]['guid']}') AND ({$CONFIG->dbprefix}metastrings.string LIKE 'file/%')");
    // Check query ran and result is populated
    if (!$result) {
    // Query failed, return to origin page with error
        register_error(elgg_echo('veeplay:dbase:runerror'));
        forward(REFERER);
    }

    // Dump results into array
    $row = mysql_fetch_array($result);
    // Filename details
    $ext = pathinfo($row['string'], PATHINFO_EXTENSION);
    $filename = substr(pathinfo($row['string'], PATHINFO_FILENAME).".". pathinfo($row['string'], PATHINFO_EXTENSION),10);
    // Full filename and path including entity guid
    // JW-Player is not happy with token names. Have to point to real name
    // to exploit player fallback features
    $entity_guid = get_input("guid");
    // Should we urlencode the filename?
    $pathfile = $file_url."/".$filename;
    if($plugin_encode = elgg_get_plugin_setting("encode", "veeplay")){
        if($plugin_encode == 'urlencode') {
            $pathfile = $file_url."/".urlencode($filename);
        }
        elseif($plugin_encode == 'rawurlencode') {
            $pathfile = $file_url."/".rawurlencode($filename);
        }
        else  {
            $pathfile = $file_url."/".$filename;
        }
    }
    ?>
    <!-- Place holder for JWPlayer-->
    <?php if(isset($fffww[0]))
    {
    ?>
    <!-- Place holder for JWPlayer-->
    <br />
    <div class="odd">
    <b>Latest Video</b>
    <div class="skin">
        <div name="mediaspace" id="mediaspace">
            <div class="VideoPlayer">
                <video
                    id="mediaplayer01"
                    height="<?php echo $heightv; ?>"
                    width="<?php echo $widthv; ?>">
                    <source src="<?php echo $pathfile;?>" />
                </video>
            </div>
    <!-- Set options for JWPlayer -->
        <script type="text/javascript">
            jwplayer("mediaplayer01").setup({
                flashplayer: '<?php echo $swf_url; ?>',
                skin: '<?php echo $skin_url; ?>',
                autoplay:'<?php echo $autostartv;?>',
                plugins: {"<?php echo $sharing; ?>": {
                    link: "<?php echo $view_url;?>"
                    }  
                },
                controlbar: 'bottom'
            });
        </script>
        </div><!-- mediaspace -->
    </div><!-- skin -->
    </div>
    <? } ?>

     

    ...... So this way we can show the latest video of a user in his profile page.

     

     

  • There is an old widget I am currently re editing that will allow you to add youtube videos.

    I have been using elgg for awhile but now just started intrest in creating widgets.  So looking at the older widgets helps me in more in knowing how to start.

    Here is a snapshot of a site I program and host for somebody.  you will see the youtube video on the profile page.

    image

  • I hope i am not violating any rules posting that snapshot, If i am please remove it and let me know.

  • I am not done working on updating the widget as of yet.
    I want to make sure I get it done correctly.

    But you can get the original widget here at this url.  it allows you to add a custom html widget into your site for profiles. 

     http://community.elgg.org/plugins/835108/1.0/customizable-html-widget-for-elgg-18

    It was created by Mistress RavenGoth

  • i meant embeding it as a widget in the profile page

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking