flowplayer playlist track auto change is giving error - angularjs

I am using Flowplayer(in Mean js audio streaming project) for RTMP audio streaming with Wowza streaming engine software and using below service of angular js.
app.service('flowPlayerService', ['$cookies','constant',function ($cookies,constant) {
player: null,
currentTitle:'',
constructPlaylist: function (playlist) {
var currentObj = this;
this.player = flowplayer("flashPlayer", "lib/flowplayer/flowplayer-3.2.18.swf", {
playlist:playlist,
onBegin: function(talk){
console.log('clip changed');
},
onFail:function(){
//alert('loading failed');
},
onFinish:function(){
console.log('finisheds');
},
// engine:'html5',
// Specify the location of the RTMP plugin.
plugins: {
rtmp: {
url: 'lib/flowplayer/flowplayer.rtmp-3.2.13.swf',
netConnectionUrl: 'rtmp://10.10.3.11/vod'
},
controls: {
autoHide: 'never',
url: 'lib/flowplayer/flowplayer.controls-3.2.16.swf',
tooltips: {
buttons: true,
fullscreen: false,
pause: 'Continue playing',
},
playlist: true,
fullscreen:false,
},
dock: {
enabled:false,
gap: 5,
autoHide: false
}
},
onMouseOut:function(){
console.log('mouse out');
}
//canvas: {backgroundGradient: 'none'}
});
console.log(this.player);
//this.player = flowplayer();
},
}
While playing single track it is working fine.But when I try to run playlist first track plays file but when first track finished it gives error like:-
VM36229:1 [ERROR] time 13:51:35.968 :: 201, Unable to load stream or clip file, cannot play video: Error #2154, clip: '[Clip] 'mp3:02 Jashn-E-Bahaara-1469775940586.mp3''
below playlist array example:-
[{
url:"mp3:track.mp3",
provider:"rtmp",
title:'track title'
},
{
url:"mp3:track1.mp3",
provider:"rtmp",
title:'track title1'
}
]
please help.

Passing the "duration" to clip objects resolve this issue.

Related

quagga doesn't detected my primary barcode

I tried to use the quagga module to detect my barcode number but I couldn't find the best initialization to do that.
this is my quagga initial:
Quagga.init({
inputStream: {
type : "LiveStream",
constraints: {
width: 640,
height: 480,
facing: "environment" // or user
}
},
locator: {
patchSize: "medium",
halfSample: true
},
numOfWorkers: 2,
decoder: {
readers : [ "code_128_reader"]
},
locate: true
}, function(err) {
if (err) {
return console.log(err);
}
Quagga.start();
});
Quagga.onDetected(this._onDetected);
and this is the image that I am going to detect:
enter image description here
finally after scanning this barcode quagga detected "6251503158" but I need to 1503158fe0ce46e6cbd
who knows the best initialization quagga to detect my barcode?

Input data given to 'points' is not a valid GeoJSON object

I want to populate some of the cooridnates what I get from the back end on mapbox map below is my sample json what I receive from backend
[
{
"model": "bike_parking_info.bikeparkinginfo",
"pk": 13561,
"fields": {
"start_station_id": 3276,
"start_station_name": "Marin Light Rail",
"start_station_latitude": "40.71458403535893",
"start_station_longitude": "-74.04281705617905",
"end_station_id": 3256,
"end_station_name": "Pier 40 - Hudson River Park",
"end_station_latitude": "40.7277140777778",
"end_station_longitude": "-74.01129573583603"
}
}
]
I have around 1200 objects to load from back end with coordinates
I am iterating it over below loop
let result = []
data.forEach(function (data1, index) {
//console.log(data1['fields']);
var jsonData={
// feature for Mapbox DC
'type': 'Feature',
'geometry': {
'type': 'Point',
'coordinates': [
Number(data1['fields']['start_station_longitude']),
Number(data1['fields']['start_station_latitude']),
]
},
'properties': {
'title': data1['fields']['start_station_name']
}
}
result.push(jsonData);
export const mapDetails = state => state.getInfo.features;
this is how I am populating on UI
var map = new mapboxgl.Map({
container: mapContainer.current,
style: 'mapbox://styles/mapbox/light-v10',
center: [-96, 37.8],
zoom: 3
});
map.on('load', function () {
// Add an image to use as a custom marker
map.loadImage(
'https://docs.mapbox.com/mapbox-gl-js/assets/custom_marker.png',
function (error, image) {
if (error) throw error;
map.addImage('custom-marker', image);
// Add a GeoJSON source with 2 points
map.addSource('points', {
'type': 'geojson',
'data': {
'type': 'FeatureCollection',
'features': **mapDetails**
}
});
// Add a symbol layer
map.addLayer({
'id': 'points',
'type': 'symbol',
'source': 'points',
'layout': {
'icon-image': 'custom-marker',
// get the title name from the source's "title" property
'text-field': ['get', 'title'],
'text-font': [
'Open Sans Semibold',
'Arial Unicode MS Bold'
],
'text-offset': [0, 1.25],
'text-anchor': 'top'
}
});
}
);
});
but I am getting below errors constantly
"Input data given to 'points' is not a valid GeoJSON object."
please help me out here what is going wrong ?
I got my fault I had to use useSelector to retrieve data back to my UI so had to make below changes
let dataToDisplay = useSelector(mapDetails);

How to autohide LocalNotification after interval in Capacitor?

I have tried this code but getting error in timeoutAfter method as it is not recognized.
LocalNotifications.schedule({
notifications: [
{
title: "Incoming Call",
body: bodyValue,
id: idValue,
timeoutAfter: 3000
},
],
});
Although timeoutAfter method is available in Cordova plugin but not in Capacitor.

Create a custom element in EditorJs

I added EditorJs plugin in my react js application:
import ReactDOM from "react-dom";
import React, { Component } from "react";
import EditorJs from "react-editor-js";
import { EDITOR_JS_TOOLS } from "./constants";
class ReactEditor extends Component {
render() {
return (
<EditorJs
tools={EDITOR_JS_TOOLS}
data={{
blocks: [
{
type: "header",
data: {
text: "Editor.js",
level: 2
}
},
{
type: "paragraph",
data: {
}
},
{
type: "header",
data: {
text: "Key features",
level: 3
}
},
{
type: "list",
data: {
style: "unordered",
items: [
"It is a block-styled editor",
"It returns clean data output in JSON",
"Designed to be extendable and pluggable with a simple API"
]
}
},
{
type: "header",
data: {
text: "What does it mean «block-styled editor»",
level: 3
}
},
{
type: "paragraph",
data: {
text:
'Workspace in classic editors is made of a single contenteditable element, used to create different HTML markups. Editor.js <mark class="cdx-marker">workspace consists of separate Blocks: paragraphs, headings, images, lists, quotes, etc</mark>. Each of them is an independent contenteditable element (or more complex structure) provided by Plugin and united by Editor\'s Core.'
}
},
{
type: "paragraph",
data: {
text:
'There are dozens of ready-to-use Blocks and the simple API for creation any Block you need. For example, you can implement Blocks for Tweets, Instagram posts, surveys and polls, CTA-buttons and even games.'
}
},
{
type: "header",
data: {
text: "What does it mean clean data output",
level: 3
}
},
{
type: "paragraph",
data: {
text:
"Classic WYSIWYG-editors produce raw HTML-markup with both content data and content appearance. On the contrary, Editor.js outputs JSON object with data of each Block. You can see an example below"
}
},
{
type: "paragraph",
data: {
text:
'Given data can be used as you want: render with HTML for <code class="inline-code">Web clients</code>, render natively for <code class="inline-code">mobile apps</code>, create markup for <code class="inline-code">Facebook Instant Articles</code> or <code class="inline-code">Google AMP</code>, generate an <code class="inline-code">audio version</code> and so on.'
}
},
{
type: "paragraph",
data: {
text:
"Clean data is useful to sanitize, validate and process on the backend."
}
},
{
type: "delimiter",
data: {}
},
{
type: "paragraph",
data: {
text:
"We have been working on this project more than three years. Several large media projects help us to test and debug the Editor, to make it's core more stable. At the same time we significantly improved the API. Now, it can be used to create any plugin for any task. Hope you enjoy. 😏"
}
},
{
type: "image",
data: {
file: {
url:
"https://codex.so/upload/redactor_images/o_e48549d1855c7fc1807308dd14990126.jpg"
},
caption: "",
withBorder: true,
stretched: false,
withBackground: false
}
}
],
version: "2.12.4"
}}
/>
);
}
}
ReactDOM.render(<ReactEditor />, document.getElementById("root"));
According to the documentation i can create a custom element:
render() {
return (
<EditorJs holder="custom">
<div id="custom" />
</EditorJs>
);
}
Question: I want to add as a custom element an input: <input type="text"/>, but i don't manage even if i do:
<EditorJs holder="custom">
<input id="custom" type="text"/>
</EditorJs>
Who knows how to add this custom element in the plugin above?
demo: https://codesandbox.io/embed/react-editor-js-23opz
I found in the documentation that i can create a plugin for editor.js:
https://editorjs.io/the-first-plugin. One of example looks like this:
class SimpleImage {
static get toolbox() {
return {
title: 'Image',
icon: '<svg width="17" height="15" viewBox="0 0 336 276" xmlns="http://www.w3.org/2000/svg"><path d="M291 150V79c0-19-15-34-34-34H79c-19 0-34 15-34 34v42l67-44 81 72 56-29 42 30zm0 52l-43-30-56 30-81-67-66 39v23c0 19 15 34 34 34h178c17 0 31-13 34-29zM79 0h178c44 0 79 35 79 79v118c0 44-35 79-79 79H79c-44 0-79-35-79-79V79C0 35 35 0 79 0z"/></svg>'
};
}
render() {
return document.createElement('input');
}
save(blockContent) {
return {
url: blockContent.value
}
}
}

Uncaught Rally.data.ModelFactory.getModel(): Could not find registered factory for type: milestone

Trying to display Milestone for each release, but when trying to create DataStore for Milestone getting error
Uncaught Rally.data.ModelFactory.getModel(): Could not find registered factory for type: milestone
below is my code any ideas or suggestions on this
_getMileStones: function(startDate, endDate, project_id) {
var startDateFilter = Ext.create('Rally.data.QueryFilter', {
property: 'TargetDate',
operator: '>',
value: startDate
});
startDateFilter = startDateFilter.and({
property: 'TargetDate',
operator: '<',
value: endDate
});
startDateFilter = startDateFilter.and({
property: 'TargetDate',
operator: '!=',
value: null
});
startDateFilter = startDateFilter.and({
property: 'TargetDate',
operator: '!=',
value: null
});
var filters = startDateFilter;
Ext.create('Rally.data.wsapi.Store',{
model: 'milestone',
autoLoad: true,
filters: filters,
context: {
project: project_id,
projectScopeDown: true,
projectScopeUp: false
},
fetch: ['Name','FormattedID','DisplayColor'],
listeners: {
load: function(store,records) {
console.log("records values", records);
}
}
}, this);
},
The current stable rc3 release candidate of AppSDK2 predates milestones. They are not available in rc3. When I use rc3 I get the same error you get. If I switch to "x", in the app's config file, and use rab build to rebuild the app, the error goes away:
{
"name": "myapp",
"className": "CustomApp",
"server": "https://rally1.rallydev.com",
"sdk": "x",
"javascript": [
"App.js"
],
"css": [
"app.css"
]
}
Generally it is not recommend using "x" because it is constantly changes. It is not a stable version. But as long as you know that, you may use "x". The AppSDK next release may not be too far in the future, and it will include support for Milestones.
UPDATE: AppSDK2.0 GA has not been announced yet, but it is expected to be released soon. If you use "sdk":"2.0" you get Milestone data.
"x" returns Milestones, but it is a head version that is subject to constant changes. 2.0rc3 does not have Milestones.
You may choose to use 2.0 even though it is not formally available yet.
This app example:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
Ext.create('Rally.data.wsapi.Store',{
model: 'milestone',
autoLoad: true,
fetch: ['Name'],
listeners: {
load: function(store,records) {
console.log("records values", records);
}
}
}, this);
}
});
Along with this config:
{
"name": "milestones",
"className": "CustomApp",
"server": "https://rally1.rallydev.com",
"sdk": "2.0",
"javascript": [
"App.js"
],
"css": [
"app.css"
]
}
will return milestone data:

Resources