Musickit JS - Add video to playlist - itunes

In the link below, you can add tracks to a library playlist https://developer.apple.com/documentation/applemusicapi/add_tracks_to_library_playlist .. Is there a musickit JS API endpoint to add a music video to a playlist?

Apologies, answered my own question so will post answer for anyone in future.
Yes the endpoint https://api.music.apple.com/v1/me/library/playlists/{id}/tracks (https://developer.apple.com/documentation/applemusicapi/add_tracks_to_library_playlist) requires a LibraryPlaylistTracksRequest object.
The LibraryPlaylistTracksRequest object has a LibraryPlaylistRequestTrack object (https://developer.apple.com/documentation/applemusicapi/libraryplaylistrequesttrack).
The 'type' property/attribute on this object can be songs, music-videos, library-songs, or library-music-videos. (https://developer.apple.com/documentation/applemusicapi/libraryplaylistrequesttrack)

Related

Add JavaScript documentation Sencha Architect

Is it possible to add documentation (not just comments) to your javascript methods in Sencha Architect. I cannot seem to add lines above methods because of the specific method views in Architect.
I am talking about the following documentation:
/**
* this documentation
*/
bla: function() {
//I do know how to add this comment!
}
UPDATE:
Seems that it is not possible :(
http://www.sencha.com/forum/showthread.php?281079-Sencha-Architect-Code-Documentation-%28JSDocs%
I will keep this thread open to see if someone knows a workaround to the problem.
Architect 3.1 or 3.1.1 will add commenting. It's done in prototype form but we are racing to add Ext JS 5 so it's on the back burner until then.

How to perform apprequest using native dialogs

We are living confusing times were documentation from the past merges with documentation from the present.
I am trying to make an app request, I have FB SDK 3.1 and iOS6.
I am checking code from the address:
https://developers.facebook.com/docs/howtos/send-requests-using-ios-sdk/
I can not make it work, takes my attention the next paragraph:
In your app delegate import the Facebook.h header file and replace the Facebook framework
"FacebookSDK/FacebookSDK.h" import declaration: #import "Facebook.h"
I don't have Facebook class anymore in my libraries.
Facebook class had to be initialized with app id, delegate, etc... I don't know how it is supposed to work now, specialy having FBSession in place.
My question is, how to make a modern apprequest? And... what is with the documentation?
You can only get the requests dialog with the previous API, it's not available for the current one.
Make sure you follow this step from the docs -
The headers can be found here ~Documents/FacebookSDK/FacebookSDK.framework/Versions/A/DeprecatedHeaders. Drag the whole DeprecatedHeaders folder and deselect the ''Copy items into destination group's folder (if needed)'' option to add the headers as a reference.
Add those headers to your project and you'll have access to the Facebook class.

Kaltura - Force player to stop with API only?

Is there any way to force a Kaltura videoplayer to stop ONLY using code and the Kaltura API?
Currently I have solved it by adding a Access Control Profile named "Free preview" under Settings > Access Control in KMC and then added this profile to the Entries I've choosen.
I then add the session to the players flashvars to restrict non-members to only watch the preview, not the whole clip.
But I would like to restrict ALL, or even better selected Categories of clips by using only code, so I don't need to involve KMC.
Is that possible?
Alt) Can you create a new player in KMC and restrict it to viewing only X seconds, no matter what length of Entry? Then I can do the check if user is valid or not and get the category via API and show it in the "preview-player" och the "default player".
If I use the mediaProxy.mediaPlayTo attribute the clip stops, but is easily started again by presing play.
Would greatly appreciate an answer
I got this answer from a guy named oferc in a different forum:
You can listen to the head move event and pause the clip it goes beyond a certain time (then if someone pressed play, you can stop it again)
function jsCallbackReady(player_id) {
my_kdp = $("#"+player_id).get(0); // document.getElementById(player_id) if you do not use jquery/ prefer pure js
my_kdp.addJsListener("kdpReady", "kdpReady"); // when you load the player with an entry (and the player is ready to begin playing it using doPlay for instance)
}
function kdpReady() {
my_kdp.addJsListener("playerUpdatePlayhead","headMove");
}
function headMove(position) {
if (position > "30") { // Your Time, example 30 seconds
my_kdp.sendNotification('doStop')
}
}
Works like a charm!
fredrik_w - neither of the ways you chosen here are a good option to restrict access.
in both cases, your videos are made public, and can be easily accessible by anyone.
The best way to limit access to a video is by defining an Access Control, and like everything in Kaltura, you can define an ACL using API as well.
Check this out as a reference sample-
http://blog.kaltura.org/turning-profit-online-video-made-easy-using-paypal-html5-digital-goods

Navigation Framework issue silverlight 4

If I use the navigation framework in silverlight and say mainFrame.Navigate(URI), does this always call the ctor of the page and create a new object? I create the objects of all my pages in the mainPage as they are used at a lot of places, but since this creates a new object the initializations are lost. Can I not use existing objects with this ?
Thanks
You have to work with the ContentLoader of the Navigation Frame....
Basically do your own implementation of INavigationContentLoader ....
David Poll has a ton of articles on his blog about INavigationContentLoader...
http://www.davidpoll.com/2009/11/30/opening-up-silverlight-4-navigation-introduction-to-inavigationcontentloader/
As well as this nice video + post of karl shifflett on Silverlight TV gives you great understanding...
http://channel9.msdn.com/shows/SilverlightTV/Advanced-Silverlight-Navigation-Scenarios-Part-2-Silverlight-TV-39/
http://karlshifflett.wordpress.com/2010/07/07/non-linear-navigation-in-silverlight-4/
let me know if this helps

How to show file thumbnails?

I got a TableView with a list of files in a directory. Now i want to add a colum with the file-thumbnails. How do i do this?
The icon of the file can be obtained by NSWorkspace's iconForFile:, see Apple doc on NSWorkspace.
To get the thumbnail, one uses one of the public function of the client side of QuickLook called QLThumbnailImageCreate, see Apple doc on QuickLook. Note that this is a CoreFoundation-type call, not a Cocoa method. If you're not used to CoreFoundation, read here.