How to setup RSS feed to support Chapters? - rss

This question is regarding JWPlayer 7.3.
According to this JWPlayer article about Chapters (see very bottom), JW player has support for chapters from an RSS feed:
Chapters can also be loaded as part of RSS feeds. See the RSS Feeds Reference for more info.
https://support.jwplayer.com/customer/portal/articles/1407454-adding-chapter-markers
Unfortunately, there are no details on what RSS data is parsed on the RSS page. Can anyone shed some light on this issue?

It does not use the rss file, but the vtt file, also used for subtitles.
So you have to create a chapters.vtt file, with this example content:
WEBVTT
Chapter 1
00:00:00.000 --> 00:01:00.000
First chapter
Chapter 2
00:01:00.000 --> 00:02:00.000
Second chapter
After you can setup the player:
var playerInstance = jwplayer("container");
playerInstance.setup({
file: "video.mp4",
tracks: [{
file:'chapters.vtt',
kind:'chapters'
}],
});
The video will have chapters. That's all.
UPDATE
You can also use Chapters with playlist feeds, RRS or JSON files, this is a JSON example with 2 media files, and 2 chapters files:
setup player
var playerInstance = jwplayer("container");
playerInstance.setup({
playlist: "playlist.json"
});
playlist.json
[{
"file": "myvideo_1.mp4",
"title": "First Video",
tracks: [{
file:'chapters_1.vtt',
kind:'chapters'
}],
},
{
"file": "myvideo_2.mp4",
"title": "Second Video",
tracks: [{
file:'chapters_2.vtt',
kind:'chapters'
}],
}]
chapters_1.vtt
WEBVTT
Chapter 1
00:00:00.000 --> 00:01:00.000
First chapter first video
Chapter 2
00:01:00.000 --> 00:02:00.000
Second chapter first video
chapters_2.vtt
WEBVTT
Chapter 1
00:00:00.000 --> 00:01:30.000
First chapter second video
Chapter 2
00:01:30.000 --> 00:02:30.000
Second chapter second video

Related

Tradingview widget add price line

How to create custom price line in the tradingview widget? Example; as in the picture below.
i used vue3js and electronjs.
My widget code;
window.tradingView = new window.TradingView.widget({
autosize: true,
symbol: 'BINANCE:' + this.symbolData.symbol,
interval: '15',
timezone: this.local,
theme: 'light',
style: '1',
locale: 'tr',
toolbar_bg: '#f1f3f6',
enable_publishing: false,
save_image: false,
container_id: this.id,
});
You can use the Trading View Online Configurator to conveniently configure the chart to your needs.
For example using the following configuration you get the price line with OHLC information (in Turkish AYDK)
EDIT (after comment): This response assumed the question is about the line with OHLC information. As pointed out by the author in the comment, this is not the case. If OP asked for the horizontal line within the chart, I am afraid this is not officially supported within the JS widget.
From FAQ on TradeView Widget:
I'd like to add a custom pine script to the widget.
It is not possible to add pine scripts to widgets at this time. > > You can publish an idea with your script and embed it.
There might be an unofficial (undocumented) way do it, but I would strongly suggest against relying on it. As always with undocumented features they might stop working at any time. If that is an acceptable risk there are some more ways in addition to SO to contact people that might know about such an option.
Settings
Code
<!-- TradingView Widget BEGIN -->
<div class="tradingview-widget-container">
<div id="tradingview_3a5dc"></div>
<div class="tradingview-widget-copyright">TradingView'den <span class="blue-text">SHIBUSDT Grafiği</span></div>
<script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
<script type="text/javascript">
new TradingView.widget(
{
"autosize": true,
"symbol": "BINANCE:SHIBUSDT",
"interval": "15",
"timezone": "Etc/UTC",
"theme": "light",
"style": "1",
"locale": "tr",
"toolbar_bg": "#f1f3f6",
"enable_publishing": false,
"save_image": false,
"container_id": "tradingview_3a5dc"
}
);
</script>
</div>
<!-- TradingView Widget END -->
Result

Multiples instances of VideoJS playlist are deprecated

I'm developing a Wordpress Plugin that allows users to add custom video playlists to their pages or posts, and for that I'm using Videojs and Videojs Playlist libraries.
I've successfully managed to add a single playlist into a page, but when a second one is created the first player is disabled.
First Player disabled
Other problem I'm facing is that, although the vjs-playlist div is added, it only shows in the first player created.
Code display in the browser
var options = {"techOrder": ["html5","youtube", "flash"]};
var myPlayer = videojs('my-playlist-player', {options, "autoplay": false, "controls": true, "fluid": true, "liveui": true});
myPlayer.playlist([{
name: 'Test item 1 type .m3u8',
description: 'Testing for videojs-playlist-ui integration',
duration: '45',
sources: [
{src: '//vjs.zencdn.net/v/oceans.mp4',type: 'video/mp4'}
],
thumbnail: [
{
srcset: '//bcvid.brightcove.com/players-example-content/clouds-1800.jpg',
type: 'image/jpeg',
style: 'max-height: 120px;'
}
]
},{
name: resTitle,
description: resDesc,
duration: resDuration,//'45',
sources: [
{src: resItemSrc, type: resMime}
],
thumbnail: [
{
srcset: resThumbnail,
type: resImgType,
style: thumbStyle//'max-height: 120px;'
}
]
}
}
]);
console.log(myPlayer.playlist());
myPlayer.playlistUi({el: document.getElementById('vjs-playlist'), horizontal: true});
myPlayer.playlist.autoadvance(1);
I believe my errors happen because videojs functions are detecting the same id in all elements, but if so how could I avoid this?
Any other ideas or opinions on why this errors might be happening, would be great.
Thanks in advance.
A bit more of information, I wanted to check how many players the script detected and so I printed in the console the window.videojs.players and only one player is detected even if more are created. Check result
Could this be because they have the same ID? If so how could it be fixed? HTML Result

AMP analytics events for scroll

I am trying to add analytics to my AMP page.while tra
<!doctype html>
<html amp lang="en">
<head>
<meta charset="utf-8">
<title>Hello, AMP Analytics</title>
<link rel="canonical" href="http://example.ampproject.org/article-metadata.html" />
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
<style>
body {
opacity: 0
}
</style><noscript><style>body {opacity: 1}</style></noscript>
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
<amp-analytics type="googleanalytics">
<script type="application/json">
{
"vars": {
"account": "UA-xxxxxxxx-x"
},
"triggers": {
"trackPageview": {
"on": "visible",
"request": "pageview"
},
"scrollPings": {
"on": "scroll",
"scrollSpec": {
"verticalBoundaries": [10, 20, 30, 40, 50, 60, 70, 80, 90]
},
"request": "event",
"vars": {
"eventId": "scroll"
}
},
"trackEvent": {
"selector": "#event-test",
"on": "click",
"request": "event",
"vars": {
"eventCategory": "${canonicalUrl}",
"eventAction": "click"
}
}
}
}
</script>
</amp-analytics>
<h1 id="header">AMP Page</h1>
<span id="event-test" class="box">
Click here to generate an event
</span>
<h2>
Page semi-protected Blog From Wikipedia, the free encyclopedia "Blogger" redirects here. For the Google service with same name, see Blogger (service). For other uses, see Blog (disambiguation). Not to be confused with .blog. Journalism Simons Perskaart
DOM.jpg News Writing style Ethics Objectivity News values Attribution Defamation Editorial independence Journalism school Index of journalism articles Areas Arts Business Data Entertainment Environment Fashion Medicine Politics Science Sports Technology
Trade Traffic Weather World Genres Advocacy Analytic Blogging Broadcast Citizen Civic Collaborative Comics-based Community Data Database Gonzo Immersion Investigative Literary Muckraking Narrative "New Journalism" Non-profit Online Opinion Peace Photojournalism
Scientific Sensor Underground Visual Watchdog Social impact Fake news Fourth Estate Fifth Estate Freedom of the press Infotainment Media bias Public relations Press service Propaganda model Yellow journalism News media Newspapers Magazines TV and
radio Internet News agencies Alternative media Roles Journalists (reporters) Columnist Blogger Editor Copy editor Meteorologist News presenter Photographer Pundit / commentator Newspaper nicu buculei 01.svg Journalism portal Category: Journalism v
t e A blog (a truncation of the expression "weblog")[1] is a discussion or informational website published on the World Wide Web consisting of discrete, often informal diary-style text entries ("posts"). Posts are typically displayed in reverse chronological
order, so that the most recent post appears first, at the top of the web page. Until 2009, blogs were usually the work of a single individual,[citation needed] occasionally of a small group, and often covered a single subject or topic. In the 2010s,
"multi-author blogs" (MABs) have developed, with posts written by large numbers of authors and sometimes professionally edited. MABs from newspapers, other media outlets, universities, think tanks, advocacy groups, and similar institutions account
for an increasing quantity of blog traffic. The rise of Twitter and other "microblogging" systems helps integrate MABs and single-author blogs into the news media. Blog can also be used as a verb, meaning to maintain or add content to a blog. This
page was last edited on 18 May 2017, at 21:34. Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered
trademark of the Wikimedia Foundation, Inc., a non-profit organization. Privacy policyAbout WikipediaDisclaimersContact WikipediaDevelopersCookie statementMobile viewWikimedia Foundation Powered by MediaWiki
</h2>
</body>
</html>
ckPageview and trackEvent generate events. scrollPings does not.
Has anybody tries this out?
** The reference code for scrollPing is from AMP by Example page.
Thanks in advance
< amp - analytics type = "googleanalytics" >
<script type = "application/json" > {
"vars": {
"account": "UA-XXXXXXXX-X"
},
"triggers": {
"trackPageview": {
"on": "visible",
"request": "pageview"
},
"scrollPings": {
"on": "scroll",
"scrollSpec": {
"verticalBoundaries": [10, 20, 30, 40, 50, 60, 70, 80, 90]
},
"request": "event",
"vars": {
"eventId": "scroll"
}
},
"trackEvent": {
"selector": "#event-test",
"on": "click",
"request": "event",
"vars": {
"eventCategory": "${canonicalUrl}",
"eventAction": "click"
}
}
}
}
</script>
</amp-analytics>
Working with another one of our developers we managed to figure this out, at least partially. There are some URL substitute variables and you need to use the one for verticalScrollBoundary to report a percentage (like you're doing for your test event there). Please note the percent sign after the '${verticalScrollBoundary}%' variable is OPTIONAL and added to be consistent in our analytics report with non-AMP scroll depth tracking.
This worked for us:
'scrollPings' => array(
'on' => 'scroll',
'request' => 'event',
'scrollSpec' => array(
'verticalBoundaries' => array( 0, 25, 50, 75, 100 )
),
'vars' => array(
'eventCategory' => 'AMP Scroll Depth',
'eventAction' => 'Scrolled',
'eventLabel' => '${verticalScrollBoundary}%',
),
),
Apologies, that's PHP syntax that gets translated into JSON b/c we're using the WordPress plugin. For JSON it would be (I believe):
"scrollPings": {
"on": "scroll",
"request": "event",
"scrollSpec": {
"verticalBoundaries": [0, 25, 50, 75, 100]
},
"vars": {
"eventCategory": "AMP Scroll Depth",
"eventAction": "Scrolled",
"eventLabel": "${verticalScrollBoundary}%"
},
}
The one thing we haven't figured out is that it seems to be logging a null value of either "(not set)" or "%" if you include a percent sign like I have at the end of the'${verticalScrollBoundary}%' variable. Please note that percent sign is OPTIONAL. If there's no percent sign we just get a (not set) value being logged which doesn't seem to equate to 0 (you'll notice I've added 0 in the array of possible values).

Piranha CMS TinyMCE add class to image

I'm building a web app with Piranha CMS & I'm attempting to alter the TinyMCE editor to allow for adding a class to an image. I've seen the relevant TinyMCE configuration docs
http://www.tinymce.com/wiki.php/Configuration:image_class_list
However, even after updating the relevant tinymce.init
https://github.com/PiranhaCMS/Piranha/blob/013ed850636a299c71f860f9ae769572e768af26/Core/Piranha/Areas/Manager/Views/Shared/Partial/TinyMCE.cshtml
to be
<script type="text/javascript" src="~/res.ashx/areas/manager/content/js/ext/tiny_mce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
mode: 'specific_textareas',
editor_selector: "editor",
convert_urls: false,
plugins: [
"autoresize autolink code hr paste piranhaimage link"
],
image_class_list: [
{title: 'None', value: ''},
{title: 'img-left', value: 'img-left'},
{title: 'img-border', value: 'img-border'},
{title: 'img-responsive', value: 'img-responsive'}
],
width: "100%",
height: "340",
autoresize_min_height: 340,
#if (File.Exists(Server.MapPath("~/areas/manager/content/css/editor.css"))) {
<text>content_css: "#Url.Content("~/areas/manager/content/css/editor.css")",</text>
}
toolbar: "bold italic underline | bullist numlist hr | formatselect removeformat | cut copy paste | link piranhaimage | code"
});
</script>
I find there is no effect (I've definitely cleard browser cache). I've noticed that the plugin that TinyMCE in Piranha CMS is using is piranhaimage not plain image as in TinyMCE docs. If that's the cause, how to configure for piranhaimage then?
The plugin code for piranhaimage can be found here:
https://github.com/PiranhaCMS/Piranha/blob/master/Core/Piranha/Areas/Manager/Content/Js/Ext/tiny_mce/plugins/piranhaimage/plugin.min.js
Unfortunately the current version doesn't support overriding assets, just views in the manager interface, but it could be a nice feature to add support to the core plugin for alignment.
One way of trying it out in your local project is to download TinyMCE and place it in your local project, then copy the piranhaimage plugin to your local TinyMCE directory. After that you can change the following line in the TinyMCE.cshtml you've already overridden:
<script type="text/javascript"
src="~/res.ashx/areas/manager/content/js/ext/tiny_mce/tinymce.min.js">
</script>
And instead let it point to your local URL! Then you can change it to what ever you want!
Regards

How could I embed a HighCharts interactive graph into a wordpress 3.5.1 page?

My name is Josh and I work for a community college newspaper. I've just recently found Highcharts and have been attempting to embed a interactive graph into a post for our website, rather unsuccessfully. Actually, it's been a complete failure.
I have already read over and attempted this post to no avail:
highcharts and wordpress
There's no one I know who I can take this problem to and even though I feel like I've tried every suggested solution, Unfortunately, I'm rather illiterate when it comes to html and code. Any help would be GREATLY appreciated.
I am working with Wordpress 3.5.1 Here is the point I am currently at:
I am running: Allow PHP in Posts and Pages Plugin & Interactive Javascript and CSS.
For the header option of the post I have:
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"> </script>
<script src="http://www.domain.com/wp-content/uploads/2013/03/highcharts1.js" type="text/javascript"></script>
In some of the websites (this one included), I've seen mention of uploading the Highcharts library onto your wordpress server. I've uploaded the highcharts.js file through the media library but I have a feeling that I am doing this incorrectly?
In the post itself I have placed:
[php]
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'line',
marginRight: 130,
marginBottom: 25
},
title: {
text: 'State Funding of DSPS Services',
x: -20 //center
},
subtitle: {
text: 'Source:MPR Associates Report',
x: -20
},
xAxis: {
categories: ['2003-04', '2004-05', '2005-06', '2006-07', '2007-08',
'2008-09', '2009-10', '2010-11', '2011-2012', '2012-13']
},
yAxis: {
title: {
text: '$ Million'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
this.x +': '+ this.y +' Million';
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -10,
y: 100,
borderWidth: 0
},
series: [{
name: 'College Total Funding',
data: [77.8, 81.8, 86.2, 102.1, 109.3, 108.9, 64.9, 64.8, 64.6, 65.7]
}]
});
});
});
[/php]
<div id="container" style="width: 100%; height: 400px"></div>
The page comes up blank, as it has been for the past hundred attempts or so. I apologize if this is post in the wrong spot or undesired. Any advice or solutions are greatly appreciated.
Thank you,
J
In order to get a chart rendered, you need several things to be in place:
Include the highcharts.js - done
Include some javascript which defines and creates a chart - done
Give highcharts a place to put the chart - ?
I think you may be missing the last element. This is done by including a tag inside your post somewhere. The div can be named using the 'id' property as follows:
<div id='container'>mydiv</div>
You have already told highcharts that you want to 'renderTo' a place called 'container', so this should be all you need.
To add this in wordpress, go into the post editor and make sure you are in 'html' mode. In my version of wordpress, this is a tab just to the top right of the post editing pane with the options 'visual' and 'html'.
In html mode, just add my div code in the place where you want the chart to appear. Hopefully that will do the trick.
there could be several reasons for the chart not showing up.
1)The scripts (jquery and highcharts) need to be loaded onto your page and this is not immediately obvious in wordpress. There's a couple of ways - if you aren't a coder then the simplest is to go to the header.php of your theme. (Appearance->Editor) and look for the header.php file on the right hand side. In the head section you'll need to register the highcharts library...
wp_register_script('myHighchartsHandle','highcharts/js/highstock.js',array('jquery'),'1.0a');
wp_enqueue_script('myHighchartsHandle');
The path to the high stock/highcharts library will change depending on where it is on your server of course.
2) The code is javascript - your supplied code has php tags. I think you could edit that to have js tags in the square brackets and install the 'Allow javascript in posts and pages' plugin. Note that plugin needs you to prefix any square brackets in code with a backslash so you'll need to do that to get the data series formatted properly.
3) It does look like you have a div container outside of your code which is good. But as the other answer suggest you will need that and the id has to match the renderTo in the code.
4) If it doesn't work after these 3 steps then you could be falling foul of jQuery noConflict.Wordpress sets jquery in this mode by default.
Instead of $ in your js code you may have to replace with jQuery. The highcharts library is ok in the code you've used.
Happy to help more if required. I have since built much of this into a plugin which is much cleaner...

Resources