I'm embeding Youtube API player on page via SWFObject. There is a fullscreen button, but when i click it - button goes gray and no fullscreen occures. Testing this on Google Chrome v 37.
Exact embed code:
var params = { allowScriptAccess: "always" };
var atts = { id: "myytplayer" };
swfobject.embedSWF("http://www.youtube.com/v/aowSGxim_O8?
enablejsapi=1&playerapiid=ytplayer",
"ytapiplayer", "720", "480", "8", null, null, params, atts);
Related
I'm trying to get DriveItem activities on OneDrive for business using this Graph API https://learn.microsoft.com/en-us/graph/api/itemactivitystat-getactivitybyinterval?view=graph-rest-1.0&tabs=csharp
But the Activity property of the returned response is always null and I can not get what I need (activities on the specific DriveItem, like edits, comments etc.)
Definitely there are some activities for that driveItem, webhook is triggered on item change and I'm able to track changes using delta API: https://learn.microsoft.com/en-us/graph/delta-query-overview.
The code I'm using is like this:
var request = new GraphServiceClient(new DelegateAuthenticationProvider(msg =>
{
msg.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
return Task.CompletedTask;
}))
.Drives[driveId].Items[driveItemId]
.GetActivitiesByInterval(start, end, "day")
.Request();
var resultPage = await request.GetAsync();
The full response with Activities == null is below:
{
"Access": {
"ActionCount": 3,
"ActorCount": 1,
"AdditionalData": {
"timeSpentInSeconds": {
"ValueKind": 4
}
},
"ODataType": null
},
"Create": null,
"Delete": null,
"Edit": null,
"EndDateTime": "2022-02-12T23:59:59+00:00",
"IncompleteData": {
"MissingDataBeforeDateTime": null,
"WasThrottled": false,
"AdditionalData": {
"resultsPending": {
"ValueKind": 6
},
"notSupported": {
"ValueKind": 6
}
},
"ODataType": null
},
"IsTrending": null,
"Move": null,
"StartDateTime": "2022-02-12T00:00:00+00:00",
"Activities": null,
"ActivitiesNextLink": null,
"Id": null,
"ODataType": "#microsoft.graph.itemActivityStat",
"AdditionalData": {
"aggregationInterval": {
"ValueKind": 3
}
}
}
Is there a way to get a list of activities for the specific OneDrive item through API (comments, edits, etc.)?
The only way of getting user activities I've found so far is to use this SharePoint site list API instead of OneDrive API directly: https://learn.microsoft.com/en-us/graph/api/list-get?view=graph-rest-1.0&tabs=csharp
,where {list-id} is user's SharePoint site list named userActivityFeedHiddenList.
The API response is a bit cryptic, but it's possible to see who commented what on a document and when.
Response examples can be found here https://charleslakes.com/2020/09/28/onedrive-hidden-list-user-activity/
I want to develop application where i can listen songs from spotify without login into it.like we search from soundcloud and play it.
i had implemented API for searching tracks
https://api.spotify.com/v1/search?q=Muse&type=track,artist&market=US
it provides me list of tracks now how can i play it without login.
the response is look likw below
{
external_urls: {
spotify: "https://open.spotify.com/artist/12Chz98pHFMPJEknJQMWvI"
},
followers: {
href: null,
total: 1856949
},
genres: [ ],
href: "https://api.spotify.com/v1/artists/12Chz98pHFMPJEknJQMWvI",
id: "12Chz98pHFMPJEknJQMWvI",
images: [
{
height: 667,
url: "https://i.scdn.co/image/0b3c04473aa6a2db8235e5092ec3413f35752b8d",
width: 1000
},
{
height: 427,
url: "https://i.scdn.co/image/cf54c2d4a4549fb484862a9c475fc897bb5ce707",
width: 640
},
{
height: 133,
url: "https://i.scdn.co/image/837c977024362a7f6d1873027e2a8664e21f911a",
width: 200
},
{
height: 43,
url: "https://i.scdn.co/image/0b14ff7b9c9fcfaf6b662fe439576c531b0aa8d8",
width: 64
}
],
name: "Muse",
popularity: 81,
type: "artist",
uri: "spotify:artist:12Chz98pHFMPJEknJQMWvI"
},
I implemented a Spotify player this summer, and indeed you have to use their SDK (https://github.com/spotify/ios-sdk).
Without logging in you can only play the 30 second previews of the songs, only when you are logged in you can play the full songs. The previews can (have to) be played with the iOS audio classes, the full songs when logged in have to be played with the SDK's own player.
I am new to backbone and am using backbone in my rails application . This is what I am doing in my application
I am using Backbone Paginator for pagination support in my application as well using Gmaps for rendering locations on gmaps , for each time I am displaying 5 records from the server with pagination and displaying corresponding 5 location in map view , so now I need to show the remaining locations on map when I click on paginated links (prev page , next page) , I think I need to write some click events , but I am not sure where to write and how to write this events , Can any one please help me . please review the code below I have written evnets but those are not working
Thanks in advance
var Listings = Backbone.PageableCollection.extend({
model: Bdemo.Models.Listing,
mode: "server" ,
url: '/listings' ,
events: {
"click #paginationSelect" : "fetchSelectedData"
},
fetchSelectedData: function(){
console.log("CAMEEEEEEEEEEEEEEEEEEEEEEEEEEE")
},
// Initial pagination states
state: {
pageSize: 3,
/* sortKey: "updated",*/
order: 1
},
queryParams: {
totalPages: null,
totalRecords: null,
sortKey: "sort"
},
parseState: function (resp, queryParams, state, options) {
return {totalRecords: resp.total_pages};
},
parseRecords: function (resp, options) {
return resp.listings;
}
});
#ratnakar:
All you need is events function. Set an id for each of your paginated links. Then include the events function. I hope that you're developing SPA(single page application). With that note assume the following settings.
In the homeview.js("templates" folder) page include the paginated links enclosed by the footer tag.
<footer>
<button id="prevPage">previous</button>
<button id="nextPage">next</button>
</footer>
then the go to the corresponding homeview.js view file("views" folder)
backboneApp.Views.homeview = Backbone.View.extend({
//Default "events" function for handling delegate events.
events:{
//catching click events
"click #prevPage" : "goPrevious" //on click of DOM which has id as prevPage, calling a function goPrevious.
"click #nextPage" : "goNext" //same as above call goPrevious function.
},
//Defining the user created function goPrevious and goNext.
goPrevious: function(){
//Make your server call here.... for the previous 5 records.
},
goNext: function(){
// server call here for the next 5 records.
}
});
Thus the basic idea of using delegate events for paginated links is defined above.
From your question I understand that you are using backgrid-paginator in server mode.
Binding to the click event won't work, because you need to make sure that the models have been fetched from the server before you can access their data.
You can bind to your collections' request event and act on the xhr.done()
In your view:
initialize: function() {
this.listenTo(this.record_collection, "request", this.onCollectionRequested);
},
onCollectionRequested: function(collection, xhr, options) {
_this = this;
xhr.done(function(){
_this.showRecordLocationsOnMap(collection);
})
},
showRecordLocationsOnMap: function(records) {
/* Update your map here */
}
Hi finally solved this by calling my own function(callGmap) from Backbone.PageableCollection , here is my new code
var Listings = Backbone.PageableCollection.extend({
model: Bdemo.Models.Listing,
mode: "server" ,
url: '/listings' ,
events: {
"click #paginationSelect" : "fetchSelectedData"
},
fetchSelectedData: function(){
console.log("CAMEEEEEEEEEEEEEEEEEEEEEEEEEEE")
},
// Initial pagination states
state: {
pageSize: 3,
/* sortKey: "updated",*/
order: 1
},
queryParams: {
totalPages: null,
totalRecords: null,
sortKey: "sort"
},
parseState: function (resp, queryParams, state, options) {
return {totalRecords: resp.total_pages};
},
parseRecords: function (resp, options) {
callGmap(resp.hash);
return resp.listings;
}
});
I've been working with a great audio recorder which is recorder.js-master.
But I can't make the upload work with MVC Controller.
Here's my javascript function.
function AudioUpload(title, description) {
Recorder.upload({
method: "POST",
url: '#Url.Action("Upload", "Audio")',
audioParam: "Recording",
params: {
"Title": title,
"Description": description
},
success: function (responseText) {
alert(responseText.Success);
},
error: function () {
alert("error");
},
progress: NULL
});
}
Here's my AudioController
public JsonResult Upload(VoicePassage passage)
{
//upload Audio
return Json(new { Success = true });
}
I have a breakpoint in Upload just to know that it's going to my Controller but it doesn't.
Please help.
Here's the reference I follow. http://marc.codewisp.com/2013/05/07/in-browser-audio-recording-recorder-js-asp-net-mvc/?replytocom=12#respond
Regards,
Christian
I'm the author of the original post you linked to.
A few things to try out:
Add a breakpoint to the JavaScript function: if it doesn't hit, something's wrong with your JavaScript.
Check your browser's network activity: In Chrome, under Developer Tools, go to the Network tab and attempt the upload. See if it is hitting the right URL.
Make sure you're using '#Url.Action...' inside a Razor view. It won't work in external JavaScript files.
If you need #Url.Action, you can probably use it in your Razor view, assign it to a temporary global variable and use it in your external JavaScript file.
In your View, add the following before the reference to your external JS:
<script type="text/javascript">
var audioAction = '#Url.Action("Upload", "Audio")';
</script>
In your JavaScript file, change '#Url.Action("Upload", "Audio")' to audioAction, as in:
function AudioUpload(title, description) {
Recorder.upload({
method: "POST",
url: audioAction,
audioParam: "Recording",
params: {
"Title": title,
"Description": description
},
success: function (responseText) {
alert(responseText.Success);
},
error: function () {
alert("error");
},
progress: NULL
});
}
I'm trying to run YT player on my site, but there is a problem with IE8 and IE9 - player is not loading.
http://code.google.com/intl/pl/apis/youtube/youtube_player_demo.html
Code:
$(document).ready(function() {
loadPlayer('{$videos[0].videoID}','{$playlist}');
}
function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("ytPlayer");
ytplayer.addEventListener("onError", "onPlayerError");
ytplayer.addEventListener("onStateChange", 'onStateChange');
}
function loadPlayer(ytID,ytList) {
var videoID = ytID;
var params = {
allowScriptAccess: "always",
allowFullScreen: true
};
var atts = {
id: "ytPlayer"
};
swfobject.embedSWF("http://www.youtube.com/v/" + videoID +
"?version=3&enablejsapi=1&playerapiid=player1&autohide=1&showinfo=0&autoplay=1&controls=1&loop=1&fs=1&origin=http://www._____.com&playlist="+ytList+'&key='+devKey,
"videoDiv", "620", "350", "9", null, null, params, atts);
}
I don't know if this causes the problem (shouldn't work on any environment), but there's a syntax error on line 3:
}
You're not closing the ready(), should be:
});
IE Does not support the addEventListener method. Try re-working that.