PC 플로팅 구현
PC 내에서 소스플렉스 플레이어를 플로팅하여 보여주도록 구현하기 위한 가이드 입니다.
Sample Code
<style>
.jw-svg-icon-rewind {
display: none;
}
.jw-icon-fullscreen {
display: none !important;
}
.jw-icon.jw-icon-inline.jw-button-color.jw-reset.jw-icon-pip {
display: none !important;
}
</style>
<div id="player"></div>
<script src="https://cdn.jwplayer.com/libraries/ItMW7Ep3.js"></script>
<script>
var gh = 320;
var gw = 180;
var playerInstance = jwplayer("player").setup({
"file": "https://dl27gtzv7mq2q.cloudfront.net/streams/20220531/lklg-uplus-deb4a3a8178148298d9e0e0fe2b4636a/6380bc9a6cb44df283e86d7d8c156acf_VOD.m3u8",
"height": gh,
"width": gw,
"autostart": "true",
"floating": { "dismissible": true }
});
console.log(playerInstance.getConfig());
playerInstance.on('ready', function(ev) {
console.log('ready');
document.getElementById(playerInstance.id).style.height = 0;
document.getElementById(playerInstance.id).style.width = 0;
playerInstance.setFloating("true");
console.log(playerInstance.getConfig());
});
playerInstance.on('fullscreen', function(ev) {
console.log('fullscreen');
if(ev.fullscreen)
{
jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style.maxHeight = screen.height;
jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style.height = screen.height;
jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style.maxWidth = screen.width;
jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style.width = screen.width;
pastTransform = jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style.transform;
jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style.transform = '';
console.log(jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style);
}
else
{
jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style.maxHeight = gh;
jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style.height = gh;
jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style.maxWidth = gw;
jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style.width = gw;
jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style.transform = pastTransform;
console.log(jwplayer().getContainer().getElementsByClassName('jw-wrapper')[0].style);
}
console.log(ev);
});
</script>
<h1>One morning, when Gregor Samsa woke from troubled
dreams.</h1>
<p>One morning, when Gregor Samsa woke from troubled
dreams, he found himself transformed in his bed into
a horrible vermin. He lay on his armour-like back,
and if he lifted his head a little he could see his
brown belly, slightly domed and divided by arches into
stiff sections. The bedding was hardly able to cover
<strong>strong</strong> it and seemed ready to slide
off any moment. His many legs, pitifully thin
compared with the size of the rest of him,
<a class="external ext" href="#">link</a> waved about
helplessly as he looked. "What's happened to me? " he
thought. It wasn't a dream. His room, a proper human
room although a little too small, lay peacefully
between its four familiar walls.</p>
<h1>One morning, when Gregor Samsa woke from troubled
dreams.</h1>
<h2>The bedding was hardly able to cover it.</h2>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<h2>The bedding was hardly able to cover it.</h2>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<ul>
<li>Lorem ipsum dolor sit amet consectetuer.</li>
<li>Aenean commodo ligula eget dolor.</li>
<li>Aenean massa cum sociis natoque penatibus.</li>
</ul>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<form action="#" method="post">
<fieldset>
<label for="name">Name:</label>
<input type="text" id="name" placeholder="Enter your
full name" />
<label for="email">Email:</label>
<input type="email" id="email" placeholder="Enter
your email address" />
<label for="message">Message:</label>
<textarea id="message" placeholder="What's on your
mind?"></textarea>
<input type="submit" value="Send message" />
</fieldset>
</form>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<table class="data">
<tr>
<th>Entry Header 1</th>
<th>Entry Header 2</th>
<th>Entry Header 3</th>
<th>Entry Header 4</th>
</tr>
<tr>
<td>Entry First Line 1</td>
<td>Entry First Line 2</td>
<td>Entry First Line 3</td>
<td>Entry First Line 4</td>
</tr>
<tr>
<td>Entry Line 1</td>
<td>Entry Line 2</td>
<td>Entry Line 3</td>
<td>Entry Line 4</td>
</tr>
<tr>
<td>Entry Last Line 1</td>
<td>Entry Last Line 2</td>
<td>Entry Last Line 3</td>
<td>Entry Last Line 4</td>
</tr>
</table>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<h1>One morning, when Gregor Samsa woke from troubled
dreams.</h1>
<p>One morning, when Gregor Samsa woke from troubled
dreams, he found himself transformed in his bed into
a horrible vermin. He lay on his armour-like back,
and if he lifted his head a little he could see his
brown belly, slightly domed and divided by arches into
stiff sections. The bedding was hardly able to cover
<strong>strong</strong> it and seemed ready to slide
off any moment. His many legs, pitifully thin
compared with the size of the rest of him,
<a class="external ext" href="#">link</a> waved about
helplessly as he looked. "What's happened to me? " he
thought. It wasn't a dream. His room, a proper human
room although a little too small, lay peacefully
between its four familiar walls.</p>
<h1>One morning, when Gregor Samsa woke from troubled
dreams.</h1>
<h2>The bedding was hardly able to cover it.</h2>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<h2>The bedding was hardly able to cover it.</h2>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<ul>
<li>Lorem ipsum dolor sit amet consectetuer.</li>
<li>Aenean commodo ligula eget dolor.</li>
<li>Aenean massa cum sociis natoque penatibus.</li>
</ul>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<form action="#" method="post">
<fieldset>
<label for="name">Name:</label>
<input type="text" id="name" placeholder="Enter your
full name" />
<label for="email">Email:</label>
<input type="email" id="email" placeholder="Enter
your email address" />
<label for="message">Message:</label>
<textarea id="message" placeholder="What's on your
mind?"></textarea>
<input type="submit" value="Send message" />
</fieldset>
</form>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<table class="data">
<tr>
<th>Entry Header 1</th>
<th>Entry Header 2</th>
<th>Entry Header 3</th>
<th>Entry Header 4</th>
</tr>
<tr>
<td>Entry First Line 1</td>
<td>Entry First Line 2</td>
<td>Entry First Line 3</td>
<td>Entry First Line 4</td>
</tr>
<tr>
<td>Entry Line 1</td>
<td>Entry Line 2</td>
<td>Entry Line 3</td>
<td>Entry Line 4</td>
</tr>
<tr>
<td>Entry Last Line 1</td>
<td>Entry Last Line 2</td>
<td>Entry Last Line 3</td>
<td>Entry Last Line 4</td>
</tr>
</table>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<h1>One morning, when Gregor Samsa woke from troubled
dreams.</h1>
<p>One morning, when Gregor Samsa woke from troubled
dreams, he found himself transformed in his bed into
a horrible vermin. He lay on his armour-like back,
and if he lifted his head a little he could see his
brown belly, slightly domed and divided by arches into
stiff sections. The bedding was hardly able to cover
<strong>strong</strong> it and seemed ready to slide
off any moment. His many legs, pitifully thin
compared with the size of the rest of him,
<a class="external ext" href="#">link</a> waved about
helplessly as he looked. "What's happened to me? " he
thought. It wasn't a dream. His room, a proper human
room although a little too small, lay peacefully
between its four familiar walls.</p>
<h1>One morning, when Gregor Samsa woke from troubled
dreams.</h1>
<h2>The bedding was hardly able to cover it.</h2>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<h2>The bedding was hardly able to cover it.</h2>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<ul>
<li>Lorem ipsum dolor sit amet consectetuer.</li>
<li>Aenean commodo ligula eget dolor.</li>
<li>Aenean massa cum sociis natoque penatibus.</li>
</ul>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<form action="#" method="post">
<fieldset>
<label for="name">Name:</label>
<input type="text" id="name" placeholder="Enter your
full name" />
<label for="email">Email:</label>
<input type="email" id="email" placeholder="Enter
your email address" />
<label for="message">Message:</label>
<textarea id="message" placeholder="What's on your
mind?"></textarea>
<input type="submit" value="Send message" />
</fieldset>
</form>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
<table class="data">
<tr>
<th>Entry Header 1</th>
<th>Entry Header 2</th>
<th>Entry Header 3</th>
<th>Entry Header 4</th>
</tr>
<tr>
<td>Entry First Line 1</td>
<td>Entry First Line 2</td>
<td>Entry First Line 3</td>
<td>Entry First Line 4</td>
</tr>
<tr>
<td>Entry Line 1</td>
<td>Entry Line 2</td>
<td>Entry Line 3</td>
<td>Entry Line 4</td>
</tr>
<tr>
<td>Entry Last Line 1</td>
<td>Entry Last Line 2</td>
<td>Entry Last Line 3</td>
<td>Entry Last Line 4</td>
</tr>
</table>
<p>It showed a lady fitted out with a fur hat and fur
boa who sat upright, raising a heavy fur muff that
covered the whole of her lower arm towards the
viewer.</p>
샘플에서 알 수 있듯이 file 이라는 곳에 m3u8 파일을 설정해 주시면 됩니다.
file 에 설정해야할 영상은 특정 방송 조회 API를 활용하여 응답값을 확인하시면 아래처럼 회신될 것이며 이 중 path 의 값을 활용하시면 될것 같습니다.
특정 방송 조회 API 를 활용하셔서 재생 할 영상의 정보를 얻으면 됩니다.
API 조회를 위해서는 해당 문서 특정 방송 조회 API 를 참조해주세요. (고객사 정보는 모비두 담당자가 전달한 정보를 사용합니다.)
해당 URL 의 API 조회를 통해 broadcastId 를 확인해도 되며, 상품 클릭 시 또는 배너 클릭 시 broadcastId 값을 필요로 하는 경우 모비두 담당자에게 요청해주세요.
"outputInfo":[
{
"preview":"https://dl27gtzv7mq2q.cloudfront.net/streams/20220602/lklg-uplus-70c3f72a95a94bbc91abf654d2989961/f1b81fa91bf44af9ba309cbf811dbd26_preview_VOD.mp4",
"bucketName":"sauceflex-streams",
"cloudFront":"dl27gtzv7mq2q.cloudfront.net",
"path":"https://dl27gtzv7mq2q.cloudfront.net/streams/20220602/lklg-uplus-70c3f72a95a94bbc91abf654d2989961/f1b81fa91bf44af9ba309cbf811dbd26_VOD.m3u8",
"downloadUrl":"https://dl27gtzv7mq2q.cloudfront.net/streams/20220602/lklg-uplus-70c3f72a95a94bbc91abf654d2989961/f1b81fa91bf44af9ba309cbf811dbd26_orignal.000000.m2ts",
"type":"aws",
"keyPrefix":"streams/20220602/lklg-uplus-70c3f72a95a94bbc91abf654d2989961",
"key":"streams/20220602/lklg-uplus-70c3f72a95a94bbc91abf654d2989961/f1b81fa91bf44af9ba309cbf811dbd26_VOD.m3u8"
}
],
Updated about 1 month ago