Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added allowFullScreen prop to video content iframes #2399

Merged
merged 2 commits into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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