yahoo-x-bv-player
v1.0.43
Published
yahoo-x-bv-player is a video player web component which based on BlendVision Web SDK. It has not only LIVE but also REPLAY features for Yahoo Auction. Sellers could display their products through this player and interact with buyers. We believe this could
Downloads
2,103
Maintainers
Readme
yahoo-x-bv-player
yahoo-x-bv-player is a video player web component which based on BlendVision Web SDK. It has not only LIVE but also REPLAY features for Yahoo Auction. Sellers could display their products through this player and interact with buyers. We believe this could help them increase commerce conversion rate.
Basic Usage
<yahoo-x-bv-player /> is a web component. All we need to do is put the required script into your HTML document. Then follow <yahoo-x-bv-player />'s html structure and everything will be all set.
- Required Script
<script
type="module"
src="https://unpkg.com/yahoo-x-bv-player/mjs/wc-yahoo-x-bv-player.js">
</script>
- Structure
Put <yahoo-x-bv-player /> into HTML document. It will have different functions and looks with attribute mutation.
<yahoo-x-bv-player>
<script type="application/json">
{
"type": "live",
"playerconfig": {
"licenseKey": "<your-BlendVision-player-license>",
"playbackToken": "<playbackToken>",
"title": "Yahoo Auction",
"source": [
{
"type": "video/mp4",
"src": "https://your-domain/video-source.mp4"
}
],
"modulesConfig": {
"analytics.resourceId": "<live-id>",
"analytics.resourceType": "RESOURCE_TYPE_LIVE_EVENT"
}
},
"chatroomconfig": {
"token": "your.BV.chatroom.token",
"refreshToken": "your.BV.chatroom.refreshToken",
"host": "https://api.one.blendvision.com"
},
"ysocket": {
"id": "<your-yahoo-web-socket-id>",
"url": "<your-yahoo-web-socket-url>"
},
"share": {
"title": "Yahoo X BlendVision",
"text": "This is a Yahoo X BlendVision video player.",
"url": "https://your-domain/share.html"
},
"poster": "https://your-domain/poster.jpg",
"loop": false,
"autopilot": false,
"host": {
"avatar": "https://your-domain/host-avatar.png",
"name": "host name",
"link": "https://your-domain/host",
"count": 999,
"announce": "content which host like to announce",
"follow": false
},
"l10n": {
"previewtrigger": "View",
"listingshead": "Products",
"buynow": "BUY NOW",
"jointhecrowd": "joined the crowd.",
"rushbuying": "is rush buying.",
"addfavorite": "added host as favorite.",
"sharelive": "shared this LIVE.",
"takesnapshot": "took snapshot.",
"achievetrophy": "achieved {{hits}} likes."
},
"messagetemplate": [
"👍",
"+1",
"被燒🔥",
"尺寸?",
"材質?",
"多少錢?"
],
"products": [
{
"id": "A1234567890",
"uuid": "334c6ea9-244e-4a6c-b320-d3506b4d6d91",
"title": "product title",
"link": "https://your-domain/product.html",
"thumbnail": "https://your-domain/img/product.jpg",
"price": "$ 9,999",
"bestDiscount": "-40%",
"marks": {
"coupon": true,
"shippingCoupon": false,
"buynow": true,
"bid": false
},
"buyCount": 1,
"broadcasting": true
},
...
]
}
</script>
</yahoo-x-bv-player>
Otherwise, developers could also choose remoteconfig to fetch config for <yahoo-x-bv-player />.
<yahoo-x-bv-player
remoteconfig="https://your-domain/api-path"
>
...
...
...
</yahoo-x-bv-player>
JavaScript Instantiation
<yahoo-x-bv-player /> could also use JavaScript to create DOM element. Here comes some examples.
<script type="module">
import { YahooXBvPlayer } from 'https://unpkg.com/yahoo-x-bv-player/mjs/wc-yahoo-x-bv-player.js';
// use DOM api
const nodeA = document.createElement('yahoo-x-bv-player');
document.body.appendChild(nodeA);
nodeA.playerconfig = {
licenseKey: 'your-BlendVision-player-license',
playbackToken: '<playbackToken>',
title: 'Yahoo Auction',
source: [
{
type: 'video/mp4',
src: 'https://your-domain/video-source.mp4'
}
]
};
nodeA.share = {
title: 'Yahoo X BlendVision',
text: 'This is a Yahoo X BlendVision video player.',
url: 'https://blog.lalacube.com/mei/webComponent_yahoo-x-bv-player.html'
};
nodeA.loop = true;
// new instance with Class
const nodeB = new YahooXBvPlayer();
document.body.appendChild(nodeB);
nodeB.playerconfig = {
licenseKey: 'your-BlendVision-player-license',
playbackToken: '<playbackToken>',
title: 'Yahoo Auction',
source: [
{
type: 'video/mp4',
src: 'https://your-domain/video-source.mp4'
}
]
};
nodeB.share = {
title: 'Yahoo X BlendVision',
text: 'This is a Yahoo X BlendVision video player.',
url: 'https://blog.lalacube.com/mei/webComponent_yahoo-x-bv-player.html'
};
nodeB.loop = true;
// new instance with Class & default config
const config = {
playerconfig: {
licenseKey: 'your-BlendVision-player-license',
playbackToken: '<playbackToken>',
title: 'Yahoo Auction',
source: [
{
type: 'video/mp4',
src: 'https://your-domain/video-source.mp4'
}
]
},
share: {
title: 'Yahoo X BlendVision',
text: 'This is a Yahoo X BlendVision video player.',
url: 'https://blog.lalacube.com/mei/webComponent_yahoo-x-bv-player.html'
}
};
const nodeC = new YahooXBvPlayer(config);
document.body.appendChild(nodeC);
</script>
Style Customization
Developers could apply styles to decorate <yahoo-x-bv-player />'s looking.
<style>
yahoo-x-bv-player {
/* main padding */
--yahoo-x-bv-player-padding-inline-basis: 12px;
--yahoo-x-bv-player-padding-block-end-basis: 8px;
/* video */
--yahoo-x-bv-player-video-object-fit: contain;
/* progress */
--yahoo-x-bv-player-slider-thumb-color: rgba(234 51 35);
--yahoo-x-bv-player-slider-thumb-shadow-color: rgba(0 0 0);
--yahoo-x-bv-player-indicator-background: rgba(255 255 255/.2);
--yahoo-x-bv-player-indicator-buffer-start: rgba(255 255 255/.4);
--yahoo-x-bv-player-indicator-buffer-end: rgba(255 255 255/.4);
--yahoo-x-bv-player-indicator-duration-start: rgba(234 51 35);
--yahoo-x-bv-player-indicator-duration-end: rgba(234 51 35);
/* time information */
--yahoo-x-bv-player-time-info-text-color: rgba(255 255 255);
/* buttons */
--yahoo-x-bv-player-button-icon-color: rgba(255 255 255);
--yahoo-x-bv-player-button-focus-visible-background-color: rgba(0 0 0/.5);
/* dialog */
--yahoo-x-bv-player-dialog-background-color: rgba(255 255 255);
--yahoo-x-bv-player-dialog-backdrop-color: rgba(35 42 49/.6);
--yahoo-x-bv-player-dialog-head-text-color: rgba(35 42 49);
--yahoo-x-bv-player-dialog-listing-title-color: rgba(35 42 49);
--yahoo-x-bv-player-dialog-line-color: rgba(199 205 210);
--yahoo-x-bv-player-dialog-listing-price-color: rgba(235 15 41);
--yahoo-x-bv-player-dialog-listing-hover-color: rgba(240 243 245);
--yahoo-x-bv-player-dialog-listing-broadcasting-color: rgba(255 211 51/.3);
--yahoo-x-bv-player-dialog-close-hover-background-color: rgba(245 248 250);
--yahoo-x-bv-player-dialog-close-icon-color: rgba(95 99 104);
--yahoo-x-bv-player-dialog-listing-buynow-color: rgba(0 99 235);
/* message input */
--yahoo-x-bv-player-live-controls-input-text-color: rgba(255 255 255);
--yahoo-x-bv-player-live-controls-input-placeholder-color: rgba(255 255 255/.5);
--yahoo-x-bv-player-live-controls-form-background-color: rgba(0 0 0/.75);
/* chatroom */
--yahoo-x-bv-player-chatroom-message-owner-text: 'HOST';
--yahoo-x-bv-player-chatroom-message-owner-text-color: rgba(255 255 255);
--yahoo-x-bv-player-chatroom-message-owner-background-color: rgba(255 82 13);
/* host */
--yahoo-x-bv-player-host-count-text: 'viewers';
/* poster */
--yahoo-x-bv-player-poster-background-color: rgba(0 0 0);
/* listings' text */
--yahoo-x-bv-player-broadcasting-text: 'ON AIR';
--yahoo-x-bv-player-listing-sign-shipping-coupon-text: '運費抵用券';
--yahoo-x-bv-player-listing-sign-coupon-text: '折扣碼';
--yahoo-x-bv-player-listing-sign-buynow-text: '直購';
--yahoo-x-bv-player-listing-sign-bid-text: '競標';
--yahoo-x-bv-player-listing-sold-start-text: '售出';
--yahoo-x-bv-player-listing-sold-end-text: '件';
/* emotions (1 ~ 9) */
--yahoo-x-bv-player-emotion-sign-1: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyNCcgaGVpZ2h0PScyNCcgZmlsbD0nbm9uZSc+PHBhdGggZmlsbD0nI0ZDREExOScgZD0nTTEyIDBjNi42MjcgMCAxMiA1LjM3MyAxMiAxMnMtNS4zNzMgMTItMTIgMTJTMCAxOC42MjcgMCAxMiA1LjM3MyAwIDEyIDBaJy8+PHBhdGggZmlsbD0nI0ZGNEQ1MicgZD0nTTYuNDIzIDE0LjQxM2MuODEgMS4wNjggMi4wNyAxLjc4IDMuNjYyIDEuNzggM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otion-sign-9: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyNCcgaGVpZ2h0PScyNCcgZmlsbD0nbm9uZSc+PHBhdGggZmlsbD0ndXJsKCNhKScgZD0nTTEyIDBjNi42MjcgMCAxMiA1LjM3MyAxMiAxMnMtNS4zNzMgMTItMTIgMTJTMCAxOC42MjcgMCAxMiA1LjM3MyAwIDEyIDBaJy8+PHBhdGggZmlsbD0nI2ZmZicgZD0nTTUuMjE0IDExLjY0OEg3Ljg3VjguNzJoMS43NDR2Mi45MjhoMi42NzJ2MS42NDhIOS42MTR2Mi45MTJINy44N3YtMi45MTJINS4yMTR2LTEuNjQ4Wk0xNS43NDYgMThWOS4xODRsLTIuMjQgMS4zNzYtLjA5Ni0uMDMyVjguNDk2bDIuOTI4LTEuNzc2aDEuODcyVjE4aC0yLjQ2NFonLz48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9J2EnIHgxPScxMS45NzQnIHgyPSczNS45MjInIHkxPSczNS45NzQnIHkyPScxMi4wMjYnIGdyYWRpZW50VW5pdHM9J3VzZXJTcGFjZU9uVXNlJz48c3RvcCBzdG9wLWNvbG9yPScjRkY4QTAwJy8+PHN0b3Agb2Zmc2V0PScuNTknIHN0b3AtY29sb3I9JyNGRkE3MDAnLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48L3N2Zz4=);
}
</style>
Keyboard shortcut
<yahoo-x-bv-player /> also comes with keyboard shortcut. I believe this will make more vivid & more useful.
- k:Toggle <yahoo-x-bv-player /> play or pause.
- space:Toggle <yahoo-x-bv-player /> play or pause.
- m:Toggle <yahoo-x-bv-player /> mute or not.
- s:Take a screenshot for current <yahoo-x-bv-player /> video frame.
- f:Toggle <yahoo-x-bv-player /> into fullscreen or not.
- esc:Turn off fullscreen mode.
- ←:<yahoo-x-bv-player /> backward 5 seconds.
- →:<yahoo-x-bv-player /> forward 5 seconds.
- j:<yahoo-x-bv-player /> backward 10 seconds.
- l:<yahoo-x-bv-player /> forward 10 seconds.
- 0 ~ 9:<yahoo-x-bv-player /> jumps to specific timeline. Ex: 7 means to timeline 70%.
Attributes
<yahoo-x-bv-player /> supports some attributes to let it become more convenience & useful.
- type
Set type as live or replay. Default is live
.
<yahoo-x-bv-player type="live">
...
</yahoo-x-bv-player>
- playerconfig
Set BlendVision Web SDK config.
licenseKey
:Set BlendVision player license.playbackToken
:Set BlendVision PlaybackSession token.title
:Set title.source
:Set video sources.
<yahoo-x-bv-player playerconfig='{"title":"Yahoo Auction","source":[{"type":"video/mp4","src":"https://your-domain/video-source.mp4"}],"licenseKey":"your-BlendVision-player-license","playbackToken":"your-BlendVision-playback-token"}'>
...
</yahoo-x-bv-player>
- chatroomconfig
Set BlendVision chatroom SDK config.
token
:Set BlendVision chatroom token.refreshToken
:Set BlendVision chatroom refreshToken.host
:Set api host. Default is "https://api.one.blendvision.com".
<yahoo-x-bv-player chatroomconfig='{"token":"your.BV.chatroom.token","refreshToken":"your.BV.chatroom.refreshToke","host":"https://api.one.blendvision.com"}'>
...
</yahoo-x-bv-player>
- ysocket
Set Yahoo socket config. This key is optional.
id
:Set id for yahoo socket.url
:Set url for yahoo socket.
<yahoo-x-bv-player ysocket='{"id":"your.yahoo.web.socket.id","url":"your.yahoo.web.socket.url"}'>
...
</yahoo-x-bv-player>
- share
Set share information.
title
:Set share title.text
:Set share descrioption.url
:Set share url. Default is link[rel=canonical] or current page url.
<yahoo-x-bv-player share='{"title":"Yahoo X BlendVision","text":"This is a Yahoo X BlendVision video player.","url":"https://your-domain/share.html"}'>
...
</yahoo-x-bv-player>
- poster
Set video poster.
<yahoo-x-bv-player poster="https://your-domain/poster.jpg">
...
</yahoo-x-bv-player>
- loop
Set video loop or not.
<yahoo-x-bv-player loop>
...
</yahoo-x-bv-player>
- autopilot
Set autopilot for like button or not.
<yahoo-x-bv-player autopilot>
...
</yahoo-x-bv-player>
- autoplay
Set autoplay for video.
<yahoo-x-bv-player autoplay>
...
</yahoo-x-bv-player>
- host
Set host information.
avatar
:Set host avatar path.name
:Set host name.link
:Set host url.count
:Set current count information.announce
:Set content which host like to announce.follow
:Set follow(Boolean) or not.
<yahoo-x-bv-player host='{"avatar":"https://your-domain/host-avatar.png","name":"host name","link":"https://your-domain/host","count":"999","follow":false}'>
...
</yahoo-x-bv-player>
- l10n
Set localization for title or action buttons.
previewtrigger
:Set preview trigger text content.listingshead
:Set listing dialog's title.buynow
:Set listing dialog's direct buy button text content.jointhecrowd
:Set message when user joined LIVE.rushbuying
:Set message when user visited product list or product page.addfavorite
:Set message when user added host as his / her favorite.sharelive
:Set message when user shared LIVE.takesnapshot
:Set message when user took a snapshot.achievetrophy
:Set message when user achieved like count trophy.highestbid
:Set message when highest bidder occured.exceededbid
:Set message when bid price has been exceeded.wonbid
:Set message when won bid.cancelledplacebid
:Set message when owner canceled someone's bid.placebid
:Set message when someone place bid.
<yahoo-x-bv-player l10n='{"previewtrigger":"View","listingshead":"Products","buynow":"BUY NOW","jointhecrowd":"joined the crowd.","rushbuying":"is rush buying.","addfavorite":"added host as favorite.","sharelive":"shared this LIVE.","takesnapshot":"took snapshot.","achievetrophy":"achieved {{hits}} likes."}'>
...
</yahoo-x-bv-player>
- messagetemplate
Set message template information. Default is []
.
<yahoo-x-bv-player messagetemplate='["👍","+1","被燒🔥","尺寸?","材質?","多少錢?"]'>
...
</yahoo-x-bv-player>
- products
Set products' information.
id
:Set product id.uuid
:Set product uuid.title
:Set product's title.link
:Set product url.thumbnail
:Set product thumbnail.price
:Set product price.marketPrice
:Set product market price(original price). This key is optional.priceRange
:Set product price range(min & max)in object format. UI will take this information first(hide price & marketPrice). This key is optional.bestDiscount
:Set product best discount. This is optional key.marks
:Set product marks > coupon(Boolean)、shipping coupon(Boolean)、buynow(Boolean)、bid(Boolean). This is optional key..buyCount
:Set product sold count.broadcasting
:Set product is current broadcasting or not.(Boolean).
<yahoo-x-bv-player products='[{"id":"A1234567890","uuid":"334c6ea9-244e-4a6c-b320-d3506b4d6d91","title":"product title","link":"https://your-domain/product.html","thumbnail":"https://your-domain/img/product.jpg","price":"$ 9,999","bestDiscount":"-40%","marks":{"coupon":true,"shippingCoupon":false,"buynow":true},"buyCount":1,"broadcasting":true}]'>
...
</yahoo-x-bv-player>
Properties
| Property Name | Type | Description |
| ----------- | ----------- | ----------- |
| type | String | Getter / Setter type as live
or replay
. |
| playerconfig | Object | Set BlendVision Web SDK config. Developers could set licenseKey
、playbackToken
、title
and source
here. |
| chatroomconfig | Object | Set BlendVision chatroom SDK config. Developers could set token
、refreshToken
and host
here. |
| share | Object | Getter / Setter share information. Developers could set title
、text
and url
here. |
| poster | String | Getter / Setter video poster. |
| loop | Boolean | Getter / Setter video loop. |
| autopilot | Boolean | Getter / Setter autopilot for like button. |
| currentTime | Number | Getter / Setter the current playback time in seconds. |
| muted | Boolean | Getter / Setter video is muted. |
| paused | Boolean | Getter video paused status. |
| host | Object | Getter / Setter host information. Developers could set avatar
、name
、link
、count
、announce
and follow
here. |
| l10n | Object | Getter / Setter localization for title or action buttons. Developers could set previewtrigger
、listingshead
、buynow
、jointhecrowd
、rushbuying
、addfavorite
、sharelive
、takesnapshot
and achievetrophy
here. |
| messagetemplate | Array | Getter / Setter message template information. Default is []
. |
| products | Array | Getter / Setter products' information. Developers could set id
、uuid
、title
、link
、thumbnail
、price
、marketPrice
、priceRange
、bestDiscount
、marks
、buyCount
and broadcasting
here. |
Mathods
| Mathod Signature | Description | | ----------- | ----------- | | play | Play video. | | pause | Pause video. |
Events
| Event Signature | Description | | ----------- | ----------- | | yahoo-x-bv-player-play | Fired when video play. | | yahoo-x-bv-player-pause | Fired when video pause. | | yahoo-x-bv-player-seeking | Fired when video seeking. | | yahoo-x-bv-player-ended | Fired when video ended. | | yahoo-x-bv-player-purchase-click | Fired when product's purchase button clicked. Developers could gather product information through event.detail. | | yahoo-x-bv-player-follow-click | Fired when host's follow button clicked. Developers could gather follow information through event.detail. | | yahoo-x-bv-player-live-ended | Fired when LIVE ended. Developers could gather count、createdAt and likeCount information through event.detail. | | yahoo-x-bv-player-add-product | Fired when user add product. Developers could gather id information through event.detail. |