일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- SafeArea 커스텀
- 웹뷰 페이지 로딩
- styled component is not working
- React-Native 공부
- js 특정 위치로 이동
- slick slider 간격
- 리액트
- React Native navigation
- React-Native IOS
- 프론트앤드
- JS
- safari wiondow.open
- react
- styled component
- 퍼블리셔
- reactnative 웹뷰 페이지 로딩
- gsap 기초
- styled component 작동안함
- 타입스크립트
- rn webview page loading
- scrollIntoView scrollTo
- gsap
- react이론
- 임고미
- input 숫자입력
- react native safeArea
- styled component 작동 안될때
- RN navitate push
- React Native SafeArea Custom
- 트윈맥스 기초
Archives
- Today
- Total
개발공부 임고미
[Youtube API] player 사이즈 반응형 맞추기 본문
728x90
300x250
1. wrapper 사이즈 : 100%;
2. ifram 사이즈 : 100%;
document 사이즈 기준 100% 가 되므로, 특정 사이즈를 기준으로 맞추고 싶다면 한번 더 감싸주어야 합니다.
import React, { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import styled from 'styled-components'; import Button from '../components/Button'; import ReactPlayer from 'react-player'; // import { library } from '@fortawesome/fontawesome-svg-core' // import { faBars } from '@fortawesome/free-solid-svg-icons' // library.add(faBars); const ContentsBlock = styled.main` width: 100%; height: 100vh; `; const Video = styled.div` position:relative; height:0; width:100%; padding-bottom:56.25%; `; const VideoWrap = styled.div` width: 80vw; position: relative; top: 50%; left: 50%; transform: translate(-50%, -50%); `; const ButtonBlock = styled.section` width: 80vw; margin: 1rem auto; `; const Main = () => { const video = useSelector((state) => state.video); const videoUrl = `https://www.youtube.com/watch?v=${video.playList}`; return ( <ContentsBlock> <VideoWrap > <Video> <ReactPlayer url={videoUrl} playing loop controls width={'100%'} height={'100%'} style={{ position: 'absolute', top: 0, left: 0 }} /> </Video> </VideoWrap> <ButtonBlock> <Button text="즐겨찾기" /> </ButtonBlock> </ContentsBlock> ); }; export default Main;
728x90
300x250
'퍼블리싱 > 라이브러리' 카테고리의 다른 글
[Swiper] loop 모드일때 duplication 이 제대로 안될때 (0) | 2021.03.11 |
---|---|
[swiper] 스와이퍼 pagination 버그 (1) | 2021.03.02 |
[AOS]간단한 스크롤 모션에 좋은 라이브러리! (0) | 2020.12.31 |
[TweenMax | GSAP] 트윈맥스 - 기초5 (Timeline 사용하기) (0) | 2020.12.30 |
[TweenMax | GSAP] 트윈맥스 - 기초4 (Tween 컨트롤하기 [심화] ) (0) | 2020.12.30 |