How parse site after loading javascripts with Java - javascript

Hello i need get video url from site with parsing from json. But i can't get video with tag because it creting with javascript.
<script>var player = jwplayer('player-embed');
player.setup({"file": "http://dushanbe.mix.tj/video/2/45/5bafae1306081.mp4", "image": "/img/b/7/42/113989.jpg", "aspectratio": "16:9", "autostart": false, "controls": true, "displaydescription": false, "displaytitle": false, "flashplayer": "/player/jwplayer-7.8.7/jwplayer.flash.swf", "key": "n+94L7vjfQNGEin57ap3glk3iRNum2o7AeOIWw==", "mute": false, "ph": 1, "pid": "mS6Np6yN", "preload": "auto", "primary": "html5", "repeat": false, "stagevideo": false, "stretching": "uniform", "width": "100%"});</script>
How parse site after loading javascripts on Java ?

Related

Exclamation and question marks in JavaScript comments?

I was going through some code and found these two:
// ! if (!playbackState) return
// ? if (isSpotify) setPlayerTime(playbackState.position)
In VS Code, the line with "!" was highlighted in red, the other one was highlighted in blue. Couldn't find any info on it.
I am taking a jump (or a bit of a leap since some context is missing) and assuming you have better-comments installed
To which end, the below is found in my settings.json which does explain this
"better-comments.tags": [
{
"tag": "!",
"color": "#FF2D00",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "?",
"color": "#3498DB",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
}
}

PHP loading JS video player

So I have this PHP script to show my videos in Fluid Player, it looks like this:
while($video = mysqli_fetch_array($resultat_video, MYSQLI_ASSOC))
{
echo "<video id='video-id'><source src='mov/$video[filnavn]' type='video/mp4' />";
}
Loading the Javascript to load Fluid players looks like this:
<script>
var myFP = fluidPlayer(
'video-id', {
"layoutControls": {
"controlBar": {
"autoHideTimeout": 3,
"animated": true,
"autoHide": true
},
"htmlOnPauseBlock": {
"html": null,
"height": null,
"width": null
},
"autoPlay": false,
"mute": true,
"allowTheatre": true,
"playPauseAnimation": false,
"playbackRateEnabled": false,
"allowDownload": false,
"playButtonShowing": false,
"fillToContainer": false,
"posterImage": ""
},
"vastOptions": {
"adList": [],
"adCTAText": false,
"adCTATextPosition": ""
}
});
</script>
This works perfectly for one video, but i guess I can't call the same ID in my PHP ID and expet it to work, so I guess it needs some sort of invidual ID both in the PHP and also in the Javascript?
I'm very new to Javascript so all help is apprichiated alot :)
Regards,
Jan

Why Rich file manager insert filemanager.config.json instead of insert image to text field

