I am using following jquery live click to display ad from my openx server.
$('.vbox > li > img').live('click',function(){
var videourl = "http://www.indiantripadviser.com/img/video/"+$(this).data('videourl');
var videodur = parseInt($(this).data('duration'));
$('#vidHolder').show();
flowplayer("player", "dist/swf/flowplayer-3.2.7.swf", {
"playlist":[
{
"url": videourl,
"duration": videodur
}
],
"plugins": {
"ova": {
"url": "dist/swf/ova.swf",
"autoPlay": true,
"ads": {
"controls": {
"skipAd": {
"enabled": true,
"showAfterSeconds": 5,
"image": "global/images/skip.png",
"width": 100,
"height": 15
}
},
"servers": [
{
"type": "OpenX",
"apiAddress": "http://advert.visionimpact.co.in/www/delivery/fc.php"
}
],
"schedule": [
{
"zone": "8",
"position": "pre-roll"
}
],
"notice": { "type": "countdown" }
}
}
},
"canvas": {
"backgroundColor": '#F9F9F9'
}
});
});
Now my issue is, if I use the "apiAddress": "http://advert.indiantripadviser.com/www/delivery/fc.php" it works fine but when i change it to "apiAddress": "http://advert.**visionimpact.co.in**/www/delivery/fc.php" it stops delivering ads. I can't figure out where is the mistake, as I created, linked the zone and banner several times.
I am totally out!
Looks like a crossdomain issue. Have you allowed
http://advert.**visionimpact.co.in**
in your crossdomain xml file?
If you are serving your ads from a different domain name than the flash player, you need to install a crossdomain.xml file in the docroot on your openX ad server to allow flash to communicate to it.
Example crossdomain xml :
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>
Ref : http://code.google.com/p/openx-iab-vast/wiki/ExampleCrossdomainXML
Related
Using the Google Photos API I would like to display the thumbnails associated with videos without the play icon overlaying the image.
This is what it looks like. How can I remove the white play arrow?
I know from the documentation that "to access the thumbnail of the video use any of the image base url parameters.":
https://developers.google.com/photos/library/guides/access-media-items
To get a list of files, I use the Google Javascript API gapi
gapi.client.request({
'path': 'https://photoslibrary.googleapis.com/v1/mediaItems:search',
'method': 'POST',
'body': { "filters": { "mediaTypeFilter": { "mediaTypes": ["VIDEO"] } } }
}).then(displayTheResults);
This gives me results like this:
{
"result": {
"mediaItems": [
{
"id": "iiiiiiiiiiiiii",
"productUrl": "https://photos.google.com/lr/photo/iiiiiiiiiiii",
"baseUrl": "https://lh3.googleusercontent.com/lr/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"mimeType": "video/mp4",
"mediaMetadata": {
"creationTime": "2021-02-24T11:23:26Z",
"width": "1920",
"height": "1080",
"video": {
"fps": 29.609994326070606,
"status": "READY"
}
},
"filename": "VID_1111111111.mp4"
}
....
]
},
"body": { .... },
"headers": { ... },
"status": 200,
"statusText": null
}
To generate the thumbnail my base-url becomes:
var videoThumbnail = baseUrl + "=w300-h200-c";
Is it possible to remove the big 'play' icon from the thumbnail?
Pretty sure I am missing something clearly obvious but not seeing it.
How can I use my updated swagger.json file?
I took my boilerplate swagger/v1/swagger.json code and pasted it into the editor.swagger.io system. I then updated the descriptions etc, added examples to my models and then saved the contents as swagger.json.
Moved the file into the root of my api application, set the file to copy always.
public void ConfigureServices(IServiceCollection services)
{...
services.AddSwaggerGen(c => { c.SwaggerDoc("V1", new Info {Title = "Decrypto", Version = "0.0"}); });
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
...
app.UseSwagger();
//--the default works fine
// app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/V1/swagger.json", "Decrypto v1"); });
app.UseSwaggerUI(c => { c.SwaggerEndpoint("swagger.json", "Decrypto v1"); });
app.UseMvc();
}
I have tried a few different variation but none seem to be the trick. I don't really want to rewrite the work in SwaggerDoc as it seems dirty to me put documentation in the runtime.
the custom swagger.json file I want to use looks like this:
{
"swagger": "2.0",
"info": {
"version": "0.0",
"title": "My Title"
},
"paths": {
"/api/Decryption": {
"post": {
"tags": [
"API for taking encrypted values and getting the decrypted values back"
],
"summary": "",
"description": "",
"operationId": "Post",
"consumes": [
"application/json-patch+json",
"application/json",
"text/json",
"application/*+json"
],
"produces": [
"text/plain",
"application/json",
"text/json"
],
"parameters": [
{
"name": "units",
"in": "body",
"required": true,
"schema": {
"uniqueItems": false,
"type": "array",
"items": {
"$ref": "#/definitions/EncryptedUnit"
}
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"uniqueItems": false,
"type": "array",
"items": {
"$ref": "#/definitions/DecryptedUnit"
}
}
}
}
}
}
},
"definitions": {
"EncryptedUnit": {
"type": "object",
"properties": {
"value": {
"type": "string",
"example": "7OjLFw=="
},
"initializeVector": {
"type": "string",
"example": "5YVg="
},
"cipherText": {
"type": "string",
"example": "596F5AA48A882"
}
}
},
"DecryptedUnit": {
"type": "object",
"properties": {
"encrypted": {
"type": "string",
"example": "7OjLV="
},
"decrypted": {
"type": "string",
"example": "555-55-5555"
}
}
}
}
}
you need to configure PhysicalFileProvider and put your swagger.json into wwwroot or anywhere accessible by PhysicalFileProvider. After that you can access it using IFileProvider
Reference: https://www.c-sharpcorner.com/article/file-providers-in-asp-net-core/
Edit If you just add app.UseStaticFiles(); into your StartUp, you can access wwwroot without hastle.
Reference
Completely Different Approach
you may also consider to serve your file using Controller/Action
public IActionResult GetSwaggerDoc()
{
var file = Path.Combine(Directory.GetCurrentDirectory(),
"MyStaticFiles", "swagger.json");
return PhysicalFile(file, "application/json");
}
.NET Core 2.2 could server physical file to url resource like below.
But if you use custom swagger json, your api is fixed except you change it every time.
public void Configure(IApplicationBuilder app, IHostingEnvironment env,
ILoggerFactory loggerFactory)
{
...
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(),
"swagger/v1/swagger.json")),
RequestPath = "swagger/v1/swagger.json"
});
}
while trying to use the developer preview tasks module i got a strange issue.
Teams isn't showing my module, always telling me this in console:
<BotError>Error when processing invoke response: Payload is incorrect, field is in the wrong format: task.value
What I'm sending is this:
{
"task": {
"value": {
"url": "https://<ourbaseserviceurl>",
"title": "Microsoft Ignite 2018 Vision Keynote",
"height": 700,
"width": 1000,
"fallbackUrl": "<ourbaseserviceurl"
},
"type": "message"
}
}
Was trying to use the sample but even that doesn't seem to work properly atm.
The URL is in allowedurls for the app and the same we use to communicate with the bot which is in general working fine.
Please set the task type as continue while passing TaskInfo object. Here is the
documentation.
{
"task": {
"type": "continue"
"value": {
"url": "https://<ourbaseserviceurl>",
"title": "Microsoft Ignite 2018 Vision Keynote",
"height": 700,
"width": 1000,
"fallbackUrl": "https://<ourbaseserviceurl>"
},
}
}
Here is how you display the value in a popup message box:
{
"task": {
"type": "message",
"value": "Message text"
}
}
Please try and let us know if you face any issue.
I am trying to run annotation on a video using the Google Cloud Video Intelligence API. Annotation requests with just one feature request (i.e., one of "LABEL_DETECTION", "SHOT_CHANGE_DETECTION" or "EXPLICIT_CONTENT_DETECTION"), things work fine. However, when I request an annotation with two or more features at the same time, the response does not always return all the request feature fields. For example, here is a request I ran recently using the API explorer:
{
"features": [
"EXPLICIT_CONTENT_DETECTION",
"LABEL_DETECTION",
"SHOT_CHANGE_DETECTION"
],
"inputUri": "gs://gccl_dd_01/Video1"
}
The operation Id I got back is this: "us-east1.11264560501473964275". When I run a GET with this Id, I have the following response:
200
{
"name": "us-east1.11264560501473964275",
"metadata": {
"#type": "type.googleapis.com/google.cloud.videointelligence.v1.AnnotateVideoProgress",
"annotationProgress": [
{
"inputUri": "/gccl_dd_01/Video1",
"progressPercent": 100,
"startTime": "2018-08-06T17:13:58.129978Z",
"updateTime": "2018-08-06T17:18:01.274877Z"
},
{
"inputUri": "/gccl_dd_01/Video1",
"progressPercent": 100,
"startTime": "2018-08-06T17:13:58.129978Z",
"updateTime": "2018-08-06T17:14:39.074505Z"
},
{
"inputUri": "/gccl_dd_01/Video1",
"progressPercent": 100,
"startTime": "2018-08-06T17:13:58.129978Z",
"updateTime": "2018-08-06T17:16:23.230536Z"
}
]
},
"done": true,
"response": {
"#type": "type.googleapis.com/google.cloud.videointelligence.v1.AnnotateVideoResponse",
"annotationResults": [
{
"inputUri": "/gccl_dd_01/Video1",
"segmentLabelAnnotations": [
...
],
"shotLabelAnnotations": [
...
],
"shotAnnotations": [
...
]
}
]
}
}
The done parameter for the response is set to true, but it does not have any field containing the annotations for Explicit Content.
This issue seems to be occurring at random to my novice eyes. The APIs will return a response with all parameters on some occasions and be missing one on others. I am wondering if there is anything I am missing here or something on my end that is causing this?
I did some tests using just LABEL_DETECTION, just EXPLICIT_CONTENT_DETECTION and using the three of them.
As I am not using videos with explicit content, I don't see any specific field when adding just EXPLICIT_CONTENT_DETECTION:
{
"name": "europe-west1.462458490043912485",
"metadata": {
"#type": "type.googleapis.com/google.cloud.videointelligence.v1.AnnotateVideoProgress",
"annotationProgress": [
{
"inputUri": "/cloud-ml-sandbox/video/chicago.mp4",
"startTime": "2018-08-07T14:18:40.086713Z",
"updateTime": "2018-08-07T14:18:40.230351Z"
}
]
}
}
Can you share a specific video sample, the request.json used and two different outputs, please?
I am building an iOS app to cast video content from DLNA/UPnP media server to Chromecast. The problem appears when I add media track data for the captions. The following works:
### Media Manager - LOAD: {
"type":"load",
"I":false,
"defaultPrevented":false,
"kb":true,
"data":
{
"currentTime":0,
"requestId":3,
"autoplay":true,
"media":
{
"metadata":
{
"title":"movie.mp4",
"subtitle":"Unknown",
"images":
[{
"url":"http://192.168.1.15:8895/resource/625/COVER_IMAGE",
"width":200,
"height":100
}],
"metadataType":0
},
"textTrackStyle":
{
"windowRoundedCornerRadius":8,
"windowType":"ROUNDED_CORNERS",
"foregroundColor":"#FFFFFFFF",
"fontFamily":"Helvetica",
"fontGenericFamily":"SANS_SERIF",
"fontStyle":"BOLD",
"fontScale":1,
"windowColor":"#000000FF",
"backgroundColor":"#000000FF"
},
"contentId":"http://192.168.1.15:8895/resource/338/MEDIA_ITEM/AVC_MP4_MP_SD_AAC_MULT5-0/ORIGINAL",
"contentType":"video/mp4",
"streamType":"NONE",
"duration":0
}
},
"senderId":"33:3EA56D16-D18E-4D13-87A0-717DC188F8AF"}
but when I add captions either my own or for instance from CastVideos sample app (so to make sure it is CORS enabled), it won't work with:
### Media Manager - LOAD: {
"type":"load",
"I":false,
"defaultPrevented":false,
"kb":true,
"data":
{
"currentTime":0,
"requestId":4,
"autoplay":true,
"media":
{
"tracks":
[{
"trackId":1,
"trackContentId":"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/GoogleIO-2014-CastingToTheFuture2-en.vtt",
"language":"en-US",
"subtype":"CAPTIONS",
"type":"TEXT",
"trackContentType":"text/vtt",
"name":"English Subtitle"
}],
"contentId":"http://192.168.1.15:8895/resource/338/MEDIA_ITEM/AVC_MP4_MP_SD_AAC_MULT5-0/ORIGINAL",
"streamType":"NONE",
"contentType":"video/mp4",
"duration":0,
"metadata":
{
"title":"movie.mp4",
"subtitle":"Unknown",
"images":
[{
"url":"http://192.168.1.15:8895/resource/625/COVER_IMAGE",
"width":200,
"height":100
}],
"metadataType":0
},
"textTrackStyle":
{
"windowRoundedCornerRadius":8,
"windowType":"ROUNDED_CORNERS",
"foregroundColor":"#FFFFFFFF",
"fontFamily":"Helvetica",
"fontGenericFamily":
"SANS_SERIF",
"fontStyle":"BOLD",
"fontScale":1,
"windowColor":
"#000000FF",
"backgroundColor":"#000000FF"
}
}
},
"senderId":"11:9D7D43C2-CD85-4143-82AA-2D0056AA62FC" }
I get:
[cast.receiver.MediaManager] Load metadata error cast_receiver.js:18
However the Sample app works with captions in my custom receiver without any problems and I don't find much of a difference (except for the video/image http URL, I'm just getting warnings for those):
### Media Manager - LOAD: {
"type":"load",
"I":false,
"defaultPrevented":false,
"kb":true,
"data":
{
"currentTime":0,
"requestId":3,
"autoplay":true,
"media":
{
"tracks":
[{
"trackId":1,
"trackContentId":"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/DesigningForGoogleCast-en.vtt",
"language":"en-US",
"subtype":"CAPTIONS",
"type":"TEXT",
"trackContentType":"text/vtt",
"name":"English Subtitle"
}],
"contentId":"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/DesigningForGoogleCast.mp4",
"streamType":"NONE",
"contentType":"video/mp4",
"duration":0,
"metadata":
{
"title":"Designing For Google Cast",
"subtitle":"Google IO - 2014",
"images":
[{
"url":"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images_480x270/DesigningForGoogleCast2-480x270.jpg",
"width":200,
"height":100
}],
"metadataType":0
},
"textTrackStyle":
{
"windowRoundedCornerRadius":8,
"windowType":"ROUNDED_CORNERS",
"foregroundColor":"#FFFFFFFF",
"fontFamily":"Helvetica",
"fontGenericFamily":"SANS_SERIF",
"fontStyle":"BOLD",
"fontScale":1,
"windowColor":"#000000FF",
"backgroundColor":"#000000FF"
}
}
},
"senderId":"46:F162E34A-1A6D-4C0C-A0A3-DB584C92CDF5" }
any idea?
thanks in advance.
When using captions with Chromecast, CORS is required not only for the captions but for the video stream as well. In my case the video HTTP server (e.g. Serviio) doesn't support it.