I want to add Watermark in a video using html5. I am using Laravel 5.7 and plugins Video.js to do this. But when video fullscreen mode, the watermark is not display, But in normal view the watermark displayed.
I got an issue in fullscreen mode, when i click fullscreen video, the watermark is not displayed.
How to fix this issue?
This is my code :
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="https://c.sproutvideo.com/player_api.js"></script>
<link rel="stylesheet" href="https://sproutvideo.github.io/sproutvideo-player-api/assets/bootstrap.min.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<link href="{{asset('video/video-js.css')}}" rel="stylesheet">
<link href="{{asset('css/videojs.watermark.css')}}" rel="stylesheet">
<script src="{{asset('video/video.js')}}"></script>
<script>
videojs.options.flash.swf = "{{asset('video.js/video-js.swf')}}"
</script>
<!-- <script src="../videojs.watermark.js"></script> -->
<!-- For debugging -->
<script src="{{asset('video/videojs.watermark.js')}}"></script>
<style>
p {
background-color: #eee;
border: thin solid #777;
padding: 10px;
}
</style>
</head>
<body>
<p>The watermark plugin display an image or text over the video. Give it a shot:</p>
<iframe id='video_1' class='video-js vjs-default-skin' src='https://videos.sproutvideo.com/embed/709adcb31f19e5c6f8/cd8cf2e796aa69d3' style='width:100%;height:500px;' frameborder='0' allowfullscreen></iframe>
<script>
// initialize video.js
var my_video_id = videojs('video_1');
// Set value to the plugin
my_video_id.watermark({
file: 'Owned_Stamp.png',
xpos: 0,
ypos: 0,
xrepeat: 0,
opacity: 0.5
});
</script>
</body>
Related
I would like someone to help me put an animated progress bar in colors below the [border-bottom: 3px solid #a3c846;] eg slowing down with time on variable [timer], anyone to help me? Thanks!
$(document).ready(function(){
window.addEventListener("message",function(event){
var html = "<div id='"+event.data.css+"'>"+event["data"]["mensagem"]+"</div>"
$(html).fadeIn(500).appendTo("#notifications").delay(event["data"]["timer"]).fadeOut(500);
})
});
#sucesso {
background: rgba(34,34,34,0.75) url("images/check.png") no-repeat center left 11px;
border-bottom: 3px solid #a3c846;
}
<html>
<head>
<meta charset="UTF-8">
<title>#creative</title>
<script src="nui://game/ui/jquery.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="notifications">
</div>
<script src="app.js"></script>
</body>
</html>
Try something like
$(html).fadeIn(500).appendTo("#notifications") .animate({ width: '0%' }, event["data"]["timer"]);
I am currently trying to follow the step by step instructions on the Leaflet page on how to set up a basic map but something isn't working for me, the map is not showing up at all. I downloaded the Leaflet-stable release and put all those files in a folder and in it I also created index.html file.
Here is the code I have so far,
This is the HTML file
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="leaflet.css" />
<script src="leaflet.js"></script>
///The above part comes from the download page from Leaflet.com. They say that if you download the files, the code above is what you should put in the head section///
</head>
<body>
<div id="mapid"></div>
</body>
</html>
And this is the .css. file. The instructions say that I have to add this "#mapid { height: 180px; }" in the .css file. Do I simply copy it in like this?
Original .css file that comes with leaflet.
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
My .css file with the #mapid { height: 180px; } code
/* required styles */
#mapid { height: 180px; }
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
What am I doing wrong?
Hope below code will help you.
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/leaflet#1.5.1/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<title>Leaflet, Demo Fazal!</title>
<style>#mapid { height: 380px; }</style>
</head>
<body>
<div id="mapid"></div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/leaflet#1.5.1/dist/leaflet.js"
integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og=="
crossorigin=""></script>
<script>
var map = L.map('mapid').setView([22.306841, 73.119037], 13);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors'
}).addTo(map);
L.marker([22.306841, 73.119037]).addTo(map)
.bindPopup('A pretty CSS3 popup.<br> Easily customizable.')
.openPopup();
</script>
</body>
</html>
As you can see the examples here https://github.com/theonion/videojs-vast-plugin,the player plays video ad before the main video.But when I put the urls offered by my advertisers in my own HTML page,no ad and I have to click the play button then the main video will start.This is the code.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Video.js VAST Example</title>
<!--<link href="http://vjs.zencdn.net/4.7.1/video-js.css" rel="stylesheet">-->
<link rel="stylesheet" href="css/video-js.css">
<link rel="stylesheet" href="videojs.vast.css">
<link href="lib/videojs-contrib-ads/videojs.ads.css" rel="stylesheet" type="text/css">
<link href="videojs.vast.css" rel="stylesheet" type="text/css">
<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
<style>
.example-video-container {
position: absolute;
top: 30px;
left: 50%;
margin-left: -315px;
}
#vid2 {
position: absolute;
top: 30px;
}
</style>
<!--[if lt IE 9]><script src="lib/es5.js"></script><![endif]-->
<!--<script src="http://vjs.zencdn.net/4.7.1/video.js"></script>-->
<script src="js/video.js"></script>
<script src="lib/videojs-contrib-ads/videojs.ads.js"></script>
<script src="lib/vast-client.js"></script>
<script src="videojs.vast.js"></script>
</head>
<body>
<div class="example-video-container">
<video id="vid2" class="video-js vjs-default-skin" autoplay controls preload="auto"
poster=""
data-setup='{}'
width='710'
height='500'
>
<source src="v1.mp4" type='video/mp4'>
<!--<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm'>
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg'>-->
<p>Video Playback Not Supported</p>
</video>
</div>
<script type="text/javascript">
console.log(returnCitySN["cip"]+','+returnCitySN["cname"]);
videojs('vid2',{}, function () {
var timestamp=Math.round(new Date().getTime()/1000);
console.log(timestamp);
var player = this;
player.ads();
player.vast({
url:'https://p.algovid.com/vpvast?p=99974938&cb=' + timestamp + '&d=https%3A%2F%2Fh5.xcloudgame.com&w=710&h=500'
});
player.on('readyforpreroll',function(){
player.ads.startLinearAdMode();
console.log('adsstart');
player.one('ended', function() {
player.ads.endLinearAdMode();
console.log('adsend');
});
});
});
</script>
</body>
</html>
And the xml file return this.
<VAST version="2.0">
<Ad id="VPAID">
<InLine>
<AdSystem version="1.0">Cedato</AdSystem>
<AdTitle>Cedato VPAID Ad Manager</AdTitle>
<Impression />
<Creatives>
<Creative sequence="1">
<Linear>
<Duration>00:00:30</Duration>
<MediaFiles>
<MediaFile delivery="progressive" width="710" height="500" scalable="1" type="application/x-shockwave-flash" apiFramework="VPAID">https://c.algovid.com/player/cedato_vpw_ima_101.82.swf?vp=378&p=99974938&sid=&w=710&h=500&h=500&w=710&pv=102.83&d=https%3A%2F%2Fh5%2Excloudgame%2Ecom</MediaFile>
<MediaFile delivery="progressive" width="710" height="500" scalable="1" type="application/javascript" apiFramework="VPAID">https://c.algovid.com/player/cedato_vpaid_102.83.js?p=99974938&sid=&w=710&h=500&h=500&w=710&pv=102.83&d=https%3A%2F%2Fh5%2Excloudgame%2Ecom</MediaFile>
</MediaFiles>
</Linear>
</Creative>
</Creatives>
</InLine>
</Ad>
</VAST>
Is there anyone can tell me how to fix this?
Afaig, the videojs-vast-plugin isn't able to play VPAID.
You will need for example the videojs-vast-vpaid plugin.
Unfortunately I wasn't able to play the resource, 'cause:
AD ERROR: VAST Error: on VPAIDAdUnitWrapper.waitForEvent, timeout while waiting for event 'AdLoaded'
but this could be caused by the ad-server configuration (aka my referrer might not be accepted), so you need to find out yourself.
You will find examples for the videojs-vast-vpaid plugin on github, but here is what i did:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Video.js VAST Example</title>
<!-- VideoJs required styles-->
<link rel="stylesheet" type="text/css" href="//mailonline.github.io/videojs-vast-vpaid/demo/videojs_4/video-js.css"/>
<!-- VideoJs.vast.vpaid required styles-->
<link rel="stylesheet" type="text/css" href="//mailonline.github.io/videojs-vast-vpaid/styles/videojs.vast.vpaid.css"/>
<!-- DEMO required styles-->
<link rel="stylesheet" type="text/css" href="//mailonline.github.io/videojs-vast-vpaid/demo/styles/demo.css"/>
<!-- Web Fonts -->
<link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">
<script type="text/javascript">
// this is mandatory for IE8 !!!!!
document.createElement('video');
document.createElement('audio');
document.createElement('track');
</script>
<!-- VideoJs required scripts-->
<script type="text/javascript" src="//mailonline.github.io/videojs-vast-vpaid/demo/videojs_4/video.js"></script>
<!-- VideoJs.vast.vpaid required scripts-->
<script type="text/javascript" src="//mailonline.github.io/videojs-vast-vpaid/scripts/es5-shim.js"></script>
<script type="text/javascript" src="//mailonline.github.io/videojs-vast-vpaid/scripts/ie8fix.js"></script>
<script type="text/javascript" src="//mailonline.github.io/videojs-vast-vpaid/scripts/videojs_4.vast.vpaid.js"></script>
<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
</head>
<body>
<div class="example-video-container">
<video id="vid2" class="video-js vjs-default-skin" autoplay controls preload="auto" poster="" data-setup='{}' width='710' height='500'>
<source src="oceans.mp4" type='video/mp4'>
<p>Video Playback Not Supported</p>
</video>
</div>
<script type="text/javascript">
console.log(returnCitySN["cip"]+','+returnCitySN["cname"]);
var timestamp = Math.round(new Date().getTime()/1000);
var vjs = videojs('vid2',{}, function () {
var player = this;
var vastPlugin = player.vastClient({
adTagUrl: '//p.algovid.com/vpvast?p=99974938&cb=' + timestamp + '&d=https%3A%2F%2Fh5.xcloudgame.com&w=710&h=500',
//adTagUrl: '//rtr.innovid.com/r1.5554946ab01d97.36996823;cb=%25%CACHEBUSTER%25%25',
playAdAlways: true,
adCancelTimeout: 60000,
vpaidFlashLoaderPath: './VPAIDFlash.swf'
});
player.on('reset', function () {
console.log('vast-plugin enabled - ' + vastPlugin.isEnabled() ? 'true' : 'false')
if (!vastPlugin.isEnabled()) {
vastPlugin.enable();
} else {
vastAd.disable();
}
});
});
</script>
</body>
</html>
A resource which works and I used for testing: http://rtr.innovid.com/r1.5554946ab01d97.36996823;cb=%25%CACHEBUSTER%25%25
The config might not be perfect - I'm relatively little familiar with this player.
Hope this was helpfull somehow and have a nice day.
Unfortunately I cannot run tests at the moment, but from your description of the issue maybe this parameter needs to be updated d=https%3A%2F%2Fh5.xcloudgame.com ?
I want to load codemirror js editor into an iframe to avoid styles overriding. I read the document https://codemirror.net/doc/manual.html#config but it is not clear. Here is what i am tried.
HTML
<iframe id="code"></iframe>
Js
var codemirror = CodeMirror(document.getElementById("code").contentWindow.document.body, {
mode: "javascript",
theme: "monokai"
});
How can I load codemirror js editor into an iframe?
Place below code in your html markup.
<iframe src="https://codemirror.net/doc/manual.html#config"></iframe>
If you want to have CodeMirror in an iframe, you will need two different html files. See a very simple example below. Please be a little bit more specific for further requirements.
iframe.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel=stylesheet href="http://codemirror.net/doc/docs.css">
<link rel=stylesheet href="http://codemirror.net/lib/codemirror.css">
<script src=http://codemirror.net/lib/codemirror.js></script>
<script src=http://codemirror.net/mode/htmlmixed/htmlmixed.js></script>
<style type=text/css>
.CodeMirror {float: left; width: 100%; height: 100%; }
</style>
</head>
<body>
<div>
<textarea id=content name="content"></textarea>
</div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById('content'), {
mode: 'application/x-httpd-php',
lineNumbers: true
});
</script>
</body>
</html>
main.html
<!DOCTYPE html>
<html>
<body>
<iframe src="iframe.html"></iframe>
</body>
</html>
After a long time I try again to work with jquery. The last time it worked great but now I have to run to bring it trouble. Have tried to break the problem down into simple parts and have included the HTML, JS and CSS file created to eliminate as many errors as possible. I think that I have not correctly using jquery, but can not find my error.
Here is the HTML:
<html>
<head>
<title>Untitled</title>
<link rel="stylesheet" type="text/css" href="test.css" >
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" >
<script type="text/javascript" src="test.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<div id="slider">
</div>
</body>
</html>
CSS:
html, body{
height: 100%;
width: 100%;
background-color: #FCF65A;
}
#slider{
height: 100%;
width: 300px;
background-color: #88E453;
margin-left: 0;
}
JS:
$('#slider').click(function() {
$(this).toggle(1000);
});
});
According to my understanding of this, the Green bars should left click on the edge of NEM but disappear?
I'd appreciate any help. I've been seeking the error now for almost 2 days.