I've used Rich file manager with Laravel5.3.20 as the default configuration as below
Javascript
<script>
CKEDITOR.replace( 'textarea', {
filebrowserBrowseUrl: '{!! url('gallery/index.html') !!}',
///ImageBrowser : true,
autoUpdateElement:true,
language:'en'
});
</script>
Images in textarea url is wrong.
<p><img alt="" src="http://website.dev/gallery/connectors/php/filemanager.php?mode=readfile&path=%2Fae.jpg&config=filemanager.config.json&time=1477642950519" style="height:960px; width:720px" /></p>
All files, folder and sub folder have already update to userfiles
But it image url which i have to insert into Database with textarea go wrong as above url.
FileManager.configure.json
{
"_comment": "IMPORTANT : go to the wiki page to know about options configuration https://github.com/simogeo/Filemanager/wiki/Filemanager-configuration-file",
"options": {
"culture": "en",
"lang": "php",
"theme": "flat-dark",
"defaultViewMode": "grid",
"localizeGUI": true,
"showFullPath": false,
"showTitleAttr": false,
"browseOnly": false,
"showConfirmation": true,
"showThumbs": true,
"searchBox": true,
"listFiles": true,
"fileSorting": "NAME_ASC",
"folderPosition": "bottom",
"quickSelect": false,
"charsLatinOnly": false,
"splitterWidth": 200,
"splitterMinWidth": 200,
"dateFormat": "d M Y H:i",
"serverRoot": true,
"fileRoot": false,
"fileConnector": false,
"fileRootSizeLimit": false,
"baseUrl": false,
"capabilities": ["select", "upload", "download", "rename", "move", "replace", "delete"],
"logger": false,
"plugins": []
},
"security": {
"allowFolderDownload": false,
"allowChangeExtensions": false,
"allowNoExtension": false,
"normalizeFilename": true,
"uploadPolicy": "DISALLOW_ALL",
"uploadRestrictions": [
"jpg",
"jpe",
"jpeg",
"gif",
"png",
"svg",
"txt",
"pdf",
"odp",
"ods",
"odt",
"rtf",
"doc",
"docx",
"xls",
"xlsx",
"ppt",
"pptx",
"csv",
"ogv",
"avi",
"mkv",
"mp4",
"webm",
"m4v",
"ogg",
"mp3",
"wav",
"zip",
"rar"
]
},
"exclude": {
"unallowed_files": [
".htaccess",
"web.config"
],
"unallowed_dirs": [
"_thumbs",
".CDN_ACCESS_LOGS",
"cloudservers"
],
"unallowed_files_REGEXP": "/^\\./",
"unallowed_dirs_REGEXP": "/^\\./"
},
"upload": {
"multiple": true,
"paramName": "files",
"chunkSize": false,
"numberOfFiles": 5,
"fileSizeLimit": 16000000,
"overwrite": false,
"imagesOnly": false
},
"images": {
"imagesExt": [
"jpg",
"jpe",
"jpeg",
"gif",
"png",
"svg"
],
"main": {
"autoOrient": true,
"maxWidth": 1280,
"maxHeight": 1024
},
"thumbnail": {
"enabled": true,
"cache": true,
"dir": "_thumbs/",
"crop": true,
"maxWidth": 64,
"maxHeight": 64
}
},
"videos": {
"showVideoPlayer": true,
"videosExt": [
"ogv",
"mp4",
"webm",
"m4v"
],
"videosPlayerWidth": 400,
"videosPlayerHeight": 222
},
"audios": {
"showAudioPlayer": true,
"audiosExt": [
"ogg",
"mp3",
"wav"
]
},
"pdfs": {
"showPdfReader": true,
"pdfsExt": [
"pdf",
"odt",
"odp",
"ods"
],
"pdfsReaderWidth": "640",
"pdfsReaderHeight": "480"
},
"docs": {
"showGoogleViewer": true,
"docsExt": [
"doc",
"docx",
"xls",
"xlsx",
"ppt",
"pptx"
],
"docsReaderWidth": "640",
"docsReaderHeight": "480"
},
"edit": {
"enabled": true,
"lineNumbers": true,
"lineWrapping": true,
"codeHighlight": false,
"theme": "elegant",
"editExt": [
"txt",
"csv"
]
},
"customScrollbar": {
"enabled": true,
"theme": "inset-2-dark",
"button": true
},
"extras": {
"extra_js": [],
"extra_js_async": true
},
"icons": {
"path": "images/fileicons/",
"folder": "_Open.png",
"parent": "_Parent.png",
"default": "default.png"
},
"url": "https://github.com/servocoder/RichFilemanager",
"version": "1.0.6"
}
The version that you use doesn't support absolute paths in preview links, it builds preview urls via connector request path only.It was done because some users keep connector file separate from the client-side scripts (different servers and so on). After some discussions it was decided to support both options: absolute path (by default) and connector path (configurable). The feature that you need will be included in the next major release 2.0. Some discussion on your problem is here.

Vorlon.js is asking for Socket.io, but it's config is already set to include socket.io

I can see the server, but when I load the app I get a red div across the front that says:
Vorlon.js: please load socket.io before referencing vorlon.js or use includeSocketIO = true in your catalog.json file.
my terminal gives me the following output every time I load the server page:
{
"useSSL": false,
"SSLkey": "cert/server.key",
"SSLcert": "cert/server.crt",
"includeSocketIO": true,
"plugins": [
{ "id": "CONSOLE", "name": "Interactive Console", "panel": "bottom", "foldername": "interactiveConsole", "enabled": true },
{ "id": "DOM", "name": "Dom Explorer", "panel": "top", "foldername": "domExplorer", "enabled": true },
{ "id": "MODERNIZR", "name": "Modernizr", "panel": "bottom", "foldername": "modernizrReport", "enabled": true },
{ "id": "OBJEXPLORER", "name": "Obj. Explorer", "panel": "top", "foldername": "objectExplorer", "enabled": true },
{ "id": "XHRPANEL", "name": "XHR", "panel": "top", "foldername": "xhrPanel", "enabled": true },
{ "id": "NGINSPECTOR", "name": "Ng. Inspector", "panel": "top", "foldername": "ngInspector", "enabled": false },
{ "id": "NETWORK", "name": "Network Monitor", "panel": "top", "foldername": "networkMonitor", "enabled": true },
{ "id": "RESOURCES", "name": "Resources Explorer", "panel": "top", "foldername": "resourcesExplorer", "enabled": true }
]
}
(fourth line down, includeSocketIO is set to true).
Has anyone else had a similar issue (and hopefully been able to fix it)?
It looks like the problem comes from CORS errors. Socket.io doesn't have the right permission to write across domains. To fix the issue so I could open my app on my iPad, I did this:
Make sure the host address that you load the page from and the Vorlon script address are the same. e.g., for me, I am hitting http://mymachine.local/... on my iPad, and I set the Vorlon script URL to http://mymachine.local:1337/vorlon.js in my page. Instead of mymachine.local, this might be your local network IP (192.168.x.x).
I also had to load Vorlon as the first script in my page, before any other libraries.
If it's still not working, open your app in a second browser (I tested in FF with the Vorlon server open in Chrome) and check the console for CORS errors.
Hope this helps.

Simogeo FileManager does not show the images

I have Simogeo FileManager version 2.0.0.
I extracted it in root/tools, changed the config file, set up the permissions, hooked it to tinymce and everything seemed to work. The tinymce opens the popup window with FileManager. I can create a folder, change folder and upload files.
Problem is when I upload file(s) I cannot see them in the FileManager but they are uploaded in the directories I created. The only thing I can see are directories.
I am testing it on Windows 8.1 with uwAmp, PHP 5.3.24 or PHP 5.4.31.
Config file:
{
"_comment": "IMPORTANT : go to the wiki page to know about options configuration https://github.com/simogeo/Filemanager/wiki/Filemanager-configuration-file",
"options": {
"culture": "en",
"lang": "php",
"theme": "flat-dark",
"defaultViewMode": "grid",
"autoload": true,
"showFullPath": false,
"showTitleAttr": false,
"browseOnly": false,
"showConfirmation": true,
"showThumbs": true,
"generateThumbnails": true,
"searchBox": true,
"listFiles": true,
"fileSorting": "default",
"chars_only_latin": true,
"dateFormat": "d M Y H:i",
"serverRoot": true,
"fileRoot": false,
"relPath": false,
"logger": false,
"capabilities": ["select", "download", "rename", "delete", "replace"],
"plugins": []
},
"security": {
"allowFolderDownload": false,
"allowChangeExtensions": false,
"allowNoExtension": false,
"uploadPolicy": "DISALLOW_ALL",
"uploadRestrictions": [
"jpg",
"jpeg",
"gif",
"png",
"svg",
"txt",
"pdf",
"odp",
"ods",
"odt",
"rtf",
"doc",
"docx",
"xls",
"xlsx",
"ppt",
"pptx",
"csv",
"ogv",
"mp4",
"webm",
"m4v",
"ogg",
"mp3",
"wav",
"zip",
"rar"
]
},
"upload": {
"multiple": true,
"number": 5,
"overwrite": false,
"imagesOnly": false,
"fileSizeLimit": 16
},
"exclude": {
"unallowed_files": [
".htaccess",
"web.config"
],
"unallowed_dirs": [
"_thumbs",
".CDN_ACCESS_LOGS",
"cloudservers"
],
"unallowed_files_REGEXP": "/^\\./",
"unallowed_dirs_REGEXP": "/^\\./"
},
"images": {
"imagesExt": [
"jpg",
"jpeg",
"gif",
"png",
"svg"
],
"resize": {
"enabled":true,
"maxWidth": 1280,
"maxHeight": 1024
}
},
"videos": {
"showVideoPlayer": true,
"videosExt": [
"ogv",
"mp4",
"webm",
"m4v"
],
"videosPlayerWidth": 400,
"videosPlayerHeight": 222
},
"audios": {
"showAudioPlayer": true,
"audiosExt": [
"ogg",
"mp3",
"wav"
]
},
"edit": {
"enabled": true,
"lineNumbers": true,
"lineWrapping": true,
"codeHighlight": false,
"theme": "elegant",
"editExt": [
"txt",
"csv"
]
},
"customScrollbar": {
"enabled": true,
"theme": "inset-2-dark",
"button": true
},
"extras": {
"extra_js": [],
"extra_js_async": true
},
"icons": {
"path": "images/fileicons/",
"directory": "_Open.png",
"default": "default.png"
},
"url": "https://github.com/simogeo/Filemanager",
"version": "2.0.0-dev"
}
The problem was with the type in referer.
tinymce was passing ?type=image and filemanager expected ?type=images
Are you sure listFiles option is set to true inc config file ?
See the related doc : https://github.com/simogeo/Filemanager/wiki/Filemanager-configuration-file
listFiles Default value true. Display files in right column (filetree). If set to false, will display only folders. Can take value true or false.
For further help, could you copy-paste an URL or at least your config file!?

Categories

Resources