Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/31/2016 07:40:36 AM (10 years ago)
Author:
r-a-y
Message:

Activity: Introduce media into embed template.

This commit displays media from an activity item into the embed template.

Specifically, if an activity item contains an oEmbed item from a
WordPress whitelisted oEmbed provider and that oEmbed item contains a
thumbnail, we will display that thumbnail along with a caption. One thing
to note is we only display the first oEmbed item to prevent cluttering up
the embed template.

If an oEmbed item isn't found, we will attempt to find the first inline
video or audio item. If such an item is found, we will embed that item
using the browser's native HTML5 player.

Props r-a-y, imath.

See #6772.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress/assets/embeds/css-activity.php

    r10838 r10839  
    5555        font-size: .9em;
    5656}
     57
     58video {
     59        width: 100%;
     60        height: auto;
     61}
     62
     63.bp-activity-embed-display-media {
     64        border: 1px solid #ccc;
     65        border-radius: 6px;
     66}
     67
     68.bp-activity-embed-display-media.one-col,
     69.bp-activity-embed-display-media.one-col .thumb,
     70.bp-activity-embed-display-media.one-col .thumb img {
     71        width: 100%;
     72}
     73
     74.bp-activity-embed-display-media.two-col .thumb,
     75.bp-activity-embed-display-media.two-col .caption {
     76        display: table-cell;
     77}
     78
     79.bp-activity-embed-display-media.two-col .thumb {
     80        background: #000;
     81        vertical-align: middle;
     82}
     83
     84.bp-activity-embed-display-media.two-col .caption {
     85        vertical-align: top;
     86}
     87
     88.bp-activity-embed-display-media.two-col .thumb img {
     89        border-right: 1px solid #ccc;
     90        display: block;
     91        width: 100%;
     92}
     93
     94.bp-activity-embed-display-media .thumb {
     95        position: relative;
     96}
     97
     98.bp-activity-embed-display-media .caption {
     99        padding: .2em .5em .5em .5em;
     100}
     101
     102a.play-btn {
     103        background: rgba(0, 0, 0, 0.75);
     104        border-radius: 50%;
     105        height: 50px;
     106        left: 50%;
     107        margin: 0;
     108        padding: 1em;
     109        position: absolute;
     110        text-indent: 0.25em;
     111        top: 50%;
     112        transform: translateY(-50%) translateX(-50%);
     113        -webkit-transform: translateY(-50%) translateX(-50%);
     114        transition: all 0.2s ease-out;
     115        width: 50px;
     116}
     117
     118.bp-activity-embed-display-media.two-col a.play-btn {
     119        height: 35px;
     120        width: 35px;
     121}
     122
     123a.play-btn:hover {
     124        background: rgba(0, 0, 0, 0.95);
     125        transform: translateY(-50%) translateX(-50%) scale(1.05);
     126        -webkit-transform: translateY(-50%) translateX(-50%) scale(1.05);
     127        transition: all 0.2s ease-out;
     128}
     129
     130.bp-activity-embed-display-media .thumb svg {
     131        fill: #fff;
     132        overflow: hidden;
     133}
     134
     135.bp-activity-embed-display-media .caption-description {
     136        font-size: 90%;
     137        margin: .4em 0;
     138}
     139
     140@media only screen and (max-width: 480px) {
     141        .bp-activity-embed-display-media.two-col .thumb {
     142                border-bottom: 1px solid #ccc;
     143                border-right: 0;
     144                display: block;
     145                max-width: none !important;
     146        }
     147
     148        a.play-btn {
     149                height: 35px;
     150                width: 35px;
     151        }
     152}
Note: See TracChangeset for help on using the changeset viewer.