I would like to add an option for users to add a link to a video to insert into the post.
The thing is that for users sometimes this might be confusing, this value could be:
The actual video embed code
The link of the embed iframe (src)
The link of the video in the site
Is there any plugin that checks and turns any of those into the embed code? Of course I could try to implement this, but getting to a stable solution could be slow, and there won't be a point if there is any public feature alike
Any workarouds like this?
I remember of jquery oembed, but this was only working for second option I think
I've been using oembed in a few forms, but the latest plugin I've used was jquery-oembed-all
This works for the video url instance.
If you need to allow all options you could use some javascript to detect if an iframe tag exists.
Related
I am looking to implement special functionality for my website, where loading a page that has multiple other consecutive pages (such as a search result) pre-loads the next page into the browser, accessible via the "forward" button. This sort of functionality is seen on the MSN News website; see the following screenshot.
I am looking to have this functionality implemented through JavaScript on a static deployment, as in, the server would just send everything client side. Is this at all possible? Where could I look for documentation for such a thing? I have already attempted to search for the answer to this inquiry elsewhere with no avail. Thanks in advance.
I'd avoid looking to use the forward button as its not a primary target but rather preload links on the page like the next button, but rather do it through something called InstaClick. If you're looking to specifically target the forward button itself best place to look is at the History API but thats browser specific. I've attached Mozillas doc on this.
https://developer.mozilla.org/en-US/docs/Web/API/History_API
http://instantclick.io/
https://github.com/dieulot/instantclick
So I have been looking to make a Sound Cloud widget for code-pen for testing then I will implement it to my website. what I am trying to aim for is something that displays a couple of tabs that you can click on that will let you change the view to different parts of my profile such as my re-posts and my tracks that is all I want but my problem is that i do not know how to code at all I have looked at the soundcloud resources:
https://developers.soundcloud.com/docs/widget
but it is all confusing as I have no idea what to start with as a base and what I need. I have looked for templates but found nothing that matches my keywords.
for now all I am trying to do is create a widget that matches this Image
using css js and html and any other code that can be embedded in html
I also want to make it possible for anyone to modify it for their own account by a variable at the top of the JavaScript code for the key, a commented out link to get a consumer key and any other key that is related/required for the widget, the user id / user URL, how to find the user id with link.
for now those are not required because getting a working widget is my first priority even if it does not look good. so I am asking for help on what I NEED to do first to get a base to it for example what lines do I need in my html to import the SDK for the widget? what are the requirements do I need for my widget such as a API key and what one because I know you can enable certain things with api's and disable options such as playback
https://www.w3schools.com/howto/howto_js_tabs.asp
Make the href="www.example.soundcloud.com/user/re-posts" for each tab, I am unfamiliar with soundcloud API's though
TinyMCE already has a bunch of nice plugins out of the box. One of them - media plugin - wich i would like to extend.
Problem: I use an exterenal Video service with an API. In order to play video on the page, i need to embed it with an iframe. The iframe-code - especialy the src-attribute - can be generated only on the server by specific page_id and video_id and some other data from database. So whoever tries to embed a video from that particular video-service needs an already generated iframe-block or at least a generated url and that is the problem.
Goal: Somehow extend tinymce' functionality. Ideally the "media" plugin.
I would like to add either a new input-field to "General" tab or create a separate tab with additional input fields. Something like that:
or
Question: What would be the best (or simplest) way to achive this ?
The best, and only, way to achieve this is to edit the code (plugin.js) of the media plugin (the non-minified files can be downloaded here https://github.com/tinymce/tinymce)
Adding a tab and fields to the interface can be done by extending the tabpanel (in the file around line 155). And furthermore writing the code to submit your fields to the editor. I have worked with plugins in tinymce before and must say it can be a complicated matter.
A very short introduction on plugins in tinymce can be found here: http://www.tinymce.com/wiki.php/Tutorials:Creating_a_plugin
Good luck!
I'm creating a streaming music service on my website using a fork of jPlayer called jPlaylister.
One thing this doesn't do is scroll the playlist to the currently playing song.
I would also like to implement a nicer scrollbar for manually scrolling the playlist (instead of using browser default).
I came across http://jscrollpane.kelvinluck.com/index.html which looks perfect for what i want (it can do both things).
So when i tried implementing it, it just didn't work. No results, nothing. It's like the code wasn't even there.
I of course included the neccessary js files and put the below JS function in my head:
$(function()
{
$('.scroll-pane').jScrollPane();
});
I actually changed the .scroll-pane class name to an existing class name (the one which i want to scroll of course).
If anyone has successfully got this working (as i've seen a few questions on the same subject on various forums, websites etc) then i'd love some help!
The development version (http://jplaylister.yaheard.us/dev/) has this feature...I'm long overdue for a release, but prepped the files for someone else and will be happy to pass it on to you if you are interested.
nc (jplaylister author)
email at thenickchapman ... gmail or use the jplayer google group and tag me or something crazy.
I am trying to find a way to take the value of share social button see:
http://www.1stwebdesigner.com/wordpress/wordpress-plugins-social-sharing/
Buttons are located on left side of the page.
Now I thought maybe using JavaScript on document ready to take the value of the specific span//div. however they are in a iframe and it seem to not work:
here is what I have so for:
<iframe id="something_iframe"
src="http://www.facebook.com/plugins/like.php?href=http://www.freelancer.com/projects/myskills.php&send=false&layout=button_count&width=100&show_faces=false&action=like&colorscheme=light"
scrolling="no" frameborder="0"
style="border:none; overflow:hidden; width:100px; height:21px;"
allowTransparency="true">
</iframe>
<div id="something">
</div>
<script>
var $j = jQuery.noConflict();
$j(document).ready(function() {
$j("#something").text($j(".pluginCountTextDisconnected").text());
});
</script>
I think however even if this JavaScript way would work its still messy and there probably a better way in PHP API or something.
This is simply not possible due to the same origin policy because these spans are loaded inside a iFrame that has gets loaded from a different page than yours.
When the same origin policy is active you cannot manipulate the contents of the iFrame or access it. There may be some hacks around this, but I'd suggest you look at the API of twitter and Facebook as they are likely to expose the like/retweet count through the API.
This also has the benefit of not breaking whenever Twitter/Facebook changes something to their share buttons. These are not meant to be a public interface so they are free to change their code anytime.
Update: After looking a bit more at the Site markup it seems you can access the Google+ button as it is placed in the HTML of the side and not inside an iFrame, but Facebook and Twitter run their widget button inside an iFrame where you don't have access to.
I don't know if this is something that you might be looking into, but I wanted to add this answer in case anyone happens to look up a similar question.
If what I understand from the question is right, you want a way to get the count of shares / likes / anything from social plugins and use that number.
While working on a similar problem, I've found the following plugin: Sharrre
It avoids the same origin policy issue by calling some of the APIs from PHP using CURL, and some straight from Javascript. It already is set up for a couple of the most used social sites and it's pretty easy to add other sites if you want to.
It does have the disadvantages that you have to manually add the link you want to search the share count for, and that on the server side it's sometimes a little laggy (due to response times from the social sites). Also, with every API change from social sites you use, you must check that it's still working as it should.
Please know that I don't have any affiliation to the plugin / site, I just used the plugin and it really helped me, and I hope it will help others as well.