Skip to content

Instantly share code, notes, and snippets.

@HeNy007
Created August 18, 2022 14:37
Show Gist options
  • Save HeNy007/73b355e8e1f838f53c970dd2c27ee297 to your computer and use it in GitHub Desktop.
Save HeNy007/73b355e8e1f838f53c970dd2c27ee297 to your computer and use it in GitHub Desktop.
aksVideoPlayer - Context Menu
<div id="video"></div>
<a class="github" target="_blank" href="https://github.com/Ahmetaksungur/aksvideoplayer/">
<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none" shape-rendering="geometricPrecision" style=""><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 00-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0020 4.77 5.07 5.07 0 0019.91 1S18.73.65 16 2.48a13.38 13.38 0 00-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 005 4.77a5.44 5.44 0 00-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 009 18.13V22"></path></svg>
GİTHUB</a>
<!-- Video By: Refik Anadol -->
$("#video").aksVideoPlayer({
file: [
{
file: "https://raw.githubusercontent.com/Ahmetaksungur/aksvideoplayer/main/videos/video-1080.mp4",
label: "1080p"
},
{
file: "https://raw.githubusercontent.com/Ahmetaksungur/aksvideoplayer/main/videos/video-720.mp4",
label: "720p"
},
{
file: "https://raw.githubusercontent.com/Ahmetaksungur/aksvideoplayer/main/videos/video-540.mp4",
label: "540p"
},
{
file: "https://raw.githubusercontent.com/Ahmetaksungur/aksvideoplayer/main/videos/video-360.mp4",
label: "360p"
},
{
file: "https://raw.githubusercontent.com/Ahmetaksungur/aksvideoplayer/main/videos/video-240.mp4",
label: "240p"
}
],
width: 640,
height: 360,
poster: "https://raw.githubusercontent.com/Ahmetaksungur/aksvideoplayer/main/videos/poster.webp",
forward: true,
contextMenu: [
{
type: "urlCopy",
label: "Copy Video Url",
url: "http://url.com/"
},
{
type: "socialmedia",
label: "Share on Social Media",
socials: [
{
label: "Facebook",
url: "",
colorBg: "#0066ff",
color: "white",
icon:
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 20"><defs/><path d="M8.174 3.32H10V.14A23.66 23.66 0 007.34 0C4.709 0 2.906 1.656 2.906 4.7v2.8H0v3.555h2.905V20h3.56v-8.945h2.789L9.697 7.5H6.466V5.05c0-1.027.276-1.73 1.708-1.73z" fill-rule="evenodd"/></svg>'
},
{
label: "Twitter",
url: "",
colorBg: "#0089ff",
color: "white",
icon:
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 16"><defs/><path d="M17.944 3.987c.013.175.013.35.013.526C17.957 9.85 13.833 16 6.294 16c-2.322 0-4.48-.662-6.294-1.813.33.038.647.05.99.05 1.916 0 3.68-.637 5.089-1.725-1.802-.037-3.313-1.2-3.833-2.8.254.038.508.063.774.063.368 0 .736-.05 1.079-.137-1.878-.376-3.287-2-3.287-3.963v-.05c.546.3 1.18.488 1.853.512A4.02 4.02 0 01.838 2.775c0-.75.203-1.438.558-2.038a11.71 11.71 0 008.452 4.225 4.493 4.493 0 01-.102-.924c0-2.226 1.828-4.038 4.1-4.038 1.18 0 2.245.487 2.994 1.275A8.145 8.145 0 0019.442.3a4.038 4.038 0 01-1.802 2.225A8.316 8.316 0 0020 1.9a8.74 8.74 0 01-2.056 2.087z" fill-rule="evenodd"/></svg>'
}
]
},
{
type: "iframe",
label: "Copy Iframe Code",
iframe: "&lt;iframe&gt;&lt;/iframe&gt;"
}
],
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aksVideoPlayer.min.js"></script>
*,
::after,
::before {
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-size: 20px;
line-height: 1.5;
-webkit-tap-highlight-color: transparent;
}
body {
background: #fff;
color: #111;
font-size: 0.8rem;
overflow-x: hidden;
text-rendering: optimizeLegibility;
font-family: Gilroy-Medium;
}
.github{
position: fixed;
margin: 0 auto;
left: -46px;
display: flex;
align-items: center;
justify-content: center;
width: 125px;
height: 40px;
background: linear-gradient(#041d48, #01112d);
text-decoration: none;
color: white;
border-radius: 10px 10px 0 0;
font-weight: 600;
cursor: pointer;
transform: rotate(90deg);
top: 30%;
}
.github svg{
margin-right:10px;
}
<link href="https://unpkg.com/[email protected]/dist/aksVideoPlayer.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment