mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
Merge branch 'AD-641-double-check-embed-for-audio-and-video'
This commit is contained in:
commit
baf90dd834
@ -12,6 +12,11 @@ import CollapsibleButton from './../ascribe_collapsible/collapsible_button';
|
|||||||
import AclProxy from '../acl_proxy';
|
import AclProxy from '../acl_proxy';
|
||||||
|
|
||||||
|
|
||||||
|
const EMBED_IFRAME_HEIGHT = {
|
||||||
|
video: 315,
|
||||||
|
audio: 62
|
||||||
|
};
|
||||||
|
|
||||||
let MediaContainer = React.createClass({
|
let MediaContainer = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
content: React.PropTypes.object
|
content: React.PropTypes.object
|
||||||
@ -29,7 +34,9 @@ let MediaContainer = React.createClass({
|
|||||||
extraData = this.props.content.digital_work.encoding_urls.map(e => { return { url: e.url, type: e.label }; });
|
extraData = this.props.content.digital_work.encoding_urls.map(e => { return { url: e.url, type: e.label }; });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (['video', 'audio'].indexOf(mimetype) > -1){
|
if (['video', 'audio'].indexOf(mimetype) > -1) {
|
||||||
|
let height = EMBED_IFRAME_HEIGHT[mimetype];
|
||||||
|
|
||||||
embed = (
|
embed = (
|
||||||
<CollapsibleButton
|
<CollapsibleButton
|
||||||
button={
|
button={
|
||||||
@ -39,7 +46,7 @@ let MediaContainer = React.createClass({
|
|||||||
}
|
}
|
||||||
panel={
|
panel={
|
||||||
<pre className="">
|
<pre className="">
|
||||||
{'<iframe width="560" height="315" src="http://embed.ascribe.io/content/'
|
{'<iframe width="560" height="' + height + '" src="http://embed.ascribe.io/content/'
|
||||||
+ this.props.content.bitcoin_id + '" frameborder="0" allowfullscreen></iframe>'}
|
+ this.props.content.bitcoin_id + '" frameborder="0" allowfullscreen></iframe>'}
|
||||||
</pre>
|
</pre>
|
||||||
}/>
|
}/>
|
||||||
|
Loading…
Reference in New Issue
Block a user