Skip to content

Commit

Permalink
Added allowFullScreen prop to video content iframes (#2399)
Browse files Browse the repository at this point in the history
* Added fullscreen to video iframes

* Update CHANGELOG.md

Co-Authored-By: William Wong <compulim@users.noreply.github.com>
  • Loading branch information
tdurnford and compulim authored Sep 13, 2019
1 parent 9282174 commit 39a52cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added `timestampFormat` option to the default style options and created `AbsoluteTime` component, by [@tdurnford](https://github.com/tdurnford), in PR [#2295](https://github.com/microsoft/BotFramework-WebChat/pull/2295)
- `embed`: Added ES5 polyfills and dev server, by [@compulim](https://github.com/compulim), in PR [#2315](https://github.com/microsoft/BotFramework-WebChat/pull/2315)
- Fix [#2380](https://github.com/microsoft/BotFramework-WebChat/issues/2380). Added `botAvatarBackgroundColor` and `userAvatarBackgroundColor` to the default style options, by [@tdurnford](https://github.com/tdurnford) in PR [#2384](https://github.com/microsoft/BotFramework-WebChat/pull/2384)
- Added full screen capability to `IFRAME` in the `YouTubeContent` and `VimeoContent` components by [@tdurnford](https://github.com/tdurnford) in PR [#2399](https://github.com/microsoft/BotFramework-WebChat/pull/2399)

### Samples

Expand Down
5 changes: 3 additions & 2 deletions packages/component/src/Attachment/VimeoContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';

import connectToWebChat from '../connectToWebChat';

const VimeoContent = ({ alt, autoPlay, embedID, loop, styleSet }) => {
const VimeoContent = ({ alt, autoPlay, embedID, loop, styleSet: { vimeoContent } }) => {
const search = new URLSearchParams({
autoplay: autoPlay ? 1 : 0,
badge: 0,
Expand All @@ -15,8 +15,9 @@ const VimeoContent = ({ alt, autoPlay, embedID, loop, styleSet }) => {

return (
<iframe
allowFullScreen={true}
aria-label={alt}
className={styleSet.vimeoContent}
className={vimeoContent}
src={`https://player.vimeo.com/video/${encodeURI(embedID)}?${search}`}
/>
);
Expand Down
5 changes: 3 additions & 2 deletions packages/component/src/Attachment/YouTubeContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';

import connectToWebChat from '../connectToWebChat';

const YouTubeContent = ({ alt, autoPlay, embedID, loop, styleSet }) => {
const YouTubeContent = ({ alt, autoPlay, embedID, loop, styleSet: { youTubeContent } }) => {
const search = new URLSearchParams({
autoplay: autoPlay ? 1 : 0,
loop: loop ? 1 : 0,
Expand All @@ -13,8 +13,9 @@ const YouTubeContent = ({ alt, autoPlay, embedID, loop, styleSet }) => {
return (
// TODO: We should encodeURI the URL
<iframe
allowFullScreen={true}
aria-label={alt}
className={styleSet.youTubeContent}
className={youTubeContent}
src={`https://youtube.com/embed/${embedID}?${search}`}
/>
);
Expand Down

0 comments on commit 39a52cf

Please sign in to comment.