Closed (won't fix)
Project:
AudioField
Version:
7.x-1.0-beta8
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2012 at 20:51 UTC
Updated:
17 Oct 2016 at 12:07 UTC
Jump to comment: Most recent
Comments
Comment #1
tamerzg commentedAre you sure your field machine name is field_audio? You can see it under Content type->Structure->Edit your content type -> Manage fields
Comment #2
tbom commentedIt took a newbie me a long time but finally I made it work.
1) you need to add the field_audio in the content type of your preferred content (e.g. in a Basic page) , my first mistake was that I added a new content type : Audio
2) then you need to add on the Manage display tab of the Content Type of your choice (e.g. basic page) the Audio field of machine name field_audio, filed type:File, widget Audio_upload.
After having that this you use in a basic page the code provided:
$node=menu_get_object(); $audiofile = file_create_url($node->field_audio['und'][0]['uri']); $info = pathinfo($audiofile); $op = $info['extension']; print audiofield_get_player($audiofile, $op);and then I had two errors first undefined index when I realised that most probably I need to upload the audio file on that page (using the edit page) because the reference otherwise would not work, since in the expression $node->field_audio['und'][0]['uri'] there is no filename, I assumed that it needs to be referenced by the index on that page.
So I uploaded the mp3, and then I got two players the inline one and another one at the bottom.
Then I went in the manage display of the field type and changed everywhere for the Audio into . Only then I got the player inline in between the text and the second player disappeared.
Have I done something wrong above?
Comment #4
ws.agency commented