{"action":"created","issue":{"url":"https://api.github.com/repos/jleight/omxplayer/issues/1","labels_url":"https://api.github.com/repos/jleight/omxplayer/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/jleight/omxplayer/issues/1/comments","events_url":"https://api.github.com/repos/jleight/omxplayer/issues/1/events","html_url":"https://github.com/jleight/omxplayer/issues/1","id":93350104,"number":1,"title":"dbuscontrol.sh script works while example in README does not.","user":{"login":"hagna","id":216688,"avatar_url":"https://avatars.githubusercontent.com/u/216688?v=3","gravatar_id":"","url":"https://api.github.com/users/hagna","html_url":"https://github.com/hagna","followers_url":"https://api.github.com/users/hagna/followers","following_url":"https://api.github.com/users/hagna/following{/other_user}","gists_url":"https://api.github.com/users/hagna/gists{/gist_id}","starred_url":"https://api.github.com/users/hagna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hagna/subscriptions","organizations_url":"https://api.github.com/users/hagna/orgs","repos_url":"https://api.github.com/users/hagna/repos","events_url":"https://api.github.com/users/hagna/events{/privacy}","received_events_url":"https://api.github.com/users/hagna/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jleight/omxplayer/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"jleight","id":169047,"avatar_url":"https://avatars.githubusercontent.com/u/169047?v=3","gravatar_id":"","url":"https://api.github.com/users/jleight","html_url":"https://github.com/jleight","followers_url":"https://api.github.com/users/jleight/followers","following_url":"https://api.github.com/users/jleight/following{/other_user}","gists_url":"https://api.github.com/users/jleight/gists{/gist_id}","starred_url":"https://api.github.com/users/jleight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jleight/subscriptions","organizations_url":"https://api.github.com/users/jleight/orgs","repos_url":"https://api.github.com/users/jleight/repos","events_url":"https://api.github.com/users/jleight/events{/privacy}","received_events_url":"https://api.github.com/users/jleight/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-07-06T18:55:36Z","updated_at":"2015-07-07T21:24:23Z","closed_at":null,"body":"omxplayer is Version   : 843744e [master] (Build date: Sat, 27 Jun 2015 00:49:24 +0000)\r\ngolang is 1.4.2 cross compiler for arm (5g)\r\nyou can find dbuscontrol.sh (which does work) here https://github.com/popcornmix/omxplayer/blob/master/dbuscontrol.sh\r\n\r\nThe code I run is the example provided with logging:\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"github.com/jleight/omxplayer\"\r\n\t\"log\"\r\n\t\"time\"\r\n)\r\n\r\nfunc main() {\r\n    log.SetFlags(log.Lshortfile)\r\n    omxplayer.SetUser(\"root\", \"/root\")\r\n    player, err := omxplayer.New(\"/root/testvideo.mp4\")\r\n    if err != nil {\r\n        log.Println(err)\r\n    }\r\n\r\n    player.WaitForReady()\r\n    err = player.PlayPause()\r\n    if err != nil {\r\n        log.Println(err)\r\n    }\r\n\r\n    time.Sleep(5 * time.Second)\r\n    err = player.ShowSubtitles()\r\n    if err != nil {\r\n        log.Println(err)\r\n    }\r\n\r\n    time.Sleep(5 * time.Second)\r\n    err = player.Quit()\r\n    if err != nil {\r\n        log.Println(err)\r\n    }\r\n}\r\n```\r\n\r\nAnd this is what it does:\r\n```\r\nroot@raspberrypi:~# ./omx \r\nmain.go:20: The name org.mpris.MediaPlayer2.omxplayer was not provided by any .service files\r\nmain.go:26: Message did not receive a reply (timeout by message bus)\r\nmain.go:32: The name org.mpris.MediaPlayer2.omxplayer was not provided by any .service files\r\n```\r\n\r\nAlthough if I can use dbuscontrol.sh while ./omx is running to see that the video is paused:\r\n```\r\nroot@raspberrypi:~# ./dbuscontrol.sh status\r\nDuration: 9088000\r\nPosition: -200000\r\nPaused: true\r\n```"},"comment":{"url":"https://api.github.com/repos/jleight/omxplayer/issues/comments/119346803","html_url":"https://github.com/jleight/omxplayer/issues/1#issuecomment-119346803","issue_url":"https://api.github.com/repos/jleight/omxplayer/issues/1","id":119346803,"user":{"login":"jleight","id":169047,"avatar_url":"https://avatars.githubusercontent.com/u/169047?v=3","gravatar_id":"","url":"https://api.github.com/users/jleight","html_url":"https://github.com/jleight","followers_url":"https://api.github.com/users/jleight/followers","following_url":"https://api.github.com/users/jleight/following{/other_user}","gists_url":"https://api.github.com/users/jleight/gists{/gist_id}","starred_url":"https://api.github.com/users/jleight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jleight/subscriptions","organizations_url":"https://api.github.com/users/jleight/orgs","repos_url":"https://api.github.com/users/jleight/repos","events_url":"https://api.github.com/users/jleight/events{/privacy}","received_events_url":"https://api.github.com/users/jleight/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T21:24:23Z","updated_at":"2015-07-07T21:24:23Z","body":"Upon further investigation, this looks like a timing issue. If I add a five second sleep before the initial call to `player.PlayPause()`, everything seems to work fine:\r\n\r\n```go\r\nplayer.WaitForReady()\r\ntime.Sleep(5 * time.Second)\r\nerr = player.PlayPause()\r\n```\r\n\r\nClearly the `player.WaitForReady()` is not fulfilling it's intended purpose. I'll continue trying to figure out a better implementation for it."}}