Skip to content

Commit

Permalink
v1.1.4
Browse files Browse the repository at this point in the history
- Updated to allow better support for sites which don't quite meet the oEmbed format requirements.
  • Loading branch information
reganlawton committed Apr 4, 2019
1 parent 9a142fb commit 30e6609
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# oEmbed Changelog

``
## 1.1.4 - 2019-04-04

### Updated
- Updated to allow better support for sites which don't quite meet the oEmbed format requirements.

## 1.1.3 - 2019-03-29

### Added
- Added `valid` method to handle errors gracefully (Thanks @iparr).
- Added data caching for parsed URLs to help increase page response time.

### Updated
- Updated docs.

## 1.1.2 - 2019-02-18
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "wrav/oembed",
"description": "A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.",
"type": "craft-plugin",
"version": "1.1.3",
"version": "1.1.4",
"keywords": [
"craft",
"cms",
Expand Down
Empty file modified releases.json
100755 → 100644
Empty file.
4 changes: 4 additions & 0 deletions src/services/OembedService.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public function embed($url, array $options = [])

/** @var Adapter $media */
$media = Embed::create($url, $options);

if (!empty($media) && !isset($media->code)) {
$media->code = "<iframe src='$url' width='100%' frameborder='0' scrolling='no'></iframe>";
}
} finally {
if (!empty($media)) {
Craft::$app->cache->set($url, $media, 'P1H');
Expand Down

0 comments on commit 30e6609

Please sign in to comment.