{"action":"created","issue":{"url":"https://api.github.com/repos/vimeo/player.js/issues/294","repository_url":"https://api.github.com/repos/vimeo/player.js","labels_url":"https://api.github.com/repos/vimeo/player.js/issues/294/labels{/name}","comments_url":"https://api.github.com/repos/vimeo/player.js/issues/294/comments","events_url":"https://api.github.com/repos/vimeo/player.js/issues/294/events","html_url":"https://github.com/vimeo/player.js/issues/294","id":345164370,"node_id":"MDU6SXNzdWUzNDUxNjQzNzA=","number":294,"title":"Cannot Embed with only 'id' using javascript API","user":{"login":"sblanchon","id":5294736,"node_id":"MDQ6VXNlcjUyOTQ3MzY=","avatar_url":"https://avatars1.githubusercontent.com/u/5294736?v=4","gravatar_id":"","url":"https://api.github.com/users/sblanchon","html_url":"https://github.com/sblanchon","followers_url":"https://api.github.com/users/sblanchon/followers","following_url":"https://api.github.com/users/sblanchon/following{/other_user}","gists_url":"https://api.github.com/users/sblanchon/gists{/gist_id}","starred_url":"https://api.github.com/users/sblanchon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sblanchon/subscriptions","organizations_url":"https://api.github.com/users/sblanchon/orgs","repos_url":"https://api.github.com/users/sblanchon/repos","events_url":"https://api.github.com/users/sblanchon/events{/privacy}","received_events_url":"https://api.github.com/users/sblanchon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-27T09:54:15Z","updated_at":"2018-09-21T17:00:51Z","closed_at":null,"author_association":"NONE","body":"### Expected Behavior\r\nI wanted a player embedded in a div containing few 'data-vimeo-*' attributes, and a 'data-options' to pass options to be tested before being passed to iframe embedded\r\noptions are {id: 999999, background: true, autoplay: true, loop: true} in JSON stringified format.\r\n\r\n**_my backend code_**\r\n`<div id=\"vimeo-player-id-${uuid}\"\r\n        class=\"${'js-video-player vimeo-player-iframe ' + (pdict.iframeclassname ? pdict.iframeclassname : '')}\"\r\n        data-vimeo-title=\"0\"\r\n        data-vimeo-playsinline=\"1\"\r\n        data-options=\"${JSON.stringify(optionsToEmbed)}\"\r\n    ></div>`\r\n\r\nIn javascript, i passed to Vimeo.Player() constructor, the DOM element with class 'js-video-player' and an option object, with correct id, background, autoplay and loop properties, got with jQuery.data() method.\r\n\r\nI expected my vimeo player to load the video corresponding to my 'id', but i got a 404 NOTFOUND error thrown by API ?\r\n\r\n### Actual Behavior\r\nSeems there is a javascript error when encoding 'e' which is my video url calculated with my options ?\r\n`var i = \"https://vimeo.com/api/oembed.json?url=\" + encodeURIComponent(e);`\r\nThe url of my encoded video seems to contains en extra \" (double-quote character) at the end of it, that make server respond a 404\r\n\r\n### Steps to Reproduce\r\n\r\n`$('.js-video-player').each(function () {\r\n    var options = $(this).data('options') || {};\r\n    if (options.id) {\r\n                    options.muted = options.autoplay; // To allow autoplay we need to mute the video\r\n                    options.responsive = 1;\r\n                    //options.url = 'https://player.vimeo.com/video/' + parseInt(options.id, 10);\r\n                    var player = new Vimeo.Player(this, options);\r\n    }\r\n});`\r\n\r\nNote: if i uncomment the calculation of options.url to pass in to the constructor, it works !\r\n\r\nMy questions :\r\n1) Is there a reason why i can't only pass in my 'id' for the player to work ? Is it a bug ?\r\n2) data-vimeo-muted=1 attribute was not propagated to <iframe> while embedding, so i had to pass it as an option in javascript ? Is it the proper way ? Is there data-vimeo-* attributes that are not taken into account when embedding ??\r\n\r\nThanks a lot for you responses.\r\nStéphane"},"comment":{"url":"https://api.github.com/repos/vimeo/player.js/issues/comments/423605552","html_url":"https://github.com/vimeo/player.js/issues/294#issuecomment-423605552","issue_url":"https://api.github.com/repos/vimeo/player.js/issues/294","id":423605552,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzYwNTU1Mg==","user":{"login":"danielstgt","id":13825655,"node_id":"MDQ6VXNlcjEzODI1NjU1","avatar_url":"https://avatars1.githubusercontent.com/u/13825655?v=4","gravatar_id":"","url":"https://api.github.com/users/danielstgt","html_url":"https://github.com/danielstgt","followers_url":"https://api.github.com/users/danielstgt/followers","following_url":"https://api.github.com/users/danielstgt/following{/other_user}","gists_url":"https://api.github.com/users/danielstgt/gists{/gist_id}","starred_url":"https://api.github.com/users/danielstgt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielstgt/subscriptions","organizations_url":"https://api.github.com/users/danielstgt/orgs","repos_url":"https://api.github.com/users/danielstgt/repos","events_url":"https://api.github.com/users/danielstgt/events{/privacy}","received_events_url":"https://api.github.com/users/danielstgt/received_events","type":"User","site_admin":false},"created_at":"2018-09-21T17:00:51Z","updated_at":"2018-09-21T17:00:51Z","author_association":"NONE","body":"This issue is the same as https://github.com/vimeo/player.js/issues/270"}}
{"actor":{"display_login":"danielstgt"}